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] [day] [month] [year] [list]
Message-ID: <54d9e5ac-5a51-4901-9b13-4c248aada2d7@suse.cz>
Date: Mon, 25 Aug 2025 17:42:52 +0200
From: Vlastimil Babka <vbabka@...e.cz>
To: Matthew Wilcox <willy@...radead.org>, yangshiguang1011@....com
Cc: harry.yoo@...cle.com, akpm@...ux-foundation.org, cl@...two.org,
 rientjes@...gle.com, roman.gushchin@...ux.dev, glittao@...il.com,
 linux-mm@...ck.org, linux-kernel@...r.kernel.org,
 yangshiguang <yangshiguang@...omi.com>, stable@...r.kernel.org
Subject: Re: [PATCH v3] mm: slub: avoid wake up kswapd in set_track_prepare

On 8/25/25 14:40, Matthew Wilcox wrote:
> On Mon, Aug 25, 2025 at 08:17:37PM +0800, yangshiguang1011@....com wrote:
>> Avoid deadlock caused by implicitly waking up kswapd by
>> passing in allocation flags.
> [...]
>> +	/* Preemption is disabled in ___slab_alloc() */
>> +	gfp_flags &= ~(__GFP_DIRECT_RECLAIM);
> 
> If you don't mean __GFP_KSWAPD_RECLAIM here, the explanation needs to
> be better.

It was suggested by Harry here:
https://lore.kernel.org/all/aKKhUoUkRNDkFYYb@harry/

I think the comment is enough? Disabling preemption means we can't direct
reclaim, but we can wake up kswapd. If the slab caller context is such that
we can't, __GFP_KSWAPD_RECLAIM already won't be in the gfp_flags.

But I think we should mask our also __GFP_NOFAIL and add __GFP_NOWARN?

(we should get some common helpers for these kinds of gfp flag manipulations
already)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ