question about try_to_swap_out()
After checking that that a page is present and pageable, try_to_swap_out() checks to see if the page is reserved or locked or not DMA'able when where looking for a DMA page. If any of these three things is true, it returns 0 without changing anything.
It seems to me that it should go ahead and check the pte age bit, and update the page frame's PG_referenced bit, before returning 0.
One case I'm concerned about is a non-DMA page whose reference bit doesn't get reset as usual. This page will still look recently-touched at the next clock sweep, and that will make it stay cached longer, just because we were looking for a DMA'able page when the clock hand reached it this time.
I'm unclear what the significance is for a locked page.
Am I off-base here, or should the conditional that checks to see whether a page is young (and updates the reference bits) be moved up ahead of the conditional that checks to see whether a page is (reserved | locked | not-dma-but-we-need-dma)?
Apologies if I'm way off base here.
--
This is a majordomo managed list. To unsubscribe, send a message with the body 'unsubscribe linux-mm me@address' to: [email protected]
Hi,
Quoted 7 lines · Paul R. Wilson
After checking that that a page is present and pageable,
try_to_swap_out()checks to see if the page is reserved or locked or not DMA'able when where looking for a DMA page. If any of these three things is true, it returns 0 without changing anything.It seems to me that it should go ahead and check the pte age bit, and update the page frame's
PG_referencedbit, before returning 0.
Not really. Reserved pages never get swapped anyway. For DMA, we don't want to disturb non-DMA processes at all --- the demand for DMA and non-DMA pages might be very different. For locked pages, we expect this to be sufficiently rare that it's totally irrelevant whether we age the page or not.
Quoted 4 lines
Am I off-base here, or should the conditional that checks to see whether a page is young (and updates the reference bits) be moved up ahead of the conditional that checks to see whether a page is (reserved | locked | not-dma-but-we-need-dma)?
I really don't think it's that important!
--Stephen
--
This is a majordomo managed list. To unsubscribe, send a message with the body 'unsubscribe linux-mm me@address' to: [email protected]