From: Christoph Lameter <cl@linux.com>
To: Tejun Heo <tj@kernel.org>
Cc: akpm@linuxfoundation.org, linux-mm@kvack.org,
Alex Shi <alex.shi@intel.com>,
Steven Rostedt <srostedt@redhat.com>,
linux-kernel@vger.kernel.org, Ingo Molnar <mingo@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Thomas Gleixner <tglx@linutronix.de>
Subject: [raw v1 1/4] Use raw_cpu ops for determining current NUMA node
Date: Mon, 7 Oct 2013 18:31:53 +0000 [thread overview]
Message-ID: <000001419430909f-da6a6e6c-103b-4c2e-9fa3-39e70a9b35a9-000000@email.amazonses.com> (raw)
In-Reply-To: <20131007183226.334180014@linux.com>
With the preempt check logic we will get false positives from
these locations. Before the use of __this_cpu ops there were
no checks for preemption present either and smp_raw_processor_id()
was used. See http://www.spinics.net/lists/linux-numa/msg00641.html
Use raw_cpu_read() to avoid preemption messages.
Note that this issue has been discussed in prior years.
If the process changes nodes after retrieving the current numa node then
that is acceptable since most uses of numa_node etc are for optimization
and not for correctness.
CC: linux-mm@kvack.org
Cc: Alex Shi <alex.shi@intel.com>
Signed-off-by: Christoph Lameter <cl@linux.com>
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
--
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>
parent reply other threads:[~2013-10-07 18:31 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <20131007183226.334180014@linux.com>]
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=000001419430909f-da6a6e6c-103b-4c2e-9fa3-39e70a9b35a9-000000@email.amazonses.com \
--to=cl@linux.com \
--cc=akpm@linuxfoundation.org \
--cc=alex.shi@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=srostedt@redhat.com \
--cc=tglx@linutronix.de \
--cc=tj@kernel.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