Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753632AbbBKTH1 (ORCPT ); Wed, 11 Feb 2015 14:07:27 -0500 Received: from resqmta-po-07v.sys.comcast.net ([96.114.154.166]:42890 "EHLO resqmta-po-07v.sys.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752429AbbBKTH0 (ORCPT ); Wed, 11 Feb 2015 14:07:26 -0500 Date: Wed, 11 Feb 2015 13:07:24 -0600 (CST) From: Christoph Lameter X-X-Sender: cl@gentwo.org To: Jesper Dangaard Brouer cc: akpm@linuxfoundation.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, penberg@kernel.org, iamjoonsoo@lge.com Subject: Re: [PATCH 2/3] slub: Support for array operations In-Reply-To: <20150211174817.44cc5562@redhat.com> Message-ID: References: <20150210194804.288708936@linux.com> <20150210194811.902155759@linux.com> <20150211174817.44cc5562@redhat.com> 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: 1046 Lines: 32 On Wed, 11 Feb 2015, Jesper Dangaard Brouer wrote: > > + > > + > > + spin_lock_irqsave(&n->list_lock, flags); > > This is quite an expensive lock with irqsave. Yes but we take it for all partial pages. > Yet another lock cost. Yup the page access is shared but there is one per page. Contention is unlikely. > > + spin_unlock_irqrestore(&n->list_lock, flags); > > + return allocated; > > I estimate (on my CPU) the locking cost itself is more than 32ns, plus > the irqsave (which I've also found quite expensive, alone 14ns). Thus, > estimated 46ns. Single elem slub fast path cost is 18-19ns. Thus 3-4 > elem bulking should be enough to amortized the cost, guess we are still > good :-) We can require that interrupt are off when the functions are called. Then we can avoid the "save" part? -- 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/