From: Manfred Spraul <manfred@colorfullife.com>
To: Matthew Wilcox <matthew@wil.cx>
Cc: Andrew Morton <akpm@zip.com.au>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
dhowells@redhat.com
Subject: Re: [PATCH] Make slab use alloc_pages directly
Date: Mon, 24 Jan 2005 20:30:04 +0100 [thread overview]
Message-ID: <41F54CBC.9030606@colorfullife.com> (raw)
In-Reply-To: <20050124165412.GL31455@parcelfarce.linux.theplanet.co.uk>
Matthew Wilcox wrote:
>__get_free_pages() calls alloc_pages, finds the page_address() and
>throws away the struct page *. Slab then calls virt_to_page to get it
>back again. Much more efficient for slab to call alloc_pages itself,
>as well as making the NUMA and non-NUMA cases more similarr to each other.
>
>Signed-off-by: Matthew Wilcox <matthew@wil.cx>
>
>
>
Signed-off-by: Manfred Spraul <manfred@colorfullife.com>
>Index: linux-2.6/mm/slab.c
>===================================================================
>RCS file: /var/cvs/linux-2.6/mm/slab.c,v
>retrieving revision 1.29
>diff -u -p -r1.29 slab.c
>--- linux-2.6/mm/slab.c 12 Jan 2005 20:18:07 -0000 1.29
>+++ linux-2.6/mm/slab.c 24 Jan 2005 16:47:02 -0000
>@@ -894,16 +894,13 @@ static void *kmem_getpages(kmem_cache_t
>
> flags |= cachep->gfpflags;
> if (likely(nodeid == -1)) {
>- addr = (void*)__get_free_pages(flags, cachep->gfporder);
>- if (!addr)
>- return NULL;
>- page = virt_to_page(addr);
>+ page = alloc_pages(flags, cachep->gfporder);
> } else {
> page = alloc_pages_node(nodeid, flags, cachep->gfporder);
>- if (!page)
>- return NULL;
>- addr = page_address(page);
> }
>+ if (!page)
>+ return NULL;
>+ addr = page_address(page);
>
> i = (1 << cachep->gfporder);
> if (cachep->flags & SLAB_RECLAIM_ACCOUNT)
>
>
>
--
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:"aart@kvack.org"> aart@kvack.org </a>
next prev parent reply other threads:[~2005-01-24 19:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-01-24 16:54 Matthew Wilcox
2005-01-24 17:03 ` David Howells
2005-01-24 19:30 ` Manfred Spraul [this message]
2005-01-25 0:58 ` [PATCH] Remove special case in kmem_getpages() Brian Gerst
2005-01-25 1:04 ` Matthew Wilcox
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=41F54CBC.9030606@colorfullife.com \
--to=manfred@colorfullife.com \
--cc=akpm@zip.com.au \
--cc=dhowells@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=matthew@wil.cx \
/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