lkml.org 
[lkml]   [2006]   [Apr]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [Patch: 003/006] pgdat allocation for new node add (generic alloc node_data)
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 unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-04-21 01:05    [W:2.067 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site