From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Maurizio Lombardi <mlombard@redhat.com>
Cc: vbabka@suse.cz, linux-mm@kvack.org, rientjes@google.com,
penberg@kernel.org, iamjoonsoo.kim@lge.com,
akpm@linux-foundation.org, linux-kernel@vger.kernel.org,
tglx@linutronix.de
Subject: Re: [PATCH RFC] mm: slub: fix flush_cpu_slab()/__free_slab() invocations in task context.
Date: Tue, 30 Aug 2022 12:24:29 +0200 [thread overview]
Message-ID: <Yw3lXaDTfvJcEM4Q@linutronix.de> (raw)
In-Reply-To: <20220829154805.1205507-1-mlombard@redhat.com>
On 2022-08-29 17:48:05 [+0200], Maurizio Lombardi wrote:
> diff --git a/mm/slub.c b/mm/slub.c
> index 862dbd9af4f5..d46ee90651d2 100644
> --- a/mm/slub.c
> +++ b/mm/slub.c
> @@ -2681,30 +2681,34 @@ struct slub_flush_work {
> bool skip;
> };
>
> +static void flush_cpu_slab(void *d)
> +{
> + struct kmem_cache *s = d;
> + struct kmem_cache_cpu *c = this_cpu_ptr(s->cpu_slab);
> +
> + if (c->slab)
> + flush_slab(s, c);
> +
> + unfreeze_partials(s);
> +}
…
> @@ -2721,13 +2725,18 @@ static void flush_all_cpus_locked(struct kmem_cache *s)
> lockdep_assert_cpus_held();
> mutex_lock(&flush_lock);
>
> + if (in_task()) {
> + on_each_cpu_cond(has_cpu_slab, flush_cpu_slab, s, 1);
This blocks with disabled preemption until it completes flush_cpu_slab()
on all CPUs. That function acquires a local_lock_t which can not be
acquired from in-IRQ which is where this function will be invoked due to
on_each_cpu_cond().
Couldn't we instead use a workqueue with that WQ_MEM_RECLAIM bit? It may
reclaim memory after all ;)
Sebastian
next prev parent reply other threads:[~2022-08-30 10:24 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-29 15:48 Maurizio Lombardi
2022-08-30 10:24 ` Sebastian Andrzej Siewior [this message]
2022-08-30 15:48 ` Maurizio Lombardi
2022-08-30 18:59 ` Sebastian Andrzej Siewior
2022-08-30 19:03 ` Maurizio Lombardi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Yw3lXaDTfvJcEM4Q@linutronix.de \
--to=bigeasy@linutronix.de \
--cc=akpm@linux-foundation.org \
--cc=iamjoonsoo.kim@lge.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mlombard@redhat.com \
--cc=penberg@kernel.org \
--cc=rientjes@google.com \
--cc=tglx@linutronix.de \
--cc=vbabka@suse.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox