[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87lehsaavo.ffs@tglx>
Date: Sat, 13 May 2023 10:33:47 +0200
From: Thomas Gleixner <tglx@...utronix.de>
To: Tetsuo Handa <penguin-kernel@...ove.SAKURA.ne.jp>,
Andrew Morton <akpm@...ux-foundation.org>
Cc: syzbot <syzbot+fe0c72f0ccbb93786380@...kaller.appspotmail.com>,
syzkaller-bugs@...glegroups.com, Ingo Molnar <mingo@...e.hu>,
linux-kernel@...r.kernel.org, linux-mm <linux-mm@...ck.org>,
Peter Zijlstra <peterz@...radead.org>
Subject: Re: [PATCH] debugobject: don't wake up kswapd from fill_pool()
On Sat, May 13 2023 at 08:13, Tetsuo Handa wrote:
> On 2023/05/13 3:07, Thomas Gleixner wrote:
>> The main change is to make the refill invocation conditional when the
>> lookup fails. That's how that code has been from day one.
>
> Making refill conditional helps reducing frequency of doing allocations.
> I want a proof that allocations never happens in the worst scenario.
>
> Are you saying that some debugobject function other than debug_object_activate()
> guarantees that memory for that object was already allocated before
> debug_object_activate() is called for the first time for that object,
> _and_ such debugobject function is called without locks held?
The point is that the allocation in activate() only happens when the
tracked entity was not initialized _before_ activate() is invoked.
That's a bug for dynamically allocated entities, but a valid scenario
for statically initialized entities as they can be activated without
prior init() obviously.
For dynamically allocated entities the init() function takes care of the
tracking object allocation and that's where the pool is refilled. So for
those the lookup will never fail.
Now I just stared at __alloc_pages_slowpath() and looked at the
condition for wakeup_all_kswapds(). ALLOC_KSWAPD is set because
debugobject uses GFP_ATOMIC which contains __GFP_KSWAPD_RECLAIM.
So debug objects needs to have s/GFP_ATOMIC/__GFP_HIGH/ to prevent that
wakeup path.
Thanks,
tglx
Powered by blists - more mailing lists