From: David Chinner <dgc@sgi.com>
To: Christoph Hellwig <hch@lst.de>
Cc: akpm@osdl.org, linux-mm@kvack.org
Subject: Re: [PATCH] slab: cleanup kmem_getpages
Date: Wed, 19 Apr 2006 09:20:00 +1000 [thread overview]
Message-ID: <20060418232000.GL2732@melbourne.sgi.com> (raw)
In-Reply-To: <20060414183618.GA21144@lst.de>
On Fri, Apr 14, 2006 at 08:36:18PM +0200, Christoph Hellwig wrote:
> The last ifdef addition hit the ugliness treshold on this functions, so:
>
> - rename the varibale i to nr_pages so it's somewhat descriptive
> - remove the addr variable and do the page_address call at the very end
> - instead of ifdef'ing the whole alloc_pages_node call just make the
> __GFP_COMP addition to flags conditional
> - rewrite the __GFP_COMP comment to make sense
....
> + page = alloc_pages_node(nodeid, flags, cachep->gfporder);
> if (!page)
> return NULL;
> - addr = page_address(page);
.....
> + while (nr_pages--) {
> __SetPageSlab(page);
> page++;
> }
> - return addr;
> + return page_address(page);
I think that's a bug - you return the address of the page after the
allocation, not the first page of the allocation.
Cheers,
Dave.
--
Dave Chinner
R&D Software Enginner
SGI Australian Software Group
--
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: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2006-04-18 23:20 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-04-14 18:36 [PATCH] slab: cleanup kmem_getpages Christoph Hellwig
2006-04-18 23:20 ` David Chinner [this message]
2006-04-18 23:24 ` Christoph Hellwig
2006-04-18 23:38 ` Andrew Morton
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=20060418232000.GL2732@melbourne.sgi.com \
--to=dgc@sgi.com \
--cc=akpm@osdl.org \
--cc=hch@lst.de \
--cc=linux-mm@kvack.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).