Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754030Ab1CZTuC (ORCPT ); Sat, 26 Mar 2011 15:50:02 -0400 Received: from smtp106.prem.mail.ac4.yahoo.com ([76.13.13.45]:21300 "HELO smtp106.prem.mail.ac4.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1753745Ab1CZTuA (ORCPT ); Sat, 26 Mar 2011 15:50:00 -0400 X-Yahoo-SMTP: _Dag8S.swBC1p4FJKLCXbs8NQzyse1SYSgnAbY0- X-YMail-OSG: lGhtqgkVM1lyB2q7U1W4RS.a_JLWbn8ZCTEhNeMTDr4oMUO ow5BbFxzenCYtLNihVPo93fXrVhrqmxF_oWN2iQS5UKIwCBGg1HQbaEQedeP Kf.BeiNPi1crj.Z2_2lBlp2NKdkwDdWOuym3YtpxjiNaRO0RTLZdWVm1WZRK zpbAq2adhjm6dEIryIrnlp4tu6c0JpPz8zVRbs.woRjrDiTG5tx4NP1Bct1J c3sBKgMk1VEXLoRbiVj7ZZJ9Gn7GYJuyS7TMAfqJu_n2i_1_FfPD5F46A1h4 oDgX238LoxFkqqGk3HALS.sFnU4P.LvvFslZcduu4zaQBS7FrR21M2grtezr hwEA2pL6tP0VOUAwuDrJpVrTh X-Yahoo-Newman-Property: ymail-3 Date: Sat, 26 Mar 2011 14:49:56 -0500 (CDT) From: Christoph Lameter X-X-Sender: cl@router.home To: Eric Dumazet cc: Ingo Molnar , Pekka Enberg , Thomas Gleixner , torvalds@linux-foundation.org, akpm@linux-foundation.org, tj@kernel.org, npiggin@kernel.dk, rientjes@google.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH] slub: Disable the lockless allocator In-Reply-To: Message-ID: References: <20110324142146.GA11682@elte.hu> <20110324172653.GA28507@elte.hu> <20110324185258.GA28370@elte.hu> <20110324192247.GA5477@elte.hu> <20110326112725.GA28612@elte.hu> <20110326114736.GA8251@elte.hu> <1301161507.2979.105.camel@edumazet-laptop> User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1582 Lines: 43 On Sat, 26 Mar 2011, Christoph Lameter wrote: > Tejun: Whats going on there? I should be getting offsets into the per cpu > area and not kernel addresses. Its a UP kernel running on dual Athlon. So its okay ... Argh.... The following patch fixes it by using the fallback code for cmpxchg_double: Subject: per_cpu: Fixup cmpxchg_double for !SMP cmpxchg_double should only be provided for SMP. In the UP case the GS register is not defined and the function will fail. Signed-off-by: Christoph Lameter Index: linux-2.6/arch/x86/include/asm/percpu.h =================================================================== --- linux-2.6.orig/arch/x86/include/asm/percpu.h 2011-03-26 11:11:19.175244998 -0500 +++ linux-2.6/arch/x86/include/asm/percpu.h 2011-03-26 14:45:29.254088998 -0500 @@ -507,6 +507,7 @@ * it in software. The address used in the cmpxchg16 instruction must be * aligned to a 16 byte boundary. */ +#ifdef CONFIG_SMP #define percpu_cmpxchg16b_double(pcp1, o1, o2, n1, n2) \ ({ \ char __ret; \ @@ -529,6 +530,7 @@ #define irqsafe_cpu_cmpxchg_double_8(pcp1, pcp2, o1, o2, n1, n2) percpu_cmpxchg16b_double(pcp1, o1, o2, n1, n2) #endif +#endif /* This is not atomic against other CPUs -- CPU preemption needs to be off */ #define x86_test_and_clear_bit_percpu(bit, var) \ -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/