From: Ingo Molnar <mingo@elte.hu>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: Tejun Heo <tj@kernel.org>, Pekka Enberg <penberg@kernel.org>,
Linus Torvalds <torvalds@linux-foundation.org>,
Jens Axboe <axboe@kernel.dk>,
Andrew Morton <akpm@linux-foundation.org>,
werner <w.landgraf@ru.ru>, "H. Peter Anvin" <hpa@zytor.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Christoph Lameter <cl@linux.com>
Subject: [PATCH] slub: Fix the lockless code on 32-bit platforms with no 64-bit cmpxchg
Date: Wed, 4 May 2011 16:36:16 +0200 [thread overview]
Message-ID: <20110504143616.GA19986@elte.hu> (raw)
In-Reply-To: <20110504141413.GA14127@elte.hu>
* Ingo Molnar <mingo@elte.hu> wrote:
>
> * Thomas Gleixner <tglx@linutronix.de> wrote:
>
> > Patch below. Ingo, can you test that please ?
>
> Sure - test underway.
Ok, the patch below is looking really good - the test would have crashed on the
bad kernel. I think we can consider the regression fixed:
Acked-and-tested-by: Ingo Molnar <mingo@elte.hu>
I'll keep it running some more to make really sure it's fixed, plus it would be
nice if Walter tested your fix as well.
Thanks,
Ingo
----------------->
>From c22bd309573330e33a77c329405d9473fc14f1cb Mon Sep 17 00:00:00 2001
From: Thomas Gleixner <tglx@linutronix.de>
Date: Wed, 4 May 2011 15:38:19 +0200
Subject: [PATCH] slub: Fix the lockless code on 32-bit platforms with no 64-bit cmpxchg
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: werner <w.landgraf@ru.ru>
Cc: Christoph Lameter <cl@linux.com>
Cc: Tejun Heo <tj@kernel.org>
Link: http://lkml.kernel.org/r/alpine.LFD.2.02.1105041539050.3005@ionos
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
include/linux/percpu.h | 2 +-
mm/slub.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/include/linux/percpu.h b/include/linux/percpu.h
index 3a5c444..8b97308 100644
--- a/include/linux/percpu.h
+++ b/include/linux/percpu.h
@@ -948,7 +948,7 @@ do { \
irqsafe_generic_cpu_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2)
# endif
# define irqsafe_cpu_cmpxchg_double(pcp1, pcp2, oval1, oval2, nval1, nval2) \
- __pcpu_double_call_return_int(irqsafe_cpu_cmpxchg_double_, (pcp1), (pcp2), (oval1), (oval2), (nval1), (nval2))
+ __pcpu_double_call_return_bool(irqsafe_cpu_cmpxchg_double_, (pcp1), (pcp2), (oval1), (oval2), (nval1), (nval2))
#endif
#endif /* __LINUX_PERCPU_H */
diff --git a/mm/slub.c b/mm/slub.c
index 94d2a33..9d2e5e4 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -1940,7 +1940,7 @@ redo:
* Since this is without lock semantics the protection is only against
* code executing on this cpu *not* from access by other cpus.
*/
- if (unlikely(!this_cpu_cmpxchg_double(
+ if (unlikely(!irqsafe_cpu_cmpxchg_double(
s->cpu_slab->freelist, s->cpu_slab->tid,
object, tid,
get_freepointer(s, object), next_tid(tid)))) {
@@ -2145,7 +2145,7 @@ redo:
set_freepointer(s, object, c->freelist);
#ifdef CONFIG_CMPXCHG_LOCAL
- if (unlikely(!this_cpu_cmpxchg_double(
+ if (unlikely(!irqsafe_cpu_cmpxchg_double(
s->cpu_slab->freelist, s->cpu_slab->tid,
c->freelist, tid,
object, next_tid(tid)))) {
next prev parent reply other threads:[~2011-05-04 14:36 UTC|newest]
Thread overview: 83+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-02 22:28 2.6.39-rc5-git2 boot crashs werner
2011-05-02 23:24 ` Linus Torvalds
[not found] ` <web-516990066@zbackend1.aha.ru>
2011-05-03 15:22 ` Linus Torvalds
2011-05-03 19:08 ` Ingo Molnar
2011-05-03 20:17 ` Linus Torvalds
2011-05-03 20:20 ` H. Peter Anvin
2011-05-03 20:50 ` Ingo Molnar
2011-05-03 21:45 ` Linus Torvalds
2011-05-03 22:01 ` H. Peter Anvin
2011-05-04 7:19 ` Borislav Petkov
2011-05-04 7:38 ` Ingo Molnar
2011-05-04 7:55 ` Borislav Petkov
2011-05-04 8:35 ` [block IO crash] " Ingo Molnar
2011-05-04 9:52 ` Thomas Gleixner
2011-05-04 10:19 ` Ingo Molnar
2011-05-04 10:25 ` Ingo Molnar
2011-05-04 10:33 ` Ingo Molnar
2011-05-04 12:37 ` Ingo Molnar
2011-05-04 12:36 ` Ingo Molnar
2011-05-04 11:11 ` Thomas Gleixner
2011-05-04 11:16 ` Pekka Enberg
2011-05-04 11:27 ` Tejun Heo
2011-05-04 12:51 ` Pekka Enberg
2011-05-04 12:57 ` Ingo Molnar
2011-05-04 13:02 ` Thomas Gleixner
2011-05-04 13:00 ` Thomas Gleixner
2011-05-04 13:20 ` Tejun Heo
2011-05-04 14:10 ` Thomas Gleixner
2011-05-04 14:14 ` Ingo Molnar
2011-05-04 14:36 ` Ingo Molnar [this message]
2011-05-04 14:42 ` [PATCH] slub: Fix the lockless code on 32-bit platforms with no 64-bit cmpxchg Christoph Lameter
2011-05-04 16:30 ` Ingo Molnar
2011-05-04 21:52 ` Ben Greear
2011-05-04 22:00 ` Linus Torvalds
2011-05-04 22:22 ` Ben Greear
2011-05-04 14:19 ` [block IO crash] Re: 2.6.39-rc5-git2 boot crashs Christoph Lameter
2011-05-04 14:25 ` Tejun Heo
2011-05-04 14:35 ` Christoph Lameter
2011-05-04 15:20 ` Ingo Molnar
2011-05-04 14:46 ` Thomas Gleixner
2011-05-04 15:00 ` Christoph Lameter
2011-05-04 15:13 ` Linus Torvalds
2011-05-04 15:28 ` Christoph Lameter
2011-05-04 15:37 ` Pekka Enberg
2011-05-04 15:53 ` Linus Torvalds
2011-05-04 18:20 ` Linus Torvalds
2011-05-04 18:49 ` Christoph Lameter
2011-05-04 19:07 ` Linus Torvalds
2011-05-04 19:30 ` Christoph Lameter
2011-05-04 19:38 ` Linus Torvalds
2011-05-04 20:04 ` Christoph Lameter
2011-05-04 20:21 ` Valdis.Kletnieks
2011-05-04 20:32 ` Christoph Lameter
2011-05-04 20:49 ` Ingo Molnar
2011-05-04 21:06 ` Linus Torvalds
2011-05-04 21:19 ` Linus Torvalds
2011-05-04 21:40 ` Thomas Gleixner
2011-05-05 9:54 ` Tejun Heo
2011-05-05 10:18 ` Ingo Molnar
2011-05-05 10:45 ` Thomas Gleixner
2011-05-05 18:20 ` Christoph Lameter
2011-05-05 19:13 ` Ingo Molnar
2011-05-05 19:53 ` werner
2011-05-05 20:09 ` Christoph Lameter
2011-05-05 21:12 ` werner
2011-05-05 22:27 ` Thomas Gleixner
[not found] ` <web-518008166@zbackend1.aha.ru>
[not found] ` <web-518059420@zbackend1.aha.ru>
[not found] ` <20110505060204.GA28015@elte.hu>
2011-05-05 6:46 ` werner
2011-05-04 15:37 ` [block IO crash] " Linus Torvalds
2011-05-04 16:08 ` Christoph Lameter
2011-05-04 16:50 ` Ingo Molnar
2011-05-04 17:12 ` Thomas Gleixner
2011-05-04 15:41 ` Pekka Enberg
2011-05-04 13:22 ` Ingo Molnar
2011-05-04 14:21 ` Christoph Lameter
2011-05-04 14:04 ` Christoph Lameter
2011-05-04 14:07 ` Tejun Heo
2011-05-04 14:21 ` Thomas Gleixner
2011-05-04 10:13 ` Ingo Molnar
2011-05-04 10:41 ` Ingo Molnar
2011-05-04 10:45 ` Ingo Molnar
2011-05-04 11:06 ` Ingo Molnar
2011-05-04 12:37 ` Ingo Molnar
2011-05-04 12:47 ` Ingo Molnar
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=20110504143616.GA19986@elte.hu \
--to=mingo@elte.hu \
--cc=akpm@linux-foundation.org \
--cc=axboe@kernel.dk \
--cc=cl@linux.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=penberg@kernel.org \
--cc=tglx@linutronix.de \
--cc=tj@kernel.org \
--cc=torvalds@linux-foundation.org \
--cc=w.landgraf@ru.ru \
/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