linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Paul Jackson <pj@sgi.com>
To: linux-mm@kvack.org
Cc: akpm@osdl.org, Nick Piggin <nickpiggin@yahoo.com.au>,
	David Rientjes <rientjes@google.com>, Andi Kleen <ak@suse.de>,
	mbligh@google.com, rohitseth@google.com, menage@google.com,
	Paul Jackson <pj@sgi.com>,
	clameter@sgi.com
Subject: [RFC] fake numa node speedup - fix for non-CPUSET builds
Date: Wed, 27 Sep 2006 01:36:52 -0700	[thread overview]
Message-ID: <20060927083652.16816.90521.sendpatchset@sam.engr.sgi.com> (raw)

My RFC patch memory_fast_zonelist_scan does not compile
in the case of NUMA enabled, CPUSET disabled, because it
tries to access "current->mems_allowed" from NUMA code.

Fix by adding yet another cpuset.h macro to access the
current tasks mems_allowed (or node_online_map for non-CPUSET
configs.)

Signed-off-by: Paul Jackson

---

 include/linux/cpuset.h |    2 ++
 mm/page_alloc.c        |    2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

--- 2.6.18-rc7-mm1.orig/mm/page_alloc.c	2006-09-26 18:00:23.000000000 -0700
+++ 2.6.18-rc7-mm1/mm/page_alloc.c	2006-09-26 18:01:49.000000000 -0700
@@ -956,7 +956,7 @@ static int zlf_setup(struct zonelist *zo
 		return 0;
 
 	allowednodes = !in_interrupt() && (alloc_flags & ALLOC_CPUSET) ?
-				&current->mems_allowed : &node_online_map;
+				&cpuset_current_mems_allowed : &node_online_map;
 
 	if (jiffies - zlf->last_full_zap > 1 * HZ) {
 		nodes_clear(zlf->fullnodes);
--- 2.6.18-rc7-mm1.orig/include/linux/cpuset.h	2006-09-26 18:00:23.000000000 -0700
+++ 2.6.18-rc7-mm1/include/linux/cpuset.h	2006-09-26 18:01:49.000000000 -0700
@@ -23,6 +23,7 @@ extern void cpuset_fork(struct task_stru
 extern void cpuset_exit(struct task_struct *p);
 extern cpumask_t cpuset_cpus_allowed(struct task_struct *p);
 extern nodemask_t cpuset_mems_allowed(struct task_struct *p);
+#define cpuset_current_mems_allowed (current->mems_allowed)
 void cpuset_init_current_mems_allowed(void);
 void cpuset_update_task_memory_state(void);
 #define cpuset_nodes_subset_current_mems_allowed(nodes) \
@@ -83,6 +84,7 @@ static inline nodemask_t cpuset_mems_all
 	return node_possible_map;
 }
 
+#define cpuset_current_mems_allowed (node_online_map)
 static inline void cpuset_init_current_mems_allowed(void) {}
 static inline void cpuset_update_task_memory_state(void) {}
 #define cpuset_nodes_subset_current_mems_allowed(nodes) (1)

-- 
                  I won't rest till it's the best ...
                  Programmer, Linux Scalability
                  Paul Jackson <pj@sgi.com> 1.925.600.0401

--
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-09-27  8:36 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20060927083652.16816.90521.sendpatchset@sam.engr.sgi.com \
    --to=pj@sgi.com \
    --cc=ak@suse.de \
    --cc=akpm@osdl.org \
    --cc=clameter@sgi.com \
    --cc=linux-mm@kvack.org \
    --cc=mbligh@google.com \
    --cc=menage@google.com \
    --cc=nickpiggin@yahoo.com.au \
    --cc=rientjes@google.com \
    --cc=rohitseth@google.com \
    /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