* [PATCH 6/6] cpumask: reduce cpumask_size
@ 2009-11-19 9:01 Rusty Russell
0 siblings, 0 replies; only message in thread
From: Rusty Russell @ 2009-11-19 9:01 UTC (permalink / raw)
To: linux-kernel; +Cc: Ingo Molnar, Mike Travis
Now we're sure noone is using old cpumask operators, nor *cpumask, we can
allocate less bits safely. This reduces the memory usage of off-stack
cpumasks when CONFIG_CPUMASK_OFFSTACK=y but we don't have NR_CPUS actual
cpus.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
---
include/linux/cpumask.h | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h
--- a/include/linux/cpumask.h
+++ b/include/linux/cpumask.h
@@ -1014,13 +1014,11 @@ static inline int cpulist_parse(const ch
/**
* cpumask_size - size to allocate for a 'struct cpumask' in bytes
*
- * This will eventually be a runtime variable, depending on nr_cpu_ids.
+ * This can be a runtime variable, depending on nr_cpu_ids.
*/
static inline size_t cpumask_size(void)
{
- /* FIXME: Once all cpumask assignments are eliminated, this
- * can be nr_cpumask_bits */
- return BITS_TO_LONGS(NR_CPUS) * sizeof(long);
+ return BITS_TO_LONGS(nr_cpumask_bits) * sizeof(long);
}
/*
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-11-19 9:01 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-19 9:01 [PATCH 6/6] cpumask: reduce cpumask_size Rusty Russell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox