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]
Message-ID: <CAMgjq7B_7jb9MRt+npesVhz1QV3sZ_6qzZQKHKP5J3rGVNJv6w@mail.gmail.com>
Date: Tue, 22 Apr 2025 10:52:19 +0800
From: Kairui Song <ryncsn@...il.com>
To: David Hildenbrand <david@...hat.com>
Cc: linux-kernel@...r.kernel.org, linux-doc@...r.kernel.org, 
	cgroups@...r.kernel.org, linux-mm@...ck.org, linux-fsdevel@...r.kernel.org, 
	linux-api@...r.kernel.org, Andrew Morton <akpm@...ux-foundation.org>, 
	"Matthew Wilcox (Oracle)" <willy@...radead.org>, Tejun Heo <tj@...nel.org>, Zefan Li <lizefan.x@...edance.com>, 
	Johannes Weiner <hannes@...xchg.org>, Michal Koutný <mkoutny@...e.com>, 
	Jonathan Corbet <corbet@....net>, Andy Lutomirski <luto@...nel.org>, Thomas Gleixner <tglx@...utronix.de>, 
	Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>, 
	Dave Hansen <dave.hansen@...ux.intel.com>, Muchun Song <muchun.song@...ux.dev>, 
	"Liam R. Howlett" <Liam.Howlett@...cle.com>, Lorenzo Stoakes <lorenzo.stoakes@...cle.com>, 
	Vlastimil Babka <vbabka@...e.cz>, Jann Horn <jannh@...gle.com>
Subject: Re: [PATCH v3 13/20] mm: Copy-on-Write (COW) reuse support for
 PTE-mapped THP

On Sun, Apr 20, 2025 at 12:35 AM Kairui Song <ryncsn@...il.com> wrote:
>
> On Sun, Apr 20, 2025 at 12:32 AM David Hildenbrand <david@...hat.com> wrote:
> >
> > On 19.04.25 18:25, David Hildenbrand wrote:
> >
> > Oh, re-reading the condition 3 times, I realize that the sanity check is wrong ...
> >
> > diff --git a/mm/memory.c b/mm/memory.c
> > index 037b6ce211f1f..a17eeef3f1f89 100644
> > --- a/mm/memory.c
> > +++ b/mm/memory.c
> > @@ -3789,7 +3789,7 @@ static bool __wp_can_reuse_large_anon_folio(struct folio *folio,
> >
> >          /* Stabilize the mapcount vs. refcount and recheck. */
> >          folio_lock_large_mapcount(folio);
> > -       VM_WARN_ON_ONCE(folio_large_mapcount(folio) < folio_ref_count(folio));
> > +       VM_WARN_ON_ONCE(folio_large_mapcount(folio) > folio_ref_count(folio));
>
> Ah, now it makes sense to me now :)
>
> Thanks for the quick response.
>
> >
> >          if (folio_test_large_maybe_mapped_shared(folio))
> >                  goto unlock;
> >
> > Our refcount must be at least the mapcount, that's what we want to assert.
> >
> > Can you test and send a fix patch if that makes it fly for you?
>
> Sure I'll keep the testing, I think it will just fix it, I have a few
> WARN_ON_FOLIO reports all reporting mapcount is smaller than refcount.

Hi David,

I'm no longer seeing any warning after this, it fixed the problem well.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ