public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cpumask: alloc_cpumask_var() use NUMA_NO_NODE
@ 2011-04-28 14:17 KOSAKI Motohiro
  2011-05-05 19:45 ` Andrew Morton
  0 siblings, 1 reply; 3+ messages in thread
From: KOSAKI Motohiro @ 2011-04-28 14:17 UTC (permalink / raw)
  To: LKML, Andrew Morton; +Cc: kosaki.motohiro

NUMA_NO_NODE and numa_node_id() are different meanings. NUMA_NO_NODE 
is obviously recomended fallback.

Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
---
 lib/cpumask.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/cpumask.c b/lib/cpumask.c
index 4f6425d..af3e581 100644
--- a/lib/cpumask.c
+++ b/lib/cpumask.c
@@ -131,7 +131,7 @@ EXPORT_SYMBOL(zalloc_cpumask_var_node);
  */
 bool alloc_cpumask_var(cpumask_var_t *mask, gfp_t flags)
 {
-	return alloc_cpumask_var_node(mask, flags, numa_node_id());
+	return alloc_cpumask_var_node(mask, flags, NUMA_NO_NODE);
 }
 EXPORT_SYMBOL(alloc_cpumask_var);
 
-- 
1.7.3.1




^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] cpumask: alloc_cpumask_var() use NUMA_NO_NODE
  2011-04-28 14:17 [PATCH] cpumask: alloc_cpumask_var() use NUMA_NO_NODE KOSAKI Motohiro
@ 2011-05-05 19:45 ` Andrew Morton
  2011-05-09  0:29   ` KOSAKI Motohiro
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2011-05-05 19:45 UTC (permalink / raw)
  To: KOSAKI Motohiro; +Cc: LKML, linux-mm

On Thu, 28 Apr 2011 23:17:15 +0900 (JST)
KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> wrote:

> NUMA_NO_NODE and numa_node_id() are different meanings. NUMA_NO_NODE 
> is obviously recomended fallback.
> 
> Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
> ---
>  lib/cpumask.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/lib/cpumask.c b/lib/cpumask.c
> index 4f6425d..af3e581 100644
> --- a/lib/cpumask.c
> +++ b/lib/cpumask.c
> @@ -131,7 +131,7 @@ EXPORT_SYMBOL(zalloc_cpumask_var_node);
>   */
>  bool alloc_cpumask_var(cpumask_var_t *mask, gfp_t flags)
>  {
> -	return alloc_cpumask_var_node(mask, flags, numa_node_id());
> +	return alloc_cpumask_var_node(mask, flags, NUMA_NO_NODE);
>  }
>  EXPORT_SYMBOL(alloc_cpumask_var);
>  

So effectively this will replace numa_node_id() with numa_mem_id(),
yes?  What runtime effects might this have?  

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] cpumask: alloc_cpumask_var() use NUMA_NO_NODE
  2011-05-05 19:45 ` Andrew Morton
@ 2011-05-09  0:29   ` KOSAKI Motohiro
  0 siblings, 0 replies; 3+ messages in thread
From: KOSAKI Motohiro @ 2011-05-09  0:29 UTC (permalink / raw)
  To: Andrew Morton; +Cc: kosaki.motohiro, LKML, linux-mm

Hi

> On Thu, 28 Apr 2011 23:17:15 +0900 (JST)
> KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> wrote:
> 
> > NUMA_NO_NODE and numa_node_id() are different meanings. NUMA_NO_NODE 
> > is obviously recomended fallback.
> > 
> > Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
> > ---
> >  lib/cpumask.c |    2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> > 
> > diff --git a/lib/cpumask.c b/lib/cpumask.c
> > index 4f6425d..af3e581 100644
> > --- a/lib/cpumask.c
> > +++ b/lib/cpumask.c
> > @@ -131,7 +131,7 @@ EXPORT_SYMBOL(zalloc_cpumask_var_node);
> >   */
> >  bool alloc_cpumask_var(cpumask_var_t *mask, gfp_t flags)
> >  {
> > -	return alloc_cpumask_var_node(mask, flags, numa_node_id());
> > +	return alloc_cpumask_var_node(mask, flags, NUMA_NO_NODE);
> >  }
> >  EXPORT_SYMBOL(alloc_cpumask_var);
> >  
> 
> So effectively this will replace numa_node_id() with numa_mem_id(),
> yes?  What runtime effects might this have?  

If I understand correctly,

 alloc_pages_node():  same effect both NUMA_NO_NODE and numa_node_id()
 kmalloc_node(): not same effect NUMA_NO_NODE and numa_node_id()

because 

slub.c
---------------------------------------------------
	slab_alloc() {
	 (snip)
	        if (unlikely(!object || !node_match(c, node)))
			// slow path
	        else {
			// fast path

and

	static inline int node_match(struct kmem_cache_cpu *c, int node)
	{
	#ifdef CONFIG_NUMA
	        if (node != NUMA_NO_NODE && c->node != node)
	                return 0;
	#endif
	        return 1;
	}
---------------------------------------------------
In a nutshell, numa_node_id() reduce slab cache reusing chance.


Oh, I missed slab.c code. It's using numa_mem_id(). thank you correct me!

numa_mem_id() don't have much meanings. It's ia64 HP big machine quirk.
it only affect to improve slab performance a little if users try to allocate
a memory from a cpu within memoryless node . and, 99% users never use such machine.

In a nutshell, NUMA_NO_NODE and numa_node_id() don't have a lot of difference
if users are using SLAB.



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-05-09  0:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-28 14:17 [PATCH] cpumask: alloc_cpumask_var() use NUMA_NO_NODE KOSAKI Motohiro
2011-05-05 19:45 ` Andrew Morton
2011-05-09  0:29   ` KOSAKI Motohiro

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox