[PATCH] ia64: implement efficient node_to_cpumask_ptr()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Subject: ia64: implement efficient node_to_cpumask_ptr()

Now, arch generic node_to_cpumask_ptr() is slightly inefficient.
it makes cpumask_t local variable.

	generic version
	--------------------------------------
	#define node_to_cpumask_ptr(v, node)                                    \
	                cpumask_t _##v = node_to_cpumask(node), *v = &_##v

but x86 specific node_to_cpumask_ptr() is more efficient.

	x86 version
	------------------------------------
	#define node_to_cpumask_ptr(v, node)            \
	                 cpumask_t *v = &(node_to_cpumask_map[node])

So, if we make ia64 specific node_to_cpusmask_ptr(),
we can reduce stack a bit.


Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@xxxxxxxxxxxxxx>
CC: Mike Travis <travis@xxxxxxx>

---
 include/asm-ia64/topology.h |    7 +++++++
 1 file changed, 7 insertions(+)

Index: b/include/asm-ia64/topology.h
===================================================================
--- a/include/asm-ia64/topology.h
+++ b/include/asm-ia64/topology.h
@@ -37,6 +37,13 @@
  */
 #define node_to_cpumask(node) (node_to_cpu_mask[node])
 
+/* Replace default node_to_cpumask_ptr with optimized version */
+#define node_to_cpumask_ptr(v, node)		\
+		const cpumask_t *v = &node_to_cpumask(node)
+
+#define node_to_cpumask_ptr_next(v, node)	\
+		v = &node_to_cpumask(node)
+
 /*
  * Returns the number of the node containing Node 'nid'.
  * Not implemented here. Multi-level hierarchies detected with




--
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel]     [Sparc Linux]     [DCCP]     [Linux ARM]     [Yosemite News]     [Linux SCSI]     [Linux x86_64]     [Linux for Ham Radio]

  Powered by Linux