Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: src/sys/kern



Module Name:    src
Committed By:   tsutsui
Date:           Mon Sep 21 04:24:36 UTC 2026

Modified Files:
        src/sys/kern: vfs_bio.c

Log Message:
vfs_bio: retry fresh buffer allocation if recycling fails

getnewbuf() uses buf_lotsfree() to choose whether to
allocate a fresh buffer before trying BQ_AGE and BQ_LRU.

If fresh allocation is skipped and no buffer can actually be
recycled, it sleeps on needbuffer_cv even when the buffer cache
is still below its high water mark.

In that situation, a thread which could release a buffer may
itself need another buffer, resulting in a deadlock.

To avoid this, if recycling finds no usable buffer and bufmem is
still below bufmem_hiwater, make one more PR_NOWAIT fresh allocation
attempt before sleeping.  See PR kern/60584 for details.

Worth to pullup to netbsd-11.


To generate a diff of this commit:
cvs rdiff -u -r1.308 -r1.309 src/sys/kern/vfs_bio.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.




Home | Main Index | Thread Index | Old Index