public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch][rfc] Memory Binding (0/1)
@ 2003-04-01 22:31 Matthew Dobson
  2003-04-01 22:39 ` [patch][rfc] Memory Binding (1/1) Matthew Dobson
  0 siblings, 1 reply; 7+ messages in thread
From: Matthew Dobson @ 2003-04-01 22:31 UTC (permalink / raw)
  To: linux-kernel; +Cc: Andrew Morton, Martin J. Bligh

[-- Attachment #1: Type: text/plain, Size: 577 bytes --]

So I've made a couple attempts at adding a Memory Binding facility to 
the kernel.  Obviously, I've had no success as yet, so I'm stubbornly 
trying another approach! ;)

This patch is just a small pre-patch to the real memory binding.  It 
just adds get_zonelist() and get_node_zonelist() calls, to make some 
code a little more readable.  This patch is super straight-forward.  The 
real fun is in the next patch...

[mcd@arrakis membind]$ diffstat 00-pre_membind.patch
  gfp.h    |    2 +-
  mmzone.h |    8 ++++++++
  2 files changed, 9 insertions(+), 1 deletion(-)

-Matt

[-- Attachment #2: 00-pre_membind.patch --]
[-- Type: text/plain, Size: 1271 bytes --]

diff -Nur --exclude-from=/usr/src/.dontdiff linux-2.5.66-vanilla/include/linux/gfp.h linux-2.5.66-pre_membind/include/linux/gfp.h
--- linux-2.5.66-vanilla/include/linux/gfp.h	Mon Mar 24 14:00:10 2003
+++ linux-2.5.66-pre_membind/include/linux/gfp.h	Mon Mar 31 17:38:47 2003
@@ -52,7 +52,7 @@
 	if (unlikely(order >= MAX_ORDER))
 		return NULL;
 
-	return __alloc_pages(gfp_mask, order, NODE_DATA(nid)->node_zonelists + (gfp_mask & GFP_ZONEMASK));
+	return __alloc_pages(gfp_mask, order, get_node_zonelist(nid, gfp_mask));
 }
 
 #define alloc_pages(gfp_mask, order) \
diff -Nur --exclude-from=/usr/src/.dontdiff linux-2.5.66-vanilla/include/linux/mmzone.h linux-2.5.66-pre_membind/include/linux/mmzone.h
--- linux-2.5.66-vanilla/include/linux/mmzone.h	Mon Mar 24 14:00:45 2003
+++ linux-2.5.66-pre_membind/include/linux/mmzone.h	Mon Mar 31 17:38:47 2003
@@ -326,6 +326,14 @@
 #define num_online_memblks()		1
 
 #endif /* CONFIG_DISCONTIGMEM || CONFIG_NUMA */
+
+static inline struct zonelist *get_node_zonelist(int nid, int gfp_mask)
+{
+	return NODE_DATA(nid)->node_zonelists + (gfp_mask & GFP_ZONEMASK);
+}
+
+#define get_zonelist(gfp_mask) get_node_zonelist(numa_node_id(), gfp_mask)
+
 #endif /* !__ASSEMBLY__ */
 #endif /* __KERNEL__ */
 #endif /* _LINUX_MMZONE_H */

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

end of thread, other threads:[~2003-04-02 20:45 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-04-01 22:31 [patch][rfc] Memory Binding (0/1) Matthew Dobson
2003-04-01 22:39 ` [patch][rfc] Memory Binding (1/1) Matthew Dobson
2003-04-01 23:39   ` Andrew Morton
2003-04-02  2:42     ` Matthew Dobson
2003-04-02 20:43       ` Bryan Rittmeyer
2003-04-02  7:26   ` Christoph Hellwig
2003-04-02  8:17   ` [Lse-tech] " Andi Kleen

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