lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 20 Jan 2022 17:35:24 +0100
From:   David Hildenbrand <david@...hat.com>
To:     Matthew Wilcox <willy@...radead.org>
Cc:     "zhangliang (AG)" <zhangliang5@...wei.com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Linux-MM <linux-mm@...ck.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        wangzhigang17@...wei.com,
        Linus Torvalds <torvalds@...ux-foundation.org>
Subject: Re: [PATCH] mm: reuse the unshared swapcache page in do_wp_page

>>
>> Sorry, I was less verbose because I was just sending out the
>> patch+description to Linus' reply and was assuming you're going to read
>> it anyways ;)
> 
> This reply arrived before your reply to Linus ;-)  Anyway ...

Yes, I could just have added that I'm going to reply with the patch to
Linus after Linus' mail flew in and I made up my mind how to proceed,
that would have been nicer :)

> 
>> Yes, I'm speaking about exactly that fallback path.
> 
> OK, so in that fallback path, we're already determined the THP has
> more than one reference to it (ok, maybe that extra reference was
> temporary and now gone), but we've already split the PMD down into

Yes, any extra references or concurrent writeback. Swapcache was once
example that my patch hopefully handles properly.

> PTEs, and COWed one of the other pages that was in the THP.  If
> anything, we should be more aggressive about COWing the remaining
> pages in the THP, not looking for reasons why we might be able to
> avoid COWing this particular page.

At that point in time we didn't COW yet, we only PTE-mapped the THP, but
yes, once we reach do_wp_page() we will always COW, even if there are no
additional references anymore.

Ideas I had what we could do once we're in do_cow_page() and we spot
that we do have a PTE-mapped THP:
* Count the mappings in the process page table and use that as baseline
 (instead of 1). Would fail if there are additional references.
* Try to split the compound page immediately. Will also fail if there
  are additional references.

COWing more extremely sounds like an interesting idea to free up the
compound page after we fragmented it -- which will succeed once
additional references are gone.

-- 
Thanks,

David / dhildenb

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ