Page MenuHomeFreeBSD

vnode_pager_input: return runningbufspace back
ClosedPublic

Authored by kib on Mar 24 2023, 9:59 PM.
Tags
None
Referenced Files
Unknown Object (File)
Jan 14 2024, 7:32 AM
Unknown Object (File)
Dec 22 2023, 10:27 PM
Unknown Object (File)
Aug 28 2023, 5:45 AM
Unknown Object (File)
Jul 4 2023, 12:56 PM
Unknown Object (File)
Mar 25 2023, 8:54 PM
Unknown Object (File)
Mar 25 2023, 11:14 AM
Subscribers

Details

Summary
Both vnode_pager_input_smlfs() and vnode_pager_generic_getpages()
increment runningbufspace, but also both delegate io completion handling
on the pbuf to either plain bdone() or filesystem-specific strategy
routine. Accidentally, for e.g. UFS it is g_vfs_strategy()/g_vfs_done().
The later calls bufdone() which handles runningbufspace reclamation.

For plain bdone io done handler, nothing would return
accounted b_runningbufspace back. Do it in the new
helper vnode_pager_input_bdone(), as well as in
vnode_pager_generic_getpages_done() explicitly.

Note that potential multiple calls to runningbufwakeup() for the same
pbuf or buf completion are safe. runningbufwakeup() clears accounting
for the buffer, so second and later calls are nop.

The problem was found due to tarfs using small vnode pager input but not
g_vfs_strategy().

Reported by:    des

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable