PR_GROWINGNOWAIT useless ?

Manuel Bouyer <[email protected]>
Newsgroups gmane.os.netbsd.devel.kernel
Message-ID <[email protected]>
Hello,
while investigating the deadlock reported in
https://mail-index.netbsd.org/tech-kern/2025/05/05/msg030407.html
I looked at pool_grow(). It seems that the PR_GROWINGNOWAIT is used only for
this:
                        if (pp->pr_flags & PR_GROWINGNOWAIT) {
                                /*
                                 * This needs an unlock/relock dance so
                                 * that the other caller has a chance to
                                 * run and actually do the thing.  Note 
                                 * that this is effectively a busy-wait.
                                 */  
                                mutex_exit(&pp->pr_lock);
                                mutex_enter(&pp->pr_lock);
                                return ERESTART;
                        }

but as I understand it, the thread setting PR_GROWINGNOWAIT in pool_grow()
is holding the pr_lock and will never release it before clearing
PR_GROWINGNOWAIT. If pool_allocator_alloc() or pool_alloc_item_header()
was releasing the lock, it would have to eventually sleep to reaquire
it and it's not allowed without PR_WAITOK.
So it seems that PR_GROWINGNOWAIT could be removed.

Did I miss something ?

-- 
Manuel Bouyer <[email protected]>
     NetBSD: 26 ans d'experience feront toujours la difference
--
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.