Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754137Ab0KXQrP (ORCPT ); Wed, 24 Nov 2010 11:47:15 -0500 Received: from mail-gw0-f46.google.com ([74.125.83.46]:45580 "EHLO mail-gw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752216Ab0KXQrN (ORCPT ); Wed, 24 Nov 2010 11:47:13 -0500 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=NzBQBoQBDO9Xo2Gn6TNdvcfh6MjksSrRIGSQZSGuCqoyI+vA86gDCuEAuKbc4yp5fH sft3UtBpjBSAtmcqAFrelXljzwyXV703i4rI1ERz9/3Ot+VZOWesRM4BafPH9TnXyzT3 d2G/CEpBHefFILEmwWSrIr09M+0TrqG1qcVuA= MIME-Version: 1.0 In-Reply-To: References: <20101123235139.908255844@linux.com> <20101123235201.758191189@linux.com> Date: Wed, 24 Nov 2010 18:47:12 +0200 X-Google-Sender-Auth: ycBrTId9L7VSB-iGTdjHr-_rfL8 Message-ID: Subject: Re: [thiscpuops upgrade 10/10] Lockless (and preemptless) fastpaths for slub From: Pekka Enberg To: Christoph Lameter Cc: akpm@linux-foundation.org, Pekka Enberg , Ingo Molnar , Peter Zijlstra , linux-kernel@vger.kernel.org, Eric Dumazet , Mathieu Desnoyers , Tejun Heo Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1162 Lines: 22 On Wed, 24 Nov 2010, Pekka Enberg wrote: >> > The critical section begins with the retrieval of the tid and it ends with >> > the replacement of the tid with the newly generated one. This means that >> > all state data for the alloc and free operation needs to be retrieved in >> > that critical section. The change must be saved with the final >> > cmpxchg_double of the critical section. >> >> Right and we don't need a *memory barrier* here because we're >> accessing a per-CPU variable which means operations appear in-order. On Wed, Nov 24, 2010 at 6:45 PM, Christoph Lameter wrote: > The compiler is still free to rearrange the tid fetch. A possible > optimization that the compiler may do is to move the tid fetch into the > next if statement since that is the only block in which the tid variable > is actually used. Yes, which is why we need a *compiler barrier* but not a *memory barrier*. -- 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/