aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerald Schaefer <gerald.schaefer@de.ibm.com>2008-05-30 04:03:28 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2008-05-30 04:03:34 -0400
commit1760537b69123905bf4f4b56f5746ae4547e9694 (patch)
tree9f44fb7c348d9597c2e9e4acb8ee13ac65f37756
parent67060d9c1f5d91c917cc51bed464cb5638eaddbc (diff)
[S390] appldata: prevent cpu hotplug when walking cpu_online_map.
Use get_online_cpus() to prevent cpu hotplug in situations where for_each_online_cpu() is called. Signed-off-by: Gerald Schaefer <gerald.schaefer@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
-rw-r--r--arch/s390/appldata/appldata_base.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/s390/appldata/appldata_base.c b/arch/s390/appldata/appldata_base.c
index 655d52543e2d..ad40729bec3d 100644
--- a/arch/s390/appldata/appldata_base.c
+++ b/arch/s390/appldata/appldata_base.c
@@ -130,6 +130,7 @@ static void appldata_work_fn(struct work_struct *work)
130 130
131 P_DEBUG(" -= Work Queue =-\n"); 131 P_DEBUG(" -= Work Queue =-\n");
132 i = 0; 132 i = 0;
133 get_online_cpus();
133 spin_lock(&appldata_ops_lock); 134 spin_lock(&appldata_ops_lock);
134 list_for_each(lh, &appldata_ops_list) { 135 list_for_each(lh, &appldata_ops_list) {
135 ops = list_entry(lh, struct appldata_ops, list); 136 ops = list_entry(lh, struct appldata_ops, list);
@@ -140,6 +141,7 @@ static void appldata_work_fn(struct work_struct *work)
140 } 141 }
141 } 142 }
142 spin_unlock(&appldata_ops_lock); 143 spin_unlock(&appldata_ops_lock);
144 put_online_cpus();
143} 145}
144 146
145/* 147/*
@@ -266,12 +268,14 @@ appldata_timer_handler(ctl_table *ctl, int write, struct file *filp,
266 len = *lenp; 268 len = *lenp;
267 if (copy_from_user(buf, buffer, len > sizeof(buf) ? sizeof(buf) : len)) 269 if (copy_from_user(buf, buffer, len > sizeof(buf) ? sizeof(buf) : len))
268 return -EFAULT; 270 return -EFAULT;
271 get_online_cpus();
269 spin_lock(&appldata_timer_lock); 272 spin_lock(&appldata_timer_lock);
270 if (buf[0] == '1') 273 if (buf[0] == '1')
271 __appldata_vtimer_setup(APPLDATA_ADD_TIMER); 274 __appldata_vtimer_setup(APPLDATA_ADD_TIMER);
272 else if (buf[0] == '0') 275 else if (buf[0] == '0')
273 __appldata_vtimer_setup(APPLDATA_DEL_TIMER); 276 __appldata_vtimer_setup(APPLDATA_DEL_TIMER);
274 spin_unlock(&appldata_timer_lock); 277 spin_unlock(&appldata_timer_lock);
278 put_online_cpus();
275out: 279out:
276 *lenp = len; 280 *lenp = len;
277 *ppos += len; 281 *ppos += len;
@@ -314,10 +318,12 @@ appldata_interval_handler(ctl_table *ctl, int write, struct file *filp,
314 return -EINVAL; 318 return -EINVAL;
315 } 319 }
316 320
321 get_online_cpus();
317 spin_lock(&appldata_timer_lock); 322 spin_lock(&appldata_timer_lock);
318 appldata_interval = interval; 323 appldata_interval = interval;
319 __appldata_vtimer_setup(APPLDATA_MOD_TIMER); 324 __appldata_vtimer_setup(APPLDATA_MOD_TIMER);
320 spin_unlock(&appldata_timer_lock); 325 spin_unlock(&appldata_timer_lock);
326 put_online_cpus();
321 327
322 P_INFO("Monitoring CPU interval set to %u milliseconds.\n", 328 P_INFO("Monitoring CPU interval set to %u milliseconds.\n",
323 interval); 329 interval);
@@ -556,8 +562,10 @@ static int __init appldata_init(void)
556 return -ENOMEM; 562 return -ENOMEM;
557 } 563 }
558 564
565 get_online_cpus();
559 for_each_online_cpu(i) 566 for_each_online_cpu(i)
560 appldata_online_cpu(i); 567 appldata_online_cpu(i);
568 put_online_cpus();
561 569
562 /* Register cpu hotplug notifier */ 570 /* Register cpu hotplug notifier */
563 register_hotcpu_notifier(&appldata_nb); 571 register_hotcpu_notifier(&appldata_nb);