login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2008
»
June
»
10
Re: [PATCH -rt 4/5] rcu: backport RCU cpu hotplug support
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [thread] [
date
] [
author
]
[view in full thread]
From: Paul E. McKenney
Subject:
Re: [PATCH -rt 4/5] rcu: backport RCU cpu hotplug support
Date: Tuesday, June 10, 2008 - 8:15 am
On Tue, Jun 10, 2008 at 01:13:03PM +0200, Peter Zijlstra wrote:
quoted text
> backport the RCU cpu-hotplug support from .26-rc to .24-rt
Reviewed-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
quoted text
> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> > --- > kernel/rcupreempt.c | 58 +++++++++++++++++++++++++++++++++++++++++++++++++--- > 1 file changed, 55 insertions(+), 3 deletions(-) > > Index: linux-2.6.24.7.noarch/kernel/rcupreempt.c > =================================================================== > --- linux-2.6.24.7.noarch.orig/kernel/rcupreempt.c > +++ linux-2.6.24.7.noarch/kernel/rcupreempt.c > @@ -820,6 +820,13 @@ void rcu_offline_cpu_rt(int cpu) > smp_mb(); /* Subsequent RCU read-side critical sections */ > /* seen -after- acknowledgement. */ > } > + > + __get_cpu_var(rcu_flipctr)[0] += per_cpu(rcu_flipctr, cpu)[0]; > + __get_cpu_var(rcu_flipctr)[1] += per_cpu(rcu_flipctr, cpu)[1]; > + > + per_cpu(rcu_flipctr, cpu)[0] = 0; > + per_cpu(rcu_flipctr, cpu)[1] = 0; > + > cpu_clear(cpu, rcu_cpu_online_map); > spin_unlock_irqrestore(&rcu_ctrlblk.fliplock, oldirq); > > @@ -833,8 +840,9 @@ void rcu_offline_cpu_rt(int cpu) > * fix. > */ > > + local_irq_save(oldirq); > rdp = RCU_DATA_ME(); > - spin_lock_irqsave(&rdp->lock, oldirq); > + spin_lock(&rdp->lock); > *rdp->nexttail = list; > if (list) > rdp->nexttail = tail; > @@ -866,9 +874,11 @@ void rcu_process_callbacks_rt(struct sof > { > unsigned long flags; > struct rcu_head *next, *list; > - struct rcu_data *rdp = RCU_DATA_ME(); > + struct rcu_data *rdp; > > - spin_lock_irqsave(&rdp->lock, flags); > + local_irq_save(flags); > + rdp = RCU_DATA_ME(); > + spin_lock(&rdp->lock); > list = rdp->donelist; > if (list == NULL) { > spin_unlock_irqrestore(&rdp->lock, flags); > @@ -951,6 +961,32 @@ int rcu_pending_rt(int cpu) > return 0; > } > > +static int __cpuinit rcu_cpu_notify(struct notifier_block *self, > + unsigned long action, void *hcpu) > +{ > + long cpu = (long)hcpu; > + > + switch (action) { > + case CPU_UP_PREPARE: > + case CPU_UP_PREPARE_FROZEN: > + rcu_online_cpu_rt(cpu); > + break; > + case CPU_UP_CANCELED: > + case CPU_UP_CANCELED_FROZEN: > + case CPU_DEAD: > + case CPU_DEAD_FROZEN: > + rcu_offline_cpu_rt(cpu); > + break; > + default: > + break; > + } > + return NOTIFY_OK; > +} > + > +static struct notifier_block __cpuinitdata rcu_nb = { > + .notifier_call = rcu_cpu_notify, > +}; > + > void __init rcu_init_rt(void) > { > int cpu; > @@ -972,6 +1008,22 @@ void __init rcu_init_rt(void) > rdp->donetail = &rdp->donelist; > } > rcu_preempt_boost_init(); > + register_cpu_notifier(&rcu_nb); > + > + /* > + * We don't need protection against CPU-Hotplug here > + * since > + * a) If a CPU comes online while we are iterating over the > + * cpu_online_map below, we would only end up making a > + * duplicate call to rcu_online_cpu() which sets the corresponding > + * CPU's mask in the rcu_cpu_online_map. > + * > + * b) A CPU cannot go offline at this point in time since the user > + * does not have access to the sysfs interface, nor do we > + * suspend the system. > + */ > + for_each_online_cpu(cpu) > + rcu_cpu_notify(&rcu_nb, CPU_UP_PREPARE, (void *)(long) cpu); > } > > /* > > -- >
--
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [thread] [
date
] [
author
]
Messages in current thread:
[PATCH -rt 4/5] rcu: backport RCU cpu hotplug support
, Peter Zijlstra
, (Tue Jun 10, 4:13 am)
Re: [PATCH -rt 4/5] rcu: backport RCU cpu hotplug support
, Paul E. McKenney
, (Tue Jun 10, 8:15 am)
Navigation
Create content
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Paul Turner
[tg_shares_up rewrite v4 11/11] sched: update tg->shares after cpu.shares write
Mr. James W. Laferriere
Re: Linux 2.6.25-rc1 , syntax error near unexpected token `;'
Chuck Ebbert
Re: PCI: Unable to reserve mem region problem
Linus Torvalds
Linux 2.6.34-rc4
Mingming Cao
Re: [RFC 1/4] Large Blocksize support for Ext2/3/4
git
:
Ralf Wildenhues
[PATCH] Fix typos in the documentation
Len Brown
Re: fatal: unable to create '.git/index': File exists
Adeodato
Bazaar's patience diff as GIT_EXTERNAL_DIFF
Denis Bueno
Git clone error
Johannes Schindelin
Re: [PATCH 2/4] Add functions get_relative_cwd() and is_inside_dir()
git-commits-head
:
Linux Kernel Mailing List
ASoC: fix registration of the SoC card in the Freescale MPC8610 drivers
Linux Kernel Mailing List
drivers/acpi: use kasprintf
Linux Kernel Mailing List
nfsd41: sanity check client drc maxreqs
Linux Kernel Mailing List
bnx2x: Moving includes
Linux Kernel Mailing List
V4L/DVB: gspca - sonixj: Adjust minor values of sensor ov7630. - set the color ga...
openbsd-misc
:
Sevan / Venture37
Re: This is what Linus Torvalds calls openBSD crowd
Netmaffia.hu
Tini Lányok AKCIÓBAN OTTHON
Sam Fourman Jr.
Re: Help with Altell PC6700
Siju George
This is what Linus Torvalds calls openBSD crowd
Darrin Chandler
Re: OT: Python (was Re: vi in /bin)
linux-netdev
:
Kurt Van Dijck
Re: [PATCH net-next-2.6 1/2] can: add driver for Softing card
Eric Dumazet
Re: [PATCH net-next-2.6] net: Introduce skb_orphan_try()
Jamie Lokier
Re: POHMELFS high performance network filesystem. Transactions, failover, performa...
Jarek Poplawski
Re: socket api problem: can't bind an ipv6 socket to ::ffff:0.0.0.0
David Miller
Re: [PATCH v2] net: typos in comments in include/linux/igmp.h
Colocation donated by:
Syndicate