sendfile: remove calculation of unused bsize swap_pager_getpages(): assert that bp->b_pages[] is accessed in bounds swap_pager_getpages(): some pages from ma[] might be bogus Same as vnode_pager_generic_getpages_async(), swap_pager_getpages() must handle a possibility of the provided page run to include bogus_page on some positions, when called from sendfile_swapin(). The swap pager is used for tmpfs vnodes. In particular, the bogus page must not be used for pindex calculation, we better not update the flags on it or wait for the flag clearing, and we must not call vm_page_valid() because the function expects busy page. This was bisected down to 72ddb6de1028426 (unix: increase net.local.(stream|seqpacket).(recv|send)space to 64 KiB), which is somewhat surprising, but apparently reasonable because it allowed the run of more than one page for page-in from the swap pager, which now might include valid pages replaced by bogus one. In collaboration with: pho
Details
Details
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Comment Actions
I wonder why we bother with bogus page replacement in sendfile_swapin(). Why not pass valid pages to the pager and let it decide how to handle it?
Comment Actions
We traditionally do it outside the pagers level. The bogus_page was added as a necessary hack to the buffer cache only. Then it appeared that sendfile must do the same.
I believe that we cannot eliminate bogus_page use from the buffer cache even if it is pushed into the pagers getpage() implementations.
So in the end we would get more places contaminated with the avoidance of the valid pages.
But technically it is possible to do.