All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Hansen <dave@linux.vnet.ibm.com>
To: David Rientjes <rientjes@google.com>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Timur Tabi <timur@freescale.com>,
	Andi Kleen <andi@firstfloor.org>, Mel Gorman <mel@csn.ul.ie>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH 2/2] make new alloc_pages_exact()
Date: Thu, 07 Apr 2011 15:17:43 -0700	[thread overview]
Message-ID: <1302214663.8184.4164.camel@nimitz> (raw)
In-Reply-To: <alpine.DEB.2.00.1104071452070.14967@chino.kir.corp.google.com>

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


WARNING: multiple messages have this Message-ID (diff)
From: Dave Hansen <dave@linux.vnet.ibm.com>
To: David Rientjes <rientjes@google.com>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Timur Tabi <timur@freescale.com>,
	Andi Kleen <andi@firstfloor.org>, Mel Gorman <mel@csn.ul.ie>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH 2/2] make new alloc_pages_exact()
Date: Thu, 07 Apr 2011 15:17:43 -0700	[thread overview]
Message-ID: <1302214663.8184.4164.camel@nimitz> (raw)
In-Reply-To: <alpine.DEB.2.00.1104071452070.14967@chino.kir.corp.google.com>

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, 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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2011-04-07 22:17 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-07 17:21 [PATCH 1/2] rename alloc_pages_exact() Dave Hansen
2011-04-07 17:21 ` Dave Hansen
2011-04-07 17:21 ` [PATCH 2/2] make new alloc_pages_exact() Dave Hansen
2011-04-07 17:21   ` Dave Hansen
2011-04-07 22:03   ` David Rientjes
2011-04-07 22:03     ` David Rientjes
2011-04-07 22:17     ` Dave Hansen [this message]
2011-04-07 22:17       ` Dave Hansen
2011-04-08 12:28   ` Michal Nazarewicz
2011-04-08 12:28     ` Michal Nazarewicz
2011-04-08 13:19     ` Dave Hansen
2011-04-08 13:19       ` Dave Hansen
2011-04-08 13:23       ` Michal Nazarewicz
2011-04-08 13:23         ` Michal Nazarewicz
2011-04-08 22:06     ` Dave Hansen
2011-04-08 22:06       ` Dave Hansen
2011-04-07 21:40 ` [PATCH 1/2] rename alloc_pages_exact() David Rientjes
2011-04-07 21:40   ` David Rientjes
2011-04-07 21:58   ` Dave Hansen
2011-04-07 21:58     ` Dave Hansen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1302214663.8184.4164.camel@nimitz \
    --to=dave@linux.vnet.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=andi@firstfloor.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mel@csn.ul.ie \
    --cc=rientjes@google.com \
    --cc=timur@freescale.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.