lkml.org 
[lkml]   [2013]   [Oct]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/6] mm: Use raw_cpu ops for determining current NUMA node
On Tue, Oct 15, 2013 at 12:47:25PM -0500, Christoph Lameter wrote:
> Index: linux/include/linux/topology.h
> ===================================================================
> --- linux.orig/include/linux/topology.h 2013-09-24 11:29:51.000000000 -0500
> +++ linux/include/linux/topology.h 2013-09-24 11:30:18.893831971 -0500
> @@ -182,7 +182,7 @@ DECLARE_PER_CPU(int, numa_node);
> /* Returns the number of the current Node. */
> static inline int numa_node_id(void)
> {
> - return __this_cpu_read(numa_node);
> + return raw_cpu_read(numa_node);
> }
> #endif
>
> @@ -239,7 +239,7 @@ static inline void set_numa_mem(int node
> /* Returns the number of the nearest Node with memory */
> static inline int numa_mem_id(void)
> {
> - return __this_cpu_read(_numa_mem_);
> + return raw_cpu_read(_numa_mem_);
> }
> #endif

NAK; smp_processor_id() has the preemption checks; for consistently
numa_node_id() should have them too, for the very same reason. Who's to
say the node id is still valid when you return from this function? If
we're preemptable we could've just been migrated away to another node.

So please introduce raw_numa_node_id() and use that; all fully analogous
to smp_processor_id().


\
 
 \ /
  Last update: 2013-10-16 11:21    [W:0.368 / U:1.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site