login
Login
/
Register
Search
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2008
»
August
»
22
Re: [PATCH, RFC, tip/core/rcu] scalable classic RCU implementation
view
thread
!MAILaRCHIVE_VOTE_RePLACE
Previous message: [
thread
] [
date
] [
author
]
Next message: [thread] [
date
] [
author
]
[view in full thread]
From:
Josh Triplett <josht@...>
To: <paulmck@...>
Cc: Ingo Molnar <mingo@...>, <linux-kernel@...>, <cl@...>, <akpm@...>, <manfred@...>, <dipankar@...>, <schamp@...>, <niv@...>, <dvhltc@...>, <ego@...>, <laijs@...>, <rostedt@...>
Subject:
Re: [PATCH, RFC, tip/core/rcu] scalable classic RCU implementation
Date: Friday, August 22, 2008 - 2:16 pm
On Fri, 2008-08-22 at 10:22 -0700, Paul E. McKenney wrote:
quoted text
> On Fri, Aug 22, 2008 at 06:47:20AM -0700, Paul E. McKenney wrote: > > On Fri, Aug 22, 2008 at 06:37:15AM +0200, Ingo Molnar wrote: > > > > > > * Paul E. McKenney <paulmck@linux.vnet.ibm.com> wrote: > > > > > > > +#define MAX_RCU_LEVELS 3 > > > > +#if NR_CPUS <= CONFIG_RCU_FANOUT > > > > +#define NUM_RCU_LEVELS 1 > > > > +#define NUM_RCU_LEVEL_1 1 > > > > +#define NUM_RCU_LEVEL_2 NR_CPUS > > > > +#define NUM_RCU_LEVEL_3 0 > > > > +#define NUM_RCU_LEVEL_4 0 > > > > +#define NUM_RCU_NODES NUM_RCU_LEVEL_1 > > > > +#elif NR_CPUS <= CONFIG_RCU_FANOUT * CONFIG_RCU_FANOUT > > > > +#define NUM_RCU_LEVELS 2 > > > > +#define NUM_RCU_LEVEL_1 1 > > > > +#define NUM_RCU_LEVEL_2 \ > > > > + (((NR_CPUS) + (CONFIG_RCU_FANOUT) - 1) / (CONFIG_RCU_FANOUT)) > > > > +#define NUM_RCU_LEVEL_3 NR_CPUS > > > > +#define NUM_RCU_LEVEL_4 0 > > > > +#define NUM_RCU_NODES \ > > > > + ((NUM_RCU_LEVEL_1) + (NUM_RCU_LEVEL_2)) > > > > +#elif NR_CPUS <= CONFIG_RCU_FANOUT * CONFIG_RCU_FANOUT * CONFIG_RCU_FANOUT > > > > +#define NUM_RCU_LEVELS 3 > > > > +#define RCU_FANOUT_SQ ((CONFIG_RCU_FANOUT) * (CONFIG_RCU_FANOUT)) > > > > +#define NUM_RCU_LEVEL_1 1 > > > > +#define NUM_RCU_LEVEL_2 \ > > > > + (((NR_CPUS) + (RCU_FANOUT_SQ) - 1) / (RCU_FANOUT_SQ)) > > > > +#define NUM_RCU_LEVEL_3 \ > > > > + ((NR_CPUS) + (CONFIG_RCU_FANOUT) - 1) / (CONFIG_RCU_FANOUT) > > > > +#define NUM_RCU_LEVEL_4 NR_CPUS > > > > +#define NUM_RCU_NODES \ > > > > + ((NUM_RCU_LEVEL_1) + \ > > > > + (NUM_RCU_LEVEL_2) + \ > > > > + (NUM_RCU_LEVEL_3)) > > > > +#else > > > > +#error "CONFIG_RCU_FANOUT insufficient for NR_CPUS" > > > > +#endif > > > > > > just a quick stylistic suggestion: if feasible then such sizing ugliness > > > should be hidden in a Kconfig file. (if Kconfig is capable enough for > > > this that is) > > > > I have no idea if Kconfig can do it, but I will check. > > OK, Kconfig does not currently support arithmetic, based on zconf.y: > > expr: symbol { $$ = expr_alloc_symbol(); } > | symbol T_EQUAL symbol { $$ = expr_alloc_comp(E_EQUAL, , ); } > | symbol T_UNEQUAL symbol { $$ = expr_alloc_comp(E_UNEQUAL, , ); } > | T_OPEN_PAREN expr T_CLOSE_PAREN { $$ = ; } > | T_NOT expr { $$ = expr_alloc_one(E_NOT, ); } > | expr T_OR expr { $$ = expr_alloc_two(E_OR, , ); } > | expr T_AND expr { $$ = expr_alloc_two(E_AND, , ); } > ; > > All we currently get is basic comparison and logical operators. It would > not be all -that- hard to add general arithmetic (famous last words), > but when I tried mapping out what the sizing code would look like in > such an augmented Kconfig, it was even uglier than the above.
Makes sense.
quoted text
> So I took a hard look at the current mess, and prettied it as shown below. > Is this a sufficient improvement?
Looks significantly improved.
quoted text
> Another alternative I am considering is moving this to a separate > include file.
I personally don't think that would help. The revised version seems fine.
quoted text
> #define MAX_RCU_LEVELS 3 > #define RCU_FANOUT (CONFIG_RCU_FANOUT) > #define RCU_FANOUT_SQ (RCU_FANOUT * RCU_FANOUT) > #define RCU_FANOUT_CUBE (RCU_FANOUT_SQ * RCU_FANOUT) > > #if (NR_CPUS) <= RCU_FANOUT > # define NUM_RCU_LVLS 1 > # define NUM_RCU_LVL_0 1 > # define NUM_RCU_LVL_1 (NR_CPUS) > # define NUM_RCU_LVL_2 0 > # define NUM_RCU_LVL_3 0 > #elif (NR_CPUS) <= RCU_FANOUT_SQ > # define NUM_RCU_LVLS 2 > # define NUM_RCU_LVL_0 1 > # define NUM_RCU_LVL_1 (((NR_CPUS) + RCU_FANOUT - 1) / RCU_FANOUT) > # define NUM_RCU_LVL_2 (NR_CPUS) > # define NUM_RCU_LVL_3 0 > #elif (NR_CPUS) <= RCU_FANOUT_CUBE > # define NUM_RCU_LVLS 3 > # define NUM_RCU_LVL_0 1 > # define NUM_RCU_LVL_1 (((NR_CPUS) + RCU_FANOUT_SQ - 1) / RCU_FANOUT_SQ) > # define NUM_RCU_LVL_2 (((NR_CPUS) + (RCU_FANOUT) - 1) / (RCU_FANOUT)) > # define NUM_RCU_LVL_3 NR_CPUS > #else > # error "CONFIG_RCU_FANOUT insufficient for NR_CPUS" > #endif /* #if (NR_CPUS) <= RCU_FANOUT */ > > #define RCU_SUM (NUM_RCU_LVL_0 + NUM_RCU_LVL_1 + NUM_RCU_LVL_2 + NUM_RCU_LVL_3) > #define NUM_RCU_NODES (RCU_SUM - NR_CPUS)
- Josh Triplett --
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, RFC, tip/core/rcu] scalable classic RCU implementation
, Paul E. McKenney
, (Thu Aug 21, 7:43 pm)
[PATCH, RFC, tip/core/rcu] v2 scalable classic RCU implement...
, Paul E. McKenney
, (Sun Aug 24, 8:07 pm)
[PATCH, RFC, tip/core/rcu] v3 scalable classic RCU implement...
, Paul E. McKenney
, (Fri Aug 29, 8:49 pm)
[PATCH, RFC] v4 scalable classic RCU implementation
, Paul E. McKenney
, (Fri Sep 5, 11:29 am)
Re: [PATCH, RFC] v4 scalable classic RCU implementation
, Paul E. McKenney
, (Mon Sep 15, 12:02 pm)
[PATCH, RFC] v6 scalable classic RCU implementation
, Paul E. McKenney
, (Tue Sep 23, 7:53 pm)
[PATCH, RFC] v7 scalable classic RCU implementation
, Paul E. McKenney
, (Fri Oct 10, 12:09 pm)
[PATCH, RFC] v8 scalable classic RCU implementation
, Paul E. McKenney
, (Sat Nov 15, 7:20 pm)
Re: [PATCH, RFC] v7 scalable classic RCU implementation
, Manfred Spraul
, (Sun Nov 2, 4:10 pm)
Re: [PATCH, RFC] v7 scalable classic RCU implementation
, Paul E. McKenney
, (Mon Nov 3, 4:33 pm)
Re: [PATCH, RFC] v7 scalable classic RCU implementation
, Manfred Spraul
, (Wed Nov 5, 3:48 pm)
Re: [PATCH, RFC] v7 scalable classic RCU implementation
, Paul E. McKenney
, (Wed Nov 5, 5:27 pm)
Re: [PATCH, RFC] v7 scalable classic RCU implementation
, Gautham R Shenoy
, (Fri Oct 17, 4:34 am)
Re: [PATCH, RFC] v7 scalable classic RCU implementation
, Paul E. McKenney
, (Fri Oct 17, 11:43 am)
Re: [PATCH, RFC] v7 scalable classic RCU implementation
, Gautham R Shenoy
, (Fri Oct 17, 11:35 am)
Re: [PATCH, RFC] v7 scalable classic RCU implementation
, Paul E. McKenney
, (Fri Oct 17, 11:46 am)
Re: [PATCH, RFC] v7 scalable classic RCU implementation
, Manfred Spraul
, (Sun Oct 12, 11:52 am)
Re: [PATCH, RFC] v7 scalable classic RCU implementation
, Paul E. McKenney
, (Sun Oct 12, 6:46 pm)
Re: [PATCH, RFC] v7 scalable classic RCU implementation
, Manfred Spraul
, (Mon Oct 13, 2:03 pm)
Re: [PATCH, RFC] v7 scalable classic RCU implementation
, Paul E. McKenney
, (Tue Oct 14, 9:11 pm)
Re: [PATCH, RFC] v7 scalable classic RCU implementation
, Manfred Spraul
, (Wed Oct 15, 4:13 am)
Re: [PATCH, RFC] v7 scalable classic RCU implementation
, Paul E. McKenney
, (Wed Oct 15, 11:26 am)
Re: [PATCH, RFC] v7 scalable classic RCU implementation
, Manfred Spraul
, (Wed Oct 22, 2:41 pm)
Re: [PATCH, RFC] v7 scalable classic RCU implementation
, Paul E. McKenney
, (Wed Oct 22, 5:02 pm)
Re: [PATCH, RFC] v7 scalable classic RCU implementation
, Manfred Spraul
, (Wed Oct 22, 5:24 pm)
Re: [PATCH, RFC] v7 scalable classic RCU implementation
, Paul E. McKenney
, (Mon Oct 27, 12:45 pm)
Re: [PATCH, RFC] v7 scalable classic RCU implementation
, Manfred Spraul
, (Mon Oct 27, 3:48 pm)
Re: [PATCH, RFC] v7 scalable classic RCU implementation
, Paul E. McKenney
, (Mon Oct 27, 7:52 pm)
Re: [PATCH, RFC] v7 scalable classic RCU implementation
, Manfred Spraul
, (Tue Oct 28, 1:30 am)
Re: [PATCH, RFC] v7 scalable classic RCU implementation
, Paul E. McKenney
, (Tue Oct 28, 11:17 am)
Re: [PATCH, RFC] v7 scalable classic RCU implementation
, Manfred Spraul
, (Tue Oct 28, 1:21 pm)
Re: [PATCH, RFC] v7 scalable classic RCU implementation
, Paul E. McKenney
, (Tue Oct 28, 1:35 pm)
Re: [PATCH, RFC] v6 scalable classic RCU implementation
, Ingo Molnar
, (Thu Sep 25, 3:29 am)
Re: [PATCH, RFC] v6 scalable classic RCU implementation
, Paul E. McKenney
, (Thu Sep 25, 10:18 am)
Re: [PATCH, RFC] v6 scalable classic RCU implementation
, Ingo Molnar
, (Thu Sep 25, 3:26 am)
Re: [PATCH, RFC] v6 scalable classic RCU implementation
, Paul E. McKenney
, (Thu Sep 25, 10:05 am)
Re: [PATCH, RFC] v4 scalable classic RCU implementation
, Manfred Spraul
, (Tue Sep 16, 12:52 pm)
Re: [PATCH, RFC] v4 scalable classic RCU implementation
, Paul E. McKenney
, (Tue Sep 16, 1:30 pm)
Re: [PATCH, RFC] v4 scalable classic RCU implementation
, Manfred Spraul
, (Tue Sep 16, 1:48 pm)
Re: [PATCH, RFC] v4 scalable classic RCU implementation
, Manfred Spraul
, (Sun Sep 21, 7:09 am)
Re: [PATCH, RFC] v4 scalable classic RCU implementation
, Paul E. McKenney
, (Sun Sep 21, 5:14 pm)
Re: [PATCH, RFC] v4 scalable classic RCU implementation
, Paul E. McKenney
, (Tue Sep 16, 2:22 pm)
[RFC, PATCH] Add a CPU_STARTING notifier (was: Re: [PATCH, R...
, Manfred Spraul
, (Sun Sep 7, 6:18 am)
Re: [RFC, PATCH] Add a CPU_STARTING notifier (was: Re: [PATC...
, Paul E. McKenney
, (Sun Sep 7, 3:46 pm)
Re: [RFC, PATCH] Add a CPU_STARTING notifier (was: Re: [PATC...
, Andi Kleen
, (Sun Sep 7, 7:07 am)
Re: [PATCH, RFC] v4 scalable classic RCU implementation
, Manfred Spraul
, (Sat Sep 6, 12:37 pm)
Re: [PATCH, RFC] v4 scalable classic RCU implementation
, Paul E. McKenney
, (Sun Sep 7, 1:25 pm)
Re: [PATCH, RFC] v4 scalable classic RCU implementation
, Andrew Morton
, (Fri Sep 5, 3:33 pm)
Re: [PATCH, RFC] v4 scalable classic RCU implementation
, Paul E. McKenney
, (Fri Sep 5, 7:04 pm)
Re: [PATCH, RFC] v4 scalable classic RCU implementation
, Andrew Morton
, (Fri Sep 5, 7:52 pm)
Re: [PATCH, RFC] v4 scalable classic RCU implementation
, Paul E. McKenney
, (Sat Sep 6, 12:16 am)
Re: [PATCH, RFC, tip/core/rcu] v3 scalable classic RCU imple...
, Andi Kleen
, (Mon Sep 1, 5:38 am)
Re: [PATCH, RFC, tip/core/rcu] v3 scalable classic RCU imple...
, Paul E. McKenney
, (Mon Sep 1, 9:05 pm)
Re: [PATCH, RFC, tip/core/rcu] v3 scalable classic RCU imple...
, Andi Kleen
, (Tue Sep 2, 2:18 am)
Re: [PATCH, RFC, tip/core/rcu] v3 scalable classic RCU imple...
, Lai Jiangshan
, (Sat Aug 30, 5:58 am)
Re: [PATCH, RFC, tip/core/rcu] v3 scalable classic RCU imple...
, Paul E. McKenney
, (Sat Aug 30, 10:29 am)
Re: [PATCH, RFC, tip/core/rcu] v3 scalable classic RCU imple...
, Manfred Spraul
, (Sat Aug 30, 9:32 am)
Re: [PATCH, RFC, tip/core/rcu] v3 scalable classic RCU imple...
, Paul E. McKenney
, (Sat Aug 30, 10:34 am)
Re: [PATCH, RFC, tip/core/rcu] v3 scalable classic RCU imple...
, Manfred Spraul
, (Sun Aug 31, 6:58 am)
Re: [PATCH, RFC, tip/core/rcu] v3 scalable classic RCU imple...
, Paul E. McKenney
, (Sun Aug 31, 1:20 pm)
Re: [PATCH, RFC, tip/core/rcu] v3 scalable classic RCU imple...
, Manfred Spraul
, (Sun Aug 31, 1:45 pm)
Re: [PATCH, RFC, tip/core/rcu] v3 scalable classic RCU imple...
, Paul E. McKenney
, (Sun Aug 31, 1:55 pm)
Re: [PATCH, RFC, tip/core/rcu] v3 scalable classic RCU imple...
, Manfred Spraul
, (Sun Aug 31, 2:18 pm)
Re: [PATCH, RFC, tip/core/rcu] v3 scalable classic RCU imple...
, Paul E. McKenney
, (Sun Aug 31, 3:23 pm)
Re: [PATCH, RFC, tip/core/rcu] v3 scalable classic RCU imple...
, Peter Zijlstra
, (Sat Aug 30, 5:33 am)
Re: [PATCH, RFC, tip/core/rcu] v3 scalable classic RCU imple...
, Paul E. McKenney
, (Sat Aug 30, 10:10 am)
Re: [PATCH, RFC, tip/core/rcu] v3 scalable classic RCU imple...
, Peter Zijlstra
, (Sat Aug 30, 11:40 am)
Re: [PATCH, RFC, tip/core/rcu] v3 scalable classic RCU imple...
, Mathieu Desnoyers
, (Tue Sep 2, 9:26 am)
Re: [PATCH, RFC, tip/core/rcu] v3 scalable classic RCU imple...
, Peter Zijlstra
, (Tue Sep 2, 9:41 am)
Re: [PATCH, RFC, tip/core/rcu] v3 scalable classic RCU imple...
, Paul E. McKenney
, (Tue Sep 2, 10:55 am)
Re: [PATCH, RFC, tip/core/rcu] v3 scalable classic RCU imple...
, Paul E. McKenney
, (Sat Aug 30, 3:38 pm)
Re: [PATCH, RFC, tip/core/rcu] scalable classic RCU implemen...
, Manfred Spraul
, (Sun Aug 24, 4:08 am)
Re: [PATCH, RFC, tip/core/rcu] scalable classic RCU implemen...
, Paul E. McKenney
, (Sun Aug 24, 12:32 pm)
Re: [PATCH, RFC, tip/core/rcu] scalable classic RCU implemen...
, Manfred Spraul
, (Sun Aug 24, 2:25 pm)
Re: [PATCH, RFC, tip/core/rcu] scalable classic RCU implemen...
, Paul E. McKenney
, (Sun Aug 24, 5:19 pm)
Re: [PATCH, RFC, tip/core/rcu] scalable classic RCU implemen...
, Josh Triplett
, (Fri Aug 22, 7:29 pm)
Re: [PATCH, RFC, tip/core/rcu] scalable classic RCU implemen...
, Peter Zijlstra
, (Mon Aug 25, 6:34 am)
Re: [PATCH, RFC, tip/core/rcu] scalable classic RCU implemen...
, Paul E. McKenney
, (Mon Aug 25, 11:16 am)
Re: [PATCH, RFC, tip/core/rcu] scalable classic RCU implemen...
, Peter Zijlstra
, (Mon Aug 25, 11:26 am)
Re: [PATCH, RFC, tip/core/rcu] scalable classic RCU implemen...
, Paul E. McKenney
, (Wed Aug 27, 2:28 pm)
Re: [PATCH, RFC, tip/core/rcu] scalable classic RCU implemen...
, Paul E. McKenney
, (Fri Aug 22, 9:53 pm)
Re: [PATCH, RFC, tip/core/rcu] scalable classic RCU implemen...
, Josh Triplett
, (Mon Aug 25, 6:02 pm)
Re: [PATCH, RFC, tip/core/rcu] scalable classic RCU implemen...
, Paul E. McKenney
, (Tue Aug 26, 12:05 pm)
Re: [PATCH, RFC, tip/core/rcu] scalable classic RCU implemen...
, Josh Triplett
, (Tue Aug 26, 8:38 pm)
Re: [PATCH, RFC, tip/core/rcu] scalable classic RCU implemen...
, Paul E. McKenney
, (Wed Aug 27, 2:34 pm)
Re: [PATCH, RFC, tip/core/rcu] scalable classic RCU implemen...
, Josh Triplett
, (Wed Aug 27, 4:23 pm)
Re: [PATCH, RFC, tip/core/rcu] scalable classic RCU implemen...
, Paul E. McKenney
, (Wed Aug 27, 4:41 pm)
Re: [PATCH, RFC, tip/core/rcu] scalable classic RCU implemen...
, Ingo Molnar
, (Fri Aug 22, 12:37 am)
Re: [PATCH, RFC, tip/core/rcu] scalable classic RCU implemen...
, Paul E. McKenney
, (Fri Aug 22, 9:47 am)
Re: [PATCH, RFC, tip/core/rcu] scalable classic RCU implemen...
, Paul E. McKenney
, (Fri Aug 22, 1:22 pm)
Re: [PATCH, RFC, tip/core/rcu] scalable classic RCU implemen...
, Ingo Molnar
, (Sat Aug 23, 12:07 pm)
Re: [PATCH, RFC, tip/core/rcu] scalable classic RCU implemen...
, Paul E. McKenney
, (Sat Aug 23, 10:44 pm)
Re: [PATCH, RFC, tip/core/rcu] scalable classic RCU implemen...
, Josh Triplett
, (Fri Aug 22, 2:16 pm)
Navigation
Create content
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Greg Kroah-Hartman
[PATCH 004/196] Chinese: add translation of SubmittingPatches
Jeff Garzik
Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3
Paul E. McKenney
[PATCH RFC 3/9] RCU: Preemptible RCU
James Bottomley
Re: Integration of SCST in the mainstream Linux kernel
git
:
linux-netdev
:
Gerrit Renker
[PATCH 13/37] dccp: Deprecate Ack Ratio sysctl
Patrick McHardy
Re: [GIT]: Networking
Jarek Poplawski
Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock().
openbsd-misc
:
Colocation donated by:
Who's online
There are currently
1 user
and
844 guests
online.
Online users
strcmp
Syndicate