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: <Z-kzMlwJXG7V9lip@casper.infradead.org>
Date: Sun, 30 Mar 2025 13:04:02 +0100
From: Matthew Wilcox <willy@...radead.org>
To: Luis Chamberlain <mcgrof@...nel.org>
Cc: brauner@...nel.org, jack@...e.cz, tytso@....edu,
	adilger.kernel@...ger.ca, linux-ext4@...r.kernel.org,
	riel@...riel.com, hannes@...xchg.org, oliver.sang@...el.com,
	dave@...olabs.net, david@...hat.com, axboe@...nel.dk, hare@...e.de,
	david@...morbit.com, djwong@...nel.org, ritesh.list@...il.com,
	linux-fsdevel@...r.kernel.org, linux-block@...r.kernel.org,
	linux-mm@...ck.org, gost.dev@...sung.com, p.raghav@...sung.com,
	da.gomez@...sung.com
Subject: Re: [PATCH 1/3] mm/migrate: add might_sleep() on __migrate_folio()

On Sat, Mar 29, 2025 at 11:47:30PM -0700, Luis Chamberlain wrote:
> However tracing shows that folio_mc_copy() *isn't* being called
> as often as we'd expect from buffer_migrate_folio_norefs() path
> as we're likely bailing early now thanks to the check added by commit
> 060913999d7a ("mm: migrate: support poisoned recover from migrate
> folio").

Umm.  You're saying that most folios we try to migrate have extra refs?
That seems unexpected; does it indicate a bug in 060913999d7a?

> +++ b/mm/migrate.c
> @@ -751,6 +751,8 @@ static int __migrate_folio(struct address_space *mapping, struct folio *dst,
>  {
>  	int rc, expected_count = folio_expected_refs(mapping, src);
>  
> +	might_sleep();

We deliberately don't sleep when the folio is only a single page.
So this needs to be:

	might_sleep_if(folio_test_large(folio));

>  	/* Check whether src does not have extra refs before we do more work */
>  	if (folio_ref_count(src) != expected_count)
>  		return -EAGAIN;
> -- 
> 2.47.2
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ