Linux-rt-users archive on
 help / color / Atom feed
From: Steven Rostedt <>
	linux-rt-users <>
Cc: Thomas Gleixner <>,
	Carsten Emde <>,
	Sebastian Andrzej Siewior <>,
	John Kacur <>, Daniel Wagner <>,
	Tom Zanussi <>,
	"Srivatsa S. Bhat" <>,
	Kevin Hao <>,
Subject: [PATCH RT 5/8] mm: slub: Always flush the delayed empty slubs in flush_all()
Date: Fri, 05 Jun 2020 19:41:54 -0400
Message-ID: <> (raw)
In-Reply-To: <>

5.4.44-rt27-rc1 stable review patch.
If anyone has any objections, please let me know.


From: Kevin Hao <>

After commit f0b231101c94 ("mm/SLUB: delay giving back empty slubs to
IRQ enabled regions"), when the free_slab() is invoked with the IRQ
disabled, the empty slubs are moved to a per-CPU list and will be
freed after IRQ enabled later. But in the current codes, there is
a check to see if there really has the cpu slub on a specific cpu
before flushing the delayed empty slubs, this may cause a reference
of already released kmem_cache in a scenario like below:
	cpu 0				cpu 1
                         --->IPI       flush_cpu_slab()
                                             c->page = NULL;
        if (!has_cpu_slab(1, s))
        this skip to flush the delayed
        empty slub released by cpu1
    kmem_cache_free(kmem_cache, s)

                                            reference to released kmem_cache

Fixes: f0b231101c94 ("mm/SLUB: delay giving back empty slubs to IRQ enabled regions")
Signed-off-by: Kevin Hao <>
Signed-off-by: Sebastian Andrzej Siewior <>
Signed-off-by: Steven Rostedt (VMware) <>
 mm/slub.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/mm/slub.c b/mm/slub.c
index bea18bbae247..b2809a9ca8f8 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -2382,9 +2382,6 @@ static void flush_all(struct kmem_cache *s)
 	for_each_online_cpu(cpu) {
 		struct slub_free_list *f;
-		if (!has_cpu_slab(cpu, s))
-			continue;
 		f = &per_cpu(slub_free_list, cpu);
 		list_splice_init(&f->list, &tofree);

  parent reply index

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-05 23:41 [PATCH RT 0/8] Linux 5.4.44-rt27-rc1 Steven Rostedt
2020-06-05 23:41 ` [PATCH RT 1/8] printk: console must not schedule for drivers Steven Rostedt
2020-06-05 23:41 ` [PATCH RT 2/8] fs/dcache: Include swait.h header Steven Rostedt
2020-06-05 23:41 ` [PATCH RT 3/8] Revert "rt: Improve the serial console PASS_LIMIT" Steven Rostedt
2020-06-05 23:41 ` [PATCH RT 4/8] mm: Dont warn about atomic memory allocations during suspend Steven Rostedt
2020-06-05 23:41 ` Steven Rostedt [this message]
2020-06-05 23:41 ` [PATCH RT 7/8] mm/zswap: Use local lock to protect per-CPU data Steven Rostedt
2020-06-05 23:41 ` [PATCH RT 8/8] Linux 5.4.44-rt27-rc1 Steven Rostedt

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-rt-users archive on

Archives are clonable:
	git clone --mirror linux-rt-users/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-rt-users linux-rt-users/ \
	public-inbox-index linux-rt-users

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone