diff options
author | Mike Travis <travis@sgi.com> | 2008-04-04 21:11:08 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-04-19 13:44:59 -0400 |
commit | b53e921ba1cff8453dc9a87a84052fa12d5b30bd (patch) | |
tree | 021cadb6c58543ecccd95b55fc319f249ebf176e /kernel/sched.c | |
parent | f9a86fcbbb1e5542eabf45c9144ac4b6330861a4 (diff) |
generic: reduce stack pressure in sched_affinity
* Modify sched_affinity functions to pass cpumask_t variables by reference
instead of by value.
* Use new set_cpus_allowed_ptr function.
Depends on:
[sched-devel]: sched: add new set_cpus_allowed_ptr function
Cc: Paul Jackson <pj@sgi.com>
Cc: Cliff Wickman <cpw@sgi.com>
Signed-off-by: Mike Travis <travis@sgi.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/sched.c')
-rw-r--r-- | kernel/sched.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index ccc23a9cd264..1a8252385c4d 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -4908,9 +4908,10 @@ out_unlock: | |||
4908 | return retval; | 4908 | return retval; |
4909 | } | 4909 | } |
4910 | 4910 | ||
4911 | long sched_setaffinity(pid_t pid, cpumask_t new_mask) | 4911 | long sched_setaffinity(pid_t pid, const cpumask_t *in_mask) |
4912 | { | 4912 | { |
4913 | cpumask_t cpus_allowed; | 4913 | cpumask_t cpus_allowed; |
4914 | cpumask_t new_mask = *in_mask; | ||
4914 | struct task_struct *p; | 4915 | struct task_struct *p; |
4915 | int retval; | 4916 | int retval; |
4916 | 4917 | ||
@@ -4991,7 +4992,7 @@ asmlinkage long sys_sched_setaffinity(pid_t pid, unsigned int len, | |||
4991 | if (retval) | 4992 | if (retval) |
4992 | return retval; | 4993 | return retval; |
4993 | 4994 | ||
4994 | return sched_setaffinity(pid, new_mask); | 4995 | return sched_setaffinity(pid, &new_mask); |
4995 | } | 4996 | } |
4996 | 4997 | ||
4997 | /* | 4998 | /* |