Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758027AbaLJRIc (ORCPT ); Wed, 10 Dec 2014 12:08:32 -0500 Received: from resqmta-po-11v.sys.comcast.net ([96.114.154.170]:35707 "EHLO resqmta-po-11v.sys.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756901AbaLJRIa (ORCPT ); Wed, 10 Dec 2014 12:08:30 -0500 Date: Wed, 10 Dec 2014 11:08:28 -0600 (CST) From: Christoph Lameter X-X-Sender: cl@gentwo.org To: Pekka Enberg cc: akpm , Steven Rostedt , LKML , Thomas Gleixner , "linux-mm@kvack.org" , iamjoonsoo@lge.com, Jesper Dangaard Brouer Subject: Re: [PATCH 3/7] slub: Do not use c->page on free In-Reply-To: Message-ID: References: <20141210163017.092096069@linux.com> <20141210163033.717707217@linux.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 On Wed, 10 Dec 2014, Pekka Enberg wrote: > > +static bool same_slab_page(struct kmem_cache *s, struct page *page, void *p) > > Why are you passing a pointer to struct kmem_cache here? You don't > seem to use it. True. > > +{ > > + long d = p - page->address; > > + > > + return d > 0 && d < (1 << MAX_ORDER) && d < (compound_order(page) << PAGE_SHIFT); > > +} > > Can you elaborate on what this is doing? I don't really understand it. Checks if the pointer points to the slab page. Also it tres to avoid having to call compound_order needlessly. Not sure if that optimization is worth it. -- 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/