aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorLi Zefan <lizf@cn.fujitsu.com>2009-01-07 21:08:41 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-01-08 11:31:11 -0500
commit5a7625df725a486ad600b0036b6111dbd6321c41 (patch)
treea1b9c81371a6dffbed4a313ec25df33134925af2 /kernel
parentf5813d94279a18ff5936d675e24b44b44a571197 (diff)
cpuset: remove on stack cpumask_t in cpuset_sprintf_cpulist()
This patchset converts cpuset to use new cpumask API, and thus remove on stack cpumask_t to reduce stack usage. Before: # cat kernel/cpuset.c include/linux/cpuset.h | grep -c cpumask_t 21 After: # cat kernel/cpuset.c include/linux/cpuset.h | grep -c cpumask_t 0 This patch: Impact: reduce stack usage It's safe to call cpulist_scnprintf inside callback_mutex, and thus we can just remove the cpumask_t and no need to allocate a cpumask_var_t. Signed-off-by: Li Zefan <lizf@cn.fujitsu.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Rusty Russell <rusty@rustcorp.com.au> Acked-by: Mike Travis <travis@sgi.com> Cc: Paul Menage <menage@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/cpuset.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/kernel/cpuset.c b/kernel/cpuset.c
index 6012e326e856..41c2343df975 100644
--- a/kernel/cpuset.c
+++ b/kernel/cpuset.c
@@ -1486,13 +1486,13 @@ static int cpuset_write_resmask(struct cgroup *cgrp, struct cftype *cft,
1486 1486
1487static int cpuset_sprintf_cpulist(char *page, struct cpuset *cs) 1487static int cpuset_sprintf_cpulist(char *page, struct cpuset *cs)
1488{ 1488{
1489 cpumask_t mask; 1489 int ret;
1490 1490
1491 mutex_lock(&callback_mutex); 1491 mutex_lock(&callback_mutex);
1492 mask = cs->cpus_allowed; 1492 ret = cpulist_scnprintf(page, PAGE_SIZE, &cs->cpus_allowed);
1493 mutex_unlock(&callback_mutex); 1493 mutex_unlock(&callback_mutex);
1494 1494
1495 return cpulist_scnprintf(page, PAGE_SIZE, &mask); 1495 return ret;
1496} 1496}
1497 1497
1498static int cpuset_sprintf_memlist(char *page, struct cpuset *cs) 1498static int cpuset_sprintf_memlist(char *page, struct cpuset *cs)