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>
This commit is contained in:
@@ -4908,9 +4908,10 @@ out_unlock:
|
||||
return retval;
|
||||
}
|
||||
|
||||
long sched_setaffinity(pid_t pid, cpumask_t new_mask)
|
||||
long sched_setaffinity(pid_t pid, const cpumask_t *in_mask)
|
||||
{
|
||||
cpumask_t cpus_allowed;
|
||||
cpumask_t new_mask = *in_mask;
|
||||
struct task_struct *p;
|
||||
int retval;
|
||||
|
||||
@@ -4991,7 +4992,7 @@ asmlinkage long sys_sched_setaffinity(pid_t pid, unsigned int len,
|
||||
if (retval)
|
||||
return retval;
|
||||
|
||||
return sched_setaffinity(pid, new_mask);
|
||||
return sched_setaffinity(pid, &new_mask);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user