diff options
author | Gautham R Shenoy <ego@in.ibm.com> | 2008-01-25 15:08:02 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-01-25 15:08:02 -0500 |
commit | 86ef5c9a8edd78e6bf92879f32329d89b2d55b5a (patch) | |
tree | 7bf46885326a6fdbb0c3596855408e9a5634dd3a /arch/mips/kernel | |
parent | d221938c049f4845da13c8593132595a6b9222a8 (diff) |
cpu-hotplug: replace lock_cpu_hotplug() with get_online_cpus()
Replace all lock_cpu_hotplug/unlock_cpu_hotplug from the kernel and use
get_online_cpus and put_online_cpus instead as it highlights the
refcount semantics in these operations.
The new API guarantees protection against the cpu-hotplug operation, but
it doesn't guarantee serialized access to any of the local data
structures. Hence the changes needs to be reviewed.
In case of pseries_add_processor/pseries_remove_processor, use
cpu_maps_update_begin()/cpu_maps_update_done() as we're modifying the
cpu_present_map there.
Signed-off-by: Gautham R Shenoy <ego@in.ibm.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/mips/kernel')
-rw-r--r-- | arch/mips/kernel/mips-mt-fpaff.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/arch/mips/kernel/mips-mt-fpaff.c b/arch/mips/kernel/mips-mt-fpaff.c index 892665bb12b1..bb4f00c0cbe9 100644 --- a/arch/mips/kernel/mips-mt-fpaff.c +++ b/arch/mips/kernel/mips-mt-fpaff.c | |||
@@ -58,13 +58,13 @@ asmlinkage long mipsmt_sys_sched_setaffinity(pid_t pid, unsigned int len, | |||
58 | if (copy_from_user(&new_mask, user_mask_ptr, sizeof(new_mask))) | 58 | if (copy_from_user(&new_mask, user_mask_ptr, sizeof(new_mask))) |
59 | return -EFAULT; | 59 | return -EFAULT; |
60 | 60 | ||
61 | lock_cpu_hotplug(); | 61 | get_online_cpus(); |
62 | read_lock(&tasklist_lock); | 62 | read_lock(&tasklist_lock); |
63 | 63 | ||
64 | p = find_process_by_pid(pid); | 64 | p = find_process_by_pid(pid); |
65 | if (!p) { | 65 | if (!p) { |
66 | read_unlock(&tasklist_lock); | 66 | read_unlock(&tasklist_lock); |
67 | unlock_cpu_hotplug(); | 67 | put_online_cpus(); |
68 | return -ESRCH; | 68 | return -ESRCH; |
69 | } | 69 | } |
70 | 70 | ||
@@ -106,7 +106,7 @@ asmlinkage long mipsmt_sys_sched_setaffinity(pid_t pid, unsigned int len, | |||
106 | 106 | ||
107 | out_unlock: | 107 | out_unlock: |
108 | put_task_struct(p); | 108 | put_task_struct(p); |
109 | unlock_cpu_hotplug(); | 109 | put_online_cpus(); |
110 | return retval; | 110 | return retval; |
111 | } | 111 | } |
112 | 112 | ||
@@ -125,7 +125,7 @@ asmlinkage long mipsmt_sys_sched_getaffinity(pid_t pid, unsigned int len, | |||
125 | if (len < real_len) | 125 | if (len < real_len) |
126 | return -EINVAL; | 126 | return -EINVAL; |
127 | 127 | ||
128 | lock_cpu_hotplug(); | 128 | get_online_cpus(); |
129 | read_lock(&tasklist_lock); | 129 | read_lock(&tasklist_lock); |
130 | 130 | ||
131 | retval = -ESRCH; | 131 | retval = -ESRCH; |
@@ -140,7 +140,7 @@ asmlinkage long mipsmt_sys_sched_getaffinity(pid_t pid, unsigned int len, | |||
140 | 140 | ||
141 | out_unlock: | 141 | out_unlock: |
142 | read_unlock(&tasklist_lock); | 142 | read_unlock(&tasklist_lock); |
143 | unlock_cpu_hotplug(); | 143 | put_online_cpus(); |
144 | if (retval) | 144 | if (retval) |
145 | return retval; | 145 | return retval; |
146 | if (copy_to_user(user_mask_ptr, &mask, real_len)) | 146 | if (copy_to_user(user_mask_ptr, &mask, real_len)) |