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]
Date:	Thu, 07 Apr 2011 15:17:43 -0700
From:	Dave Hansen <dave@...ux.vnet.ibm.com>
To:	David Rientjes <rientjes@...gle.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>
Subject: Re: [PATCH 2/2] make new alloc_pages_exact()

On Thu, 2011-04-07 at 15:03 -0700, David Rientjes wrote:
> On Thu, 7 Apr 2011, Dave Hansen wrote:
> > What I really wanted in the end was a highmem-capable alloc_pages_exact(),
> > so here it is.
> 
> Perhaps expand upon how the new alloc_pages_exact() works and what it will 
> be used for instead of only talking about how it's named?

Will do.

> > +/* 'struct page' version */
> > +struct page *__alloc_pages_exact(gfp_t, size_t);
> > +void __free_pages_exact(struct page *, size_t);
> 
> They're not required, but these should have the names of the arguments 
> like the other prototypes in this file.

Fair enough.

> > -	addr = __get_free_pages(gfp_mask, order);
> > -	if (addr) {
> > -		unsigned long alloc_end = addr + (PAGE_SIZE << order);
> > -		unsigned long used = addr + PAGE_ALIGN(size);
> > +	page = alloc_pages(gfp_mask, order);
> > +	if (page) {
> > +		struct page *alloc_end = page + (1 << order);
> > +		struct page *used = page + PAGE_ALIGN(size)/PAGE_SIZE;
> 
> Wouldn't it better to call this "unused" rather than "used" since it 
> represents a cursor over pages that we want to free?

Yeah, agreed.  I think I screwed this up once when coding this because I
misread it.  I'll change it.

-- 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

Powered by Openwall GNU/*/Linux Powered by OpenVZ