diff options
author | Davidlohr Bueso <dave@stgolabs.net> | 2020-08-31 22:14:02 +0200 |
---|---|---|
committer | Thomas Bogendoerfer <tsbogend@alpha.franken.de> | 2020-09-03 10:13:43 +0200 |
commit | f0100c7f1aac7f10eb249c494de5016fcf8c0652 (patch) | |
tree | a80d04b4a34826dd7883bb6aba1763218a9df117 /arch/mips | |
parent | MIPS: Add support for ZSTD-compressed kernels (diff) | |
download | linux-f0100c7f1aac7f10eb249c494de5016fcf8c0652.tar.xz linux-f0100c7f1aac7f10eb249c494de5016fcf8c0652.zip |
MIPS: Use rcu to lookup a task in mipsmt_sys_sched_setaffinity()
The call simply looks up the corresponding task (without iterating
the tasklist), which is safe under rcu instead of the tasklist_lock.
In addition, the setaffinity counter part already does this.
Signed-off-by: Davidlohr Bueso <dbueso@suse.de>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Diffstat (limited to 'arch/mips')
-rw-r--r-- | arch/mips/kernel/mips-mt-fpaff.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/mips/kernel/mips-mt-fpaff.c b/arch/mips/kernel/mips-mt-fpaff.c index 1a08428eedcf..6c590ef27648 100644 --- a/arch/mips/kernel/mips-mt-fpaff.c +++ b/arch/mips/kernel/mips-mt-fpaff.c @@ -167,7 +167,7 @@ asmlinkage long mipsmt_sys_sched_getaffinity(pid_t pid, unsigned int len, return -EINVAL; get_online_cpus(); - read_lock(&tasklist_lock); + rcu_read_lock(); retval = -ESRCH; p = find_process_by_pid(pid); @@ -181,7 +181,7 @@ asmlinkage long mipsmt_sys_sched_getaffinity(pid_t pid, unsigned int len, cpumask_and(&mask, &allowed, cpu_active_mask); out_unlock: - read_unlock(&tasklist_lock); + rcu_read_unlock(); put_online_cpus(); if (retval) return retval; |