lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <op.vtt09xt73l0zgt@mnazarewicz-glaptop>
Date:	Tue, 12 Apr 2011 17:57:23 +0200
From:	"Michal Nazarewicz" <mina86@...a86.com>
To:	"Dave Hansen" <dave@...ux.vnet.ibm.com>
Cc:	linux-mm@...ck.org, linux-kernel@...r.kernel.org,
	"Timur Tabi" <timur@...escale.com>,
	"Andi Kleen" <andi@...stfloor.org>, "Mel Gorman" <mel@....ul.ie>,
	"Andrew Morton" <akpm@...ux-foundation.org>,
	"David Rientjes" <rientjes@...gle.com>
Subject: Re: [PATCH 3/3] reuse __free_pages_exact() in __alloc_pages_exact()

On Tue, 12 Apr 2011 17:24:24 +0200, Dave Hansen <dave@...ux.vnet.ibm.com>  
wrote:

> On Tue, 2011-04-12 at 12:29 +0200, Michal Nazarewicz wrote:
>> On Tue, 12 Apr 2011 00:03:48 +0200, Dave Hansen  
>> <dave@...ux.vnet.ibm.com>
>> wrote:
>> > diff -puN mm/page_alloc.c~reuse-free-exact mm/page_alloc.c
>> > --- linux-2.6.git/mm/page_alloc.c~reuse-free-exact	2011-04-11
>> > 15:01:17.701822598 -0700
>> > +++ linux-2.6.git-dave/mm/page_alloc.c	2011-04-11 15:01:17.713822594
>> > -0700
>> > @@ -2338,14 +2338,11 @@ struct page *__alloc_pages_exact(gfp_t g
>> > 	page = alloc_pages(gfp_mask, order);
>> >  	if (page) {
>> > -		struct page *alloc_end = page + (1 << order);
>> > -		struct page *used = page + nr_pages;
>> > +		struct page *unused_start = page + nr_pages;
>> > +		int nr_unused = (1 << order) - nr_pages;
>>
>> How about unsigned long?
>
> Personally, I'd rather leave this up to the poor sucker that tries to
> set MAX_ORDER to 33.  If someone did that, we'd end up with kernels that
> couldn't even boot on systems with less than 16GB of RAM since the
> (required) flatmem mem_map[] would take up ~14.3GB.  They couldn't
> handle memory holes and couldn't be NUMA-aware, either.

I was thinking more about the fact that the int will get converted
anyway when calling __free_pages_exact() and it makes no sense for
number of pages to be negative.  Just a suggestion, no strong
feelings.

-- 
Best regards,                                         _     _
.o. | Liege of Serenely Enlightened Majesty of      o' \,=./ `o
..o | Computer Science,  Michal "mina86" Nazarewicz    (o o)
ooo +-----<email/xmpp: mnazarewicz@...gle.com>-----ooO--(_)--Ooo--
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ