Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756112Ab0KXThG (ORCPT ); Wed, 24 Nov 2010 14:37:06 -0500 Received: from claw.goop.org ([74.207.240.146]:48333 "EHLO claw.goop.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755851Ab0KXThF (ORCPT ); Wed, 24 Nov 2010 14:37:05 -0500 Message-ID: <4CED695E.5050502@goop.org> Date: Wed, 24 Nov 2010 11:37:02 -0800 From: Jeremy Fitzhardinge User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.12) Gecko/20101027 Fedora/3.1.6-1.fc13 Lightning/1.0b3pre Thunderbird/3.1.6 MIME-Version: 1.0 To: Christoph Lameter CC: Pekka Enberg , akpm@linux-foundation.org, Pekka Enberg , Ingo Molnar , Peter Zijlstra , linux-kernel@vger.kernel.org, Eric Dumazet , Mathieu Desnoyers , Tejun Heo Subject: Re: [thiscpuops upgrade 10/10] Lockless (and preemptless) fastpaths for slub References: <20101123235139.908255844@linux.com> <20101123235201.758191189@linux.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1094 Lines: 25 On 11/24/2010 08:17 AM, Christoph Lameter wrote: > On Wed, 24 Nov 2010, Pekka Enberg wrote: > >>> + /* >>> + * The transaction ids are globally unique per cpu and per operation on >>> + * a per cpu queue. Thus they can be guarantee that the cmpxchg_double >>> + * occurs on the right processor and that there was no operation on the >>> + * linked list in between. >>> + */ >>> + tid = c->tid; >>> + barrier(); >> You're using a compiler barrier after every load from c->tid. Why? > To make sure that the compiler does not do something like loading the tid > later. The tid must be obtained before the rest of the information from > the per cpu slab data is retrieved in order to ensure that we have a > consistent set of data to operate on. Isn't that best expressed with ACCESS_ONCE()? J -- 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/