Source-Changes archive

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

CVS commit: src



Module Name:    src
Committed By:   yamt
Date:           Sun Mar 22 11:25:12 UTC 2026

Modified Files:
        src/share/man/man9: uvm.9
        src/sys/uvm: uvm_extern.h uvm_meter.c uvm_pager.c uvm_pdaemon.c
            uvm_stat.c
        src/usr.bin/vmstat: vmstat.c

Log Message:
uvm: retire pdpending

this commit retires pdpending.
namely,

* stop counting it in kernel
* stop printing it in userland
* uvmexp/uvmexp_sysctl fields are left intact for compatibility

pdpending is documented in a few places:
  uvm(9),uvm_extern.h: "number of times daemon got a pending pageout"
  vmstat: "total pending pageouts"
but no one seems to know what it actually means.

here's my reasearch:

in 1998, uvm was imported to our tree.
("initial import of the new virtual memory system, UVM, into
-current.") if my reading of the ancient version of uvm is
correct, pdpending was the number of times uvm_pager_put
returned VM_PAGER_PEND. VM_PAGER_PEND was something like
EINPROGRESS. it was the mechanism for the pager to report
that the request was queued for async processing. in that era,
some pagers only had synchronous i/o implementations.
(eg. uvn_io was backed by VOP_WRITE.)
anyway, at this point, this counter was about internal
implementation details. more for kernel developers than users.

in 2000, UBC had come and replaced uvn_io with VOP_PUTPAGES.
at that point, we were still counting pdpending for
VM_PAGER_PEND.

in 2001, for some reasons, we stopped counting pdpending
for file-backed pages.
("a whole bunch of changes to improve performance and
robustness under load:")

in 2003, in a commit about swpgonly and SWSLOT_BAD,
uvm_aio_aiodone was changed to decrement pdpending for
swap writes. i don't understand how it makes sense.
maybe the author of the change assumed it should be the
current number of i/o in flight? let me quote the whole
commit log of the change. i couldn't find anything about
pdpending:

  When retiring a swap device with marked bad blocks on
  it we should update the `# swap page in use' and
  `# swap page only' counters.  However, at the time of
  swap device removal we can no longer figure out how
  many of the bad swap pages are actually also `swap only'
  pages.

  So, on swap I/O errors arrange things to not include
  the bad swap pages in the `swpgonly' counter as follows:
  uvm_swap_markbad() decrements `swpgonly' by the number
  of bad pages, and the various VM object deallocation
  routines do not decrement `swpgonly' for swap slots
  marked as SWSLOT_BAD.

in 2006, someone refactored the code and forgot to adjust
pdpending logic accordingly. maybe he didn't notice this
counter at all.
("factor out swap clustering code." oops, it was me!)

in 2019, an attempt to fix pdpending was made and then
reverted within a day.

after all,

* the original meaning of pdpending doesn't make much sense
  these days. we no longer have VM_PAGER_PEND. we basically
  do all pageouts asynchronously, at least from POV of the
  page daemon. even when some pagers actually do it
  synchronously, page daemon will not be aware of it.

* the semantics of pdpending has been drifted. the latest
  version of it has been broken for decades. i guess it's
  safe to say it doesn't have a well defined meaning
  applications can rely on.


To generate a diff of this commit:
cvs rdiff -u -r1.115 -r1.116 src/share/man/man9/uvm.9
cvs rdiff -u -r1.236 -r1.237 src/sys/uvm/uvm_extern.h
cvs rdiff -u -r1.80 -r1.81 src/sys/uvm/uvm_meter.c
cvs rdiff -u -r1.131 -r1.132 src/sys/uvm/uvm_pager.c
cvs rdiff -u -r1.135 -r1.136 src/sys/uvm/uvm_pdaemon.c
cvs rdiff -u -r1.46 -r1.47 src/sys/uvm/uvm_stat.c
cvs rdiff -u -r1.264 -r1.265 src/usr.bin/vmstat/vmstat.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