From: Jes Sorensen <jes@sgi.com>
To: Dean Nelson <dcn@sgi.com>
Cc: akpm@osdl.org, tony.luck@intel.com, avolkov@varma-el.com,
linux-ia64@vger.kernel.org, linux-kernel@vger.kernel.org,
paulus@samba.org, holt@sgi.com
Subject: Re: [PATCH] change gen_pool allocator to not touch managed memory
Date: Wed, 26 Apr 2006 13:42:03 +0000 [thread overview]
Message-ID: <444F78AB.6030803@sgi.com> (raw)
In-Reply-To: <20060426132803.GA30360@sgi.com>
Dean Nelson wrote:
> On Wed, Apr 26, 2006 at 11:12:48AM +0200, Jes Sorensen wrote:
>> Dean Nelson wrote:
>>> + if (nbytes > PAGE_SIZE) {
>>> + chunk = vmalloc_node(nbytes, nid);
>>> + } else {
>>> + chunk = kmalloc_node(nbytes, GFP_KERNEL, nid);
>>> + }
>> Any patch that adds vmalloc() calls to code always makes the little
>> hairs on the back of my neck stand up. Any chance we could get away with
>> alloc_pages_node() for this?
>
> Is it the mapping of the pages that bothers you? If using alloc_pages_node()
> is the preferred way, I certainly can make the change. But if I do there is
> a greater potential that we may have to return failure to the caller of
> gen_pool_add(), that is if we can't get the necessary number of contiguous
> pages. Now granted the likelyhood that anyone would require more than a
> page for a bitmap is very very small. I'd say the vast majority of callers
> will end up using kmalloc_node(). I can go either way, just let me know
> whether I should make the change or not.
vmalloc mappings are $$$ on many archs so they should be avoided if in
any way possible. Also, kmalloc can handle more than just a page, and it
might be better to just use that here rather than alloc_pages actually
since I presume there is nothing preventing the bitmap sharing pages
with other data.
In this case I think adding the vmalloc call is overkill, I would simply
make it call kmalloc_node() unconditionally for all sizes and let it
fail if that situation occurs, given how unlikely it is.
>>> Index: linux-2.6/arch/ia64/sn/kernel/sn2/cache.c
>>> =================================>>> --- linux-2.6.orig/arch/ia64/sn/kernel/sn2/cache.c 2006-04-24 12:25:36.234717101 -0500
>>> +++ linux-2.6/arch/ia64/sn/kernel/sn2/cache.c 2006-04-24 12:27:56.012899026 -0500
>> This part we should maybe do in a seperate patch? It seems valid on it's
>> own?
>
> I thought of this, but if this patch were separated out then the remaining
> patch would be dependent on it since the uncached allocator is being
> changed to call sn_flush_all_caches() with an uncached address.
> It certainly could be done, but is it worth the effort? Let me know
> how I should proceed with this.
I would expect this part of the patch to be able to go in as is,
straight away so I don't think it should be a problem. It's not a big
deal whether we do it one way or another to me.
Cheers,
Jes
WARNING: multiple messages have this Message-ID (diff)
From: Jes Sorensen <jes@sgi.com>
To: Dean Nelson <dcn@sgi.com>
Cc: akpm@osdl.org, tony.luck@intel.com, avolkov@varma-el.com,
linux-ia64@vger.kernel.org, linux-kernel@vger.kernel.org,
paulus@samba.org, holt@sgi.com
Subject: Re: [PATCH] change gen_pool allocator to not touch managed memory
Date: Wed, 26 Apr 2006 15:42:03 +0200 [thread overview]
Message-ID: <444F78AB.6030803@sgi.com> (raw)
In-Reply-To: <20060426132803.GA30360@sgi.com>
Dean Nelson wrote:
> On Wed, Apr 26, 2006 at 11:12:48AM +0200, Jes Sorensen wrote:
>> Dean Nelson wrote:
>>> + if (nbytes > PAGE_SIZE) {
>>> + chunk = vmalloc_node(nbytes, nid);
>>> + } else {
>>> + chunk = kmalloc_node(nbytes, GFP_KERNEL, nid);
>>> + }
>> Any patch that adds vmalloc() calls to code always makes the little
>> hairs on the back of my neck stand up. Any chance we could get away with
>> alloc_pages_node() for this?
>
> Is it the mapping of the pages that bothers you? If using alloc_pages_node()
> is the preferred way, I certainly can make the change. But if I do there is
> a greater potential that we may have to return failure to the caller of
> gen_pool_add(), that is if we can't get the necessary number of contiguous
> pages. Now granted the likelyhood that anyone would require more than a
> page for a bitmap is very very small. I'd say the vast majority of callers
> will end up using kmalloc_node(). I can go either way, just let me know
> whether I should make the change or not.
vmalloc mappings are $$$ on many archs so they should be avoided if in
any way possible. Also, kmalloc can handle more than just a page, and it
might be better to just use that here rather than alloc_pages actually
since I presume there is nothing preventing the bitmap sharing pages
with other data.
In this case I think adding the vmalloc call is overkill, I would simply
make it call kmalloc_node() unconditionally for all sizes and let it
fail if that situation occurs, given how unlikely it is.
>>> Index: linux-2.6/arch/ia64/sn/kernel/sn2/cache.c
>>> ===================================================================
>>> --- linux-2.6.orig/arch/ia64/sn/kernel/sn2/cache.c 2006-04-24 12:25:36.234717101 -0500
>>> +++ linux-2.6/arch/ia64/sn/kernel/sn2/cache.c 2006-04-24 12:27:56.012899026 -0500
>> This part we should maybe do in a seperate patch? It seems valid on it's
>> own?
>
> I thought of this, but if this patch were separated out then the remaining
> patch would be dependent on it since the uncached allocator is being
> changed to call sn_flush_all_caches() with an uncached address.
> It certainly could be done, but is it worth the effort? Let me know
> how I should proceed with this.
I would expect this part of the patch to be able to go in as is,
straight away so I don't think it should be a problem. It's not a big
deal whether we do it one way or another to me.
Cheers,
Jes
next prev parent reply other threads:[~2006-04-26 13:42 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-04-24 18:35 [PATCH] change gen_pool allocator to not touch managed memory Dean Nelson
2006-04-24 18:35 ` Dean Nelson
2006-04-25 1:16 ` Andrew Morton
2006-04-25 1:16 ` Andrew Morton
2006-04-25 15:50 ` Dean Nelson
2006-04-25 15:50 ` Dean Nelson
2006-04-26 9:12 ` Jes Sorensen
2006-04-26 9:12 ` Jes Sorensen
2006-04-26 11:08 ` Robin Holt
2006-04-26 11:08 ` Robin Holt
2006-04-26 11:18 ` Jes Sorensen
2006-04-26 11:18 ` Jes Sorensen
2006-04-26 13:28 ` Dean Nelson
2006-04-26 13:28 ` Dean Nelson
2006-04-26 13:42 ` Jes Sorensen [this message]
2006-04-26 13:42 ` Jes Sorensen
2006-04-26 16:31 ` Dean Nelson
2006-04-26 16:31 ` Dean Nelson
2006-04-28 12:49 ` Jes Sorensen
2006-04-28 12:49 ` Jes Sorensen
2006-04-26 10:27 ` Jesper Juhl
2006-04-26 10:27 ` Jesper Juhl
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=444F78AB.6030803@sgi.com \
--to=jes@sgi.com \
--cc=akpm@osdl.org \
--cc=avolkov@varma-el.com \
--cc=dcn@sgi.com \
--cc=holt@sgi.com \
--cc=linux-ia64@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=paulus@samba.org \
--cc=tony.luck@intel.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.