From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wg0-f41.google.com (mail-wg0-f41.google.com [74.125.82.41]) by kanga.kvack.org (Postfix) with ESMTP id 49B856B0082 for ; Wed, 10 Dec 2014 12:32:26 -0500 (EST) Received: by mail-wg0-f41.google.com with SMTP id y19so4263734wgg.14 for ; Wed, 10 Dec 2014 09:32:25 -0800 (PST) Received: from mail-wi0-x235.google.com (mail-wi0-x235.google.com. [2a00:1450:400c:c05::235]) by mx.google.com with ESMTPS id j6si88071wiz.3.2014.12.10.09.32.25 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 10 Dec 2014 09:32:25 -0800 (PST) Received: by mail-wi0-f181.google.com with SMTP id r20so5971267wiv.8 for ; Wed, 10 Dec 2014 09:32:25 -0800 (PST) MIME-Version: 1.0 In-Reply-To: References: <20141210163017.092096069@linux.com> <20141210163033.717707217@linux.com> Date: Wed, 10 Dec 2014 19:32:25 +0200 Message-ID: Subject: Re: [PATCH 3/7] slub: Do not use c->page on free From: Pekka Enberg Content-Type: text/plain; charset=UTF-8 Sender: owner-linux-mm@kvack.org List-ID: To: Christoph Lameter Cc: akpm , Steven Rostedt , LKML , Thomas Gleixner , "linux-mm@kvack.org" , iamjoonsoo@lge.com, Jesper Dangaard Brouer On Wed, Dec 10, 2014 at 7:08 PM, Christoph Lameter wrote: >> > +{ >> > + 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. Aah, it's the (1 << MAX_ORDER) optimization that confused me. Perhaps add a comment there to make it more obvious? I'm fine with the optimization: Reviewed-by: Pekka Enberg - Pekka -- 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