Re: [PATCH] mm: reuse the unshared swapcache page in do_wp_page

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

 



On Thu, Jan 20, 2022 at 03:15:37PM +0100, David Hildenbrand wrote:
> On 17.01.22 14:31, zhangliang (AG) wrote:
> > Sure, I will do that :)
> 
> I'm polishing up / testing the patches and might send something out for discussion shortly.
> Just a note that on my branch was a version with a wrong condition that should have been fixed now.
> 
> I am still thinking about PTE mapped THP. For these, we'll always
> have page_count() > 1, essentially corresponding to the number of still-mapped sub-pages.
> 
> So if we end up with a R/O mapped part of a THP, we'll always have to COW and cannot reuse ever,
> although it's really just a single process mapping the THP via PTEs.
> 
> One approach would be to scan the currently locked page table for entries mapping
> this same page. If page_count() corresponds to that value, we know that only we are
> mapping the THP and there are no additional references. That would be a special case
> if we find an anon THP in do_wp_page(). Hm.

You're starting to optimise for some pretty weird cases at that point.
Anon THP is always going to start out aligned (and can be moved by
mremap()).  Arguably it should be broken up if it's moved so it can be
reformed into aligned THPs by khugepaged.

This is completely different from file-backed THPs, where misalignment
might be considered normal (if unfortunate).




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux