[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <45725c86-d07f-4422-a6fd-c9f02744ac75@paulmck-laptop>
Date: Thu, 7 Nov 2024 06:08:35 -0800
From: "Paul E. McKenney" <paulmck@...nel.org>
To: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
Cc: Boqun Feng <boqun.feng@...il.com>, Vlastimil Babka <vbabka@...e.cz>,
Marco Elver <elver@...gle.com>, linux-kernel@...r.kernel.org,
kasan-dev@...glegroups.com, linux-mm@...ck.org,
sfr@...b.auug.org.au, longman@...hat.com, cl@...ux.com,
penberg@...nel.org, rientjes@...gle.com, iamjoonsoo.kim@....com,
akpm@...ux-foundation.org, Tomas Gleixner <tglx@...utronix.de>,
Peter Zijlstra <peterz@...radead.org>
Subject: Re: [PATCH 2/2] scftorture: Use a lock-less list to free memory.
On Thu, Nov 07, 2024 at 12:21:07PM +0100, Sebastian Andrzej Siewior wrote:
> On 2024-11-04 17:00:19 [-0800], Boqun Feng wrote:
> > Hi Sebastian,
> Hi Boqun,
>
> …
> > I think this needs to be:
> >
> > scf_cleanup_free_list(cpu);
> >
> > or
> >
> > scf_cleanup_free_list(curcpu);
> >
> > because scfp->cpu is actually the thread number, and I got a NULL
> > dereference:
> >
> > [ 14.219225] BUG: unable to handle page fault for address: ffffffffb2ff7210
>
> Right. Replaced with cpu.
> …
> >
> > Another thing is, how do we guarantee that we don't exit the loop
> > eariler (i.e. while there are still callbacks on the list)? After the
> > following scftorture_invoke_one(), there could an IPI pending somewhere,
> > and we may exit this loop if torture_must_stop() is true. And that IPI
> > might add its scf_check to the list but no scf_cleanup_free_list() is
> > going to handle that, right?
>
> Okay. Assuming that IPIs are done by the time scf_torture_cleanup is
> invoked, I added scf_cleanup_free_list() for all CPUs there.
This statement in scf_torture_cleanup() is supposed to wait for all
outstanding IPIs:
smp_call_function(scf_cleanup_handler, NULL, 0);
And the scf_cleanup_handler() function is as follows:
static void scf_cleanup_handler(void *unused)
{
}
Does that work, or am I yet again being overly naive?
> Reposted at
> https://lore.kernel.org/20241107111821.3417762-1-bigeasy@linutronix.de
Thank you!
I will do some testing on this later today.
Thanx, Paul
Powered by blists - more mailing lists