[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1318960126.4465.249.camel@nimitz>
Date: Tue, 18 Oct 2011 10:48:46 -0700
From: Dave Hansen <dave@...ux.vnet.ibm.com>
To: Michal Nazarewicz <mina86@...a86.com>
Cc: Marek Szyprowski <m.szyprowski@...sung.com>,
Mel Gorman <mel@....ul.ie>, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-media@...r.kernel.org,
linux-mm@...ck.org, linaro-mm-sig@...ts.linaro.org,
Kyungmin Park <kyungmin.park@...sung.com>,
Russell King <linux@....linux.org.uk>,
Andrew Morton <akpm@...ux-foundation.org>,
KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>,
Ankita Garg <ankita@...ibm.com>,
Daniel Walker <dwalker@...eaurora.org>,
Arnd Bergmann <arnd@...db.de>,
Jesse Barker <jesse.barker@...aro.org>,
Jonathan Corbet <corbet@....net>,
Shariq Hasnain <shariq.hasnain@...aro.org>,
Chunsang Jeong <chunsang.jeong@...aro.org>
Subject: Re: [PATCH 2/9] mm: alloc_contig_freed_pages() added
On Tue, 2011-10-18 at 10:26 -0700, Michal Nazarewicz wrote:
> > You can do this in a more general fashion by checking the
> > zone boundaries and resolving the pfn->page every MAX_ORDER_NR_PAGES.
> > That will not be SPARSEMEM specific.
>
> I've tried doing stuff that way but it ended up with much more code.
I guess instead of:
>> +static inline bool zone_pfn_same_memmap(unsigned long pfn1, unsigned long pfn2)
>> +{
>> + return pfn_to_section_nr(pfn1) == pfn_to_section_nr(pfn2);
>> +}
You could do:
static inline bool zone_pfn_same_maxorder(unsigned long pfn1, unsigned long pfn2)
{
unsigned long mask = MAX_ORDER_NR_PAGES-1;
return (pfn1 & mask) == (pfn2 & mask);
}
I think that works. Should be the same code you have now, basically.
-- Dave
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists