linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Yasunori Goto <y-goto@jp.fujitsu.com>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [Patch: 003/006] pgdat allocation for new node add (generic alloc node_data)
Date: Fri, 21 Apr 2006 09:23:33 +0900	[thread overview]
Message-ID: <20060421090220.FCF7.Y-GOTO@jp.fujitsu.com> (raw)
In-Reply-To: <20060420160131.7344fe8f.akpm@osdl.org>

> Yasunori Goto <y-goto@jp.fujitsu.com> wrote:
> >
> >  +#define generic_alloc_nodedata(nid)				\
> >  +({								\
> >  +	(pg_data_t *)kzalloc(sizeof(pg_data_t), GFP_KERNEL);	\
> >  +})
> 
> In general, library functions which perform memory allocation should not
> make assumptions about which gfp_t they are allowed to use.
> 
> So this really should be `generic_alloc_nodedata(nid, gfp_mask)'.
> 
> However, it's very desirable that memory allocations use GFP_KERNEL rather
> than, say, GFP_ATOMIC.  So your interface here _forces_ callers to be in a
> state where GFP_KERNEL is legal, which is good discipline.
> 
> Although if that turns out to be a problem, we can expect to see a sad
> little patch from someone which tries to change this to GFP_ATOMIC, which
> makes everything worse - even those callers who _can_ use GFP_KERNEL.
> 
> (In practice, NUMA developers seem to never test with sufficient
> CONFIG_DEBUG_* flags enabled, and with CONFIG_PREEMPT, so they happily
> don't get to discover their sleep-in-spinlock bugs anyway).
> 
> Anyway, on balance, I think it'd be best to convert this API to take a
> gfp_t as well.

To tell the truth, I prefer making new interface to allocate new added
memory than using normal kzalloc().
Because this kzalloc() will allocate() other node's memory
by im-completion new memory's initialization.

In addition, memory hot-add may be required at the time that memory
is already exhausted.
This kzalloc() might be "finish blow". (pgdat is not small.
Especially, ia64 needs node data's copy.)
Probably, user will feel very strange. 
"I added new memory. But OOM killer is called by it, why????"

So I think alloc_hot_added_memory() is desirable, which can allocate new
added memory until completion of initialization.

Thanks for your advice.

-- 
Yasunori Goto 


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

  reply	other threads:[~2006-04-21  0:23 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-20 10:03 [Patch: 000/006] pgdat allocation for new node add Yasunori Goto
2006-04-20 10:10 ` [Patch: 001/006] pgdat allocation for new node add (specify node id) Yasunori Goto
2006-04-20 22:49   ` Andrew Morton
2006-04-20 23:38     ` Yasunori Goto
2006-04-20 10:10 ` [Patch: 002/006] pgdat allocation for new node add (get node id by acpi) Yasunori Goto
2006-04-20 10:10 ` [Patch: 003/006] pgdat allocation for new node add (generic alloc node_data) Yasunori Goto
2006-04-20 23:01   ` Andrew Morton
2006-04-21  0:23     ` Yasunori Goto [this message]
2006-04-20 10:10 ` [Patch: 004/006] pgdat allocation for new node add (refresh node_data[]) Yasunori Goto
2006-04-20 10:10 ` [Patch: 005/006] pgdat allocation for new node add (export kswapd start func) Yasunori Goto
2006-04-20 10:10 ` [Patch: 006/006] pgdat allocation for new node add (call pgdat allocation) Yasunori Goto

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=20060421090220.FCF7.Y-GOTO@jp.fujitsu.com \
    --to=y-goto@jp.fujitsu.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --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