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: <aFuqAHvBSslOuEMQ@localhost.localdomain>
Date: Wed, 25 Jun 2025 09:49:20 +0200
From: Oscar Salvador <osalvador@...e.de>
To: David Hildenbrand <david@...hat.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
	Muchun Song <muchun.song@...ux.dev>, Peter Xu <peterx@...hat.com>,
	Gavin Guo <gavinguo@...lia.com>, linux-mm@...ck.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 1/5] mm,hugetlb: Change mechanism to detect a COW on
 private mapping

On Mon, Jun 23, 2025 at 04:09:51PM +0200, David Hildenbrand wrote:
> 
> > -	/*
> > -	 * hugetlb_wp() requires page locks of pte_page(vmf.orig_pte) and
> > -	 * pagecache_folio, so here we need take the former one
> > -	 * when folio != pagecache_folio or !pagecache_folio.
> > -	 */
> > +	/* hugetlb_wp() requires page locks of pte_page(vmf.orig_pte) */
> >   	folio = page_folio(pte_page(vmf.orig_pte));
> > -	if (folio != pagecache_folio)
> > -		if (!folio_trylock(folio)) {
> > -			need_wait_lock = 1;
> > -			goto out_ptl;
> > -		}
> > -
> > +	folio_lock(folio);
> >   	folio_get(folio);
> 
> Just realized that this won't work for this patch here, as we are holding
> the PTL.
> 
> In patch #2 you do the right thing.

Yap, missed that.
I might have to do the lock-unlock-dance here, and then in patch#2 move
it to hugetlb_wp.
Sounds reasonable?

 

-- 
Oscar Salvador
SUSE Labs

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ