From: Martin Schwidefsky <schwidefsky@de.ibm.com>
To: linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org
Cc: Gerald Schaefer <gerald.schaefer@de.ibm.com>,
Martin Schwidefsky <schwidefsky@de.ibm.com>
Subject: [patch 05/11] appldata: prevent cpu hotplug when walking cpu_online_map.
Date: Thu, 29 May 2008 14:55:06 +0200 [thread overview]
Message-ID: <20080529125729.367911865@de.ibm.com> (raw)
In-Reply-To: 20080529125501.196123527@de.ibm.com
[-- Attachment #1: 005-appldate-getcpu.diff --]
[-- Type: text/plain, Size: 2135 bytes --]
From: Gerald Schaefer <gerald.schaefer@de.ibm.com>
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>
---
arch/s390/appldata/appldata_base.c | 8 ++++++++
1 file changed, 8 insertions(+)
Index: quilt-2.6/arch/s390/appldata/appldata_base.c
===================================================================
--- quilt-2.6.orig/arch/s390/appldata/appldata_base.c
+++ quilt-2.6/arch/s390/appldata/appldata_base.c
@@ -130,6 +130,7 @@ static void appldata_work_fn(struct work
P_DEBUG(" -= Work Queue =-\n");
i = 0;
+ get_online_cpus();
spin_lock(&appldata_ops_lock);
list_for_each(lh, &appldata_ops_list) {
ops = list_entry(lh, struct appldata_ops, list);
@@ -140,6 +141,7 @@ static void appldata_work_fn(struct work
}
}
spin_unlock(&appldata_ops_lock);
+ put_online_cpus();
}
/*
@@ -266,12 +268,14 @@ appldata_timer_handler(ctl_table *ctl, i
len = *lenp;
if (copy_from_user(buf, buffer, len > sizeof(buf) ? sizeof(buf) : len))
return -EFAULT;
+ get_online_cpus();
spin_lock(&appldata_timer_lock);
if (buf[0] == '1')
__appldata_vtimer_setup(APPLDATA_ADD_TIMER);
else if (buf[0] == '0')
__appldata_vtimer_setup(APPLDATA_DEL_TIMER);
spin_unlock(&appldata_timer_lock);
+ put_online_cpus();
out:
*lenp = len;
*ppos += len;
@@ -314,10 +318,12 @@ appldata_interval_handler(ctl_table *ctl
return -EINVAL;
}
+ get_online_cpus();
spin_lock(&appldata_timer_lock);
appldata_interval = interval;
__appldata_vtimer_setup(APPLDATA_MOD_TIMER);
spin_unlock(&appldata_timer_lock);
+ put_online_cpus();
P_INFO("Monitoring CPU interval set to %u milliseconds.\n",
interval);
@@ -556,8 +562,10 @@ static int __init appldata_init(void)
return -ENOMEM;
}
+ get_online_cpus();
for_each_online_cpu(i)
appldata_online_cpu(i);
+ put_online_cpus();
/* Register cpu hotplug notifier */
register_hotcpu_notifier(&appldata_nb);
--
blue skies,
Martin.
"Reality continues to ruin my life." - Calvin.
next prev parent reply other threads:[~2008-05-29 12:55 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-29 12:55 [patch 00/11] s390 bug fixes for 2.6.26-rc4 Martin Schwidefsky
2008-05-29 12:55 ` [patch 01/11] fix sparsemem related compile error with allnoconfig on s390 Martin Schwidefsky
2008-05-29 12:55 ` [patch 02/11] tape: Fix race condition in tape block device driver Martin Schwidefsky
2008-05-29 12:55 ` [patch 03/11] s390 types: make dma_addr_t 64 bit capable Martin Schwidefsky
2008-05-29 12:55 ` [patch 04/11] Fix section mismatch warnings Martin Schwidefsky
2008-05-29 12:55 ` Martin Schwidefsky [this message]
2008-05-29 12:55 ` [patch 06/11] showmem: Only walk spanned pages Martin Schwidefsky
2008-05-29 17:20 ` Johannes Weiner
2008-05-30 5:50 ` Heiko Carstens
2008-05-30 6:13 ` Johannes Weiner
2008-05-29 12:55 ` [patch 07/11] sclp_vt220: fix scheduling while atomic bug Martin Schwidefsky
2008-05-29 12:55 ` [patch 08/11] dasd: use a generic wait_queue for sleep_on Martin Schwidefsky
2008-05-29 12:55 ` [patch 09/11] 3270: fix race with stack local wait_queue_head_t Martin Schwidefsky
2008-05-29 12:55 ` [patch 10/11] tape: " Martin Schwidefsky
2008-05-29 12:55 ` [patch 11/11] disassembler: fix idte instruction format Martin Schwidefsky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080529125729.367911865@de.ibm.com \
--to=schwidefsky@de.ibm.com \
--cc=gerald.schaefer@de.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox