From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Mon, 13 Aug 2007 15:28:01 -0700 (PDT) From: Christoph Lameter Subject: Re: [patch 00/10] [RFC] SLUB patches for more functionality, performance and maintenance In-Reply-To: <20070813221847.GA20314@Krystal> Message-ID: References: <20070708034952.022985379@sgi.com> <46925B5D.8000507@google.com> <4692A1D0.50308@mbligh.org> <20070709214426.GC1026@Krystal> <20070709225817.GA5111@Krystal> <20070813221847.GA20314@Krystal> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-linux-mm@kvack.org Return-Path: To: Mathieu Desnoyers Cc: Martin Bligh , Andi Kleen , linux-kernel@vger.kernel.org, linux-mm@kvack.org, David Miller List-ID: On Mon, 13 Aug 2007, Mathieu Desnoyers wrote: > > @@ -1554,23 +1564,20 @@ static void __always_inline *slab_alloc( > > gfp_t gfpflags, int node, void *addr) > > { > > void **object; > > - unsigned long flags; > > struct kmem_cache_cpu *c; > > > > What if we prefetch c->freelist here ? I see in this diff that the other > code just reads it sooner as a condition for the if(). Not sure as to what this may bring. If you read it earlier then you may get the wrong value and then may have to refetch the cacheline. We cannot fetch c->freelist without determining c. I can remove the check for c->page == page so that the fetch of c->freelist comes immeidately after detemination of c. But that does not change performance. > > - c->freelist = object; > > - } else > > - __slab_free(s, page, x, addr, c->offset); > > +redo: > > + freelist = c->freelist; > > I suspect this smp_rmb() may be the cause of a major slowdown. > Therefore, I think we should try taking a copy of c->page and simply > check if it has changed right after the cmpxchg_local: Thought so too and I removed that smp_rmb and tested this modification on UP again without any performance gains. I think the cacheline fetches dominates the execution thread here and cmpxchg does not bring us anything. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org