lkml.org 
[lkml]   [2008]   [Dec]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 1/6] cpuset: remove on stack cpumask_t in cpuset_sprintf_cpulist()
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>
---
kernel/cpuset.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/kernel/cpuset.c b/kernel/cpuset.c
index 6012e32..41c2343 100644
--- a/kernel/cpuset.c
+++ b/kernel/cpuset.c
@@ -1486,13 +1486,13 @@ static int cpuset_write_resmask(struct cgroup *cgrp, struct cftype *cft,

static int cpuset_sprintf_cpulist(char *page, struct cpuset *cs)
{
- cpumask_t mask;
+ int ret;

mutex_lock(&callback_mutex);
- mask = cs->cpus_allowed;
+ ret = cpulist_scnprintf(page, PAGE_SIZE, &cs->cpus_allowed);
mutex_unlock(&callback_mutex);

- return cpulist_scnprintf(page, PAGE_SIZE, &mask);
+ return ret;
}

static int cpuset_sprintf_memlist(char *page, struct cpuset *cs)
--
1.5.4.rc3



\
 
 \ /
  Last update: 2008-12-31 09:39    [W:0.035 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site