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

Q. about swap-cache orphans



[This is just a question to help my understanding, not relevant to madvise]

Stephen C. Tweedie wrote:
> If it is the last user of the page --- ie. if PG_SwapCache is set and
> the refcount of the page is one --- then it will do so anyway, because
> when I added that swap cache code I made sure that zap_page_range()
> does a free_page_and_swap_cache() when freeing pages.

I.e., zap_page_range makes sure that MADV_DONTNEED won't leave orphan
swap-cache pages.

> > Doesn't this also result in a swap-cache leak, or are orphan swap-cache
> > pages reclaimed eventually?
> 
> The shrink_mmap() page cache reclaimer is able to pick up any orphaned 
> swap cache pages.

But there won't be any orphans, will there?
Or do they appear due to async. swapping situations?

thanks,
-- Jamie
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux.eu.org/Linux-MM/