login
Login
/
Register
Search
Search this site:
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
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From: Josh Triplett
Subject:
Re: [PATCH, RFC, tip/core/rcu] scalable classic RCU implementation
Date: Friday, August 22, 2008 - 11:16 am
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, 4:43 pm)
Re: [PATCH, RFC, tip/core/rcu] scalable classic RCU implem ...
, Ingo Molnar
, (Thu Aug 21, 9:37 pm)
Re: [PATCH, RFC, tip/core/rcu] scalable classic RCU implem ...
, Paul E. McKenney
, (Fri Aug 22, 6:47 am)
Re: [PATCH, RFC, tip/core/rcu] scalable classic RCU implem ...
, Paul E. McKenney
, (Fri Aug 22, 10:22 am)
Re: [PATCH, RFC, tip/core/rcu] scalable classic RCU implem ...
, Josh Triplett
, (Fri Aug 22, 11:16 am)
Re: [PATCH, RFC, tip/core/rcu] scalable classic RCU implem ...
, Josh Triplett
, (Fri Aug 22, 4:29 pm)
Re: [PATCH, RFC, tip/core/rcu] scalable classic RCU implem ...
, Paul E. McKenney
, (Fri Aug 22, 6:53 pm)
Re: [PATCH, RFC, tip/core/rcu] scalable classic RCU implem ...
, Ingo Molnar
, (Sat Aug 23, 9:07 am)
Re: [PATCH, RFC, tip/core/rcu] scalable classic RCU implem ...
, Paul E. McKenney
, (Sat Aug 23, 7:44 pm)
Re: [PATCH, RFC, tip/core/rcu] scalable classic RCU implem ...
, Manfred Spraul
, (Sun Aug 24, 1:08 am)
Re: [PATCH, RFC, tip/core/rcu] scalable classic RCU implem ...
, Paul E. McKenney
, (Sun Aug 24, 9:32 am)
Re: [PATCH, RFC, tip/core/rcu] scalable classic RCU implem ...
, Manfred Spraul
, (Sun Aug 24, 11:25 am)
Re: [PATCH, RFC, tip/core/rcu] scalable classic RCU implem ...
, Paul E. McKenney
, (Sun Aug 24, 2:19 pm)
[PATCH, RFC, tip/core/rcu] v2 scalable classic RCU impleme ...
, Paul E. McKenney
, (Sun Aug 24, 5:07 pm)
Re: [PATCH, RFC, tip/core/rcu] scalable classic RCU implem ...
, Peter Zijlstra
, (Mon Aug 25, 3:34 am)
Re: [PATCH, RFC, tip/core/rcu] scalable classic RCU implem ...
, Paul E. McKenney
, (Mon Aug 25, 8:16 am)
Re: [PATCH, RFC, tip/core/rcu] scalable classic RCU implem ...
, Peter Zijlstra
, (Mon Aug 25, 8:26 am)
Re: [PATCH, RFC, tip/core/rcu] scalable classic RCU implem ...
, Josh Triplett
, (Mon Aug 25, 3:02 pm)
Re: [PATCH, RFC, tip/core/rcu] scalable classic RCU implem ...
, Paul E. McKenney
, (Tue Aug 26, 9:05 am)
Re: [PATCH, RFC, tip/core/rcu] scalable classic RCU implem ...
, Josh Triplett
, (Tue Aug 26, 5:38 pm)
Re: [PATCH, RFC, tip/core/rcu] scalable classic RCU implem ...
, Paul E. McKenney
, (Wed Aug 27, 11:28 am)
Re: [PATCH, RFC, tip/core/rcu] scalable classic RCU implem ...
, Paul E. McKenney
, (Wed Aug 27, 11:34 am)
Re: [PATCH, RFC, tip/core/rcu] scalable classic RCU implem ...
, Josh Triplett
, (Wed Aug 27, 1:23 pm)
Re: [PATCH, RFC, tip/core/rcu] scalable classic RCU implem ...
, Paul E. McKenney
, (Wed Aug 27, 1:41 pm)
[PATCH, RFC, tip/core/rcu] v3 scalable classic RCU impleme ...
, Paul E. McKenney
, (Fri Aug 29, 5:49 pm)
Re: [PATCH, RFC, tip/core/rcu] v3 scalable classic RCU imp ...
, Peter Zijlstra
, (Sat Aug 30, 2:33 am)
Re: [PATCH, RFC, tip/core/rcu] v3 scalable classic RCU imp ...
, Lai Jiangshan
, (Sat Aug 30, 2:58 am)
Re: [PATCH, RFC, tip/core/rcu] v3 scalable classic RCU imp ...
, Manfred Spraul
, (Sat Aug 30, 6:32 am)
Re: [PATCH, RFC, tip/core/rcu] v3 scalable classic RCU imp ...
, Paul E. McKenney
, (Sat Aug 30, 7:10 am)
Re: [PATCH, RFC, tip/core/rcu] v3 scalable classic RCU imp ...
, Paul E. McKenney
, (Sat Aug 30, 7:29 am)
Re: [PATCH, RFC, tip/core/rcu] v3 scalable classic RCU imp ...
, Paul E. McKenney
, (Sat Aug 30, 7:34 am)
Re: [PATCH, RFC, tip/core/rcu] v3 scalable classic RCU imp ...
, Peter Zijlstra
, (Sat Aug 30, 8:40 am)
Re: [PATCH, RFC, tip/core/rcu] v3 scalable classic RCU imp ...
, Paul E. McKenney
, (Sat Aug 30, 12:38 pm)
Re: [PATCH, RFC, tip/core/rcu] v3 scalable classic RCU imp ...
, Manfred Spraul
, (Sun Aug 31, 3:58 am)
Re: [PATCH, RFC, tip/core/rcu] v3 scalable classic RCU imp ...
, Paul E. McKenney
, (Sun Aug 31, 10:20 am)
Re: [PATCH, RFC, tip/core/rcu] v3 scalable classic RCU imp ...
, Manfred Spraul
, (Sun Aug 31, 10:45 am)
Re: [PATCH, RFC, tip/core/rcu] v3 scalable classic RCU imp ...
, Paul E. McKenney
, (Sun Aug 31, 10:55 am)
Re: [PATCH, RFC, tip/core/rcu] v3 scalable classic RCU imp ...
, Manfred Spraul
, (Sun Aug 31, 11:18 am)
Re: [PATCH, RFC, tip/core/rcu] v3 scalable classic RCU imp ...
, Paul E. McKenney
, (Sun Aug 31, 12:23 pm)
Re: [PATCH, RFC, tip/core/rcu] v3 scalable classic RCU imp ...
, Andi Kleen
, (Mon Sep 1, 2:38 am)
Re: [PATCH, RFC, tip/core/rcu] v3 scalable classic RCU imp ...
, Paul E. McKenney
, (Mon Sep 1, 6:05 pm)
Re: [PATCH, RFC, tip/core/rcu] v3 scalable classic RCU imp ...
, Andi Kleen
, (Mon Sep 1, 11:18 pm)
Re: [PATCH, RFC, tip/core/rcu] v3 scalable classic RCU imp ...
, Mathieu Desnoyers
, (Tue Sep 2, 6:26 am)
Re: [PATCH, RFC, tip/core/rcu] v3 scalable classic RCU imp ...
, Peter Zijlstra
, (Tue Sep 2, 6:41 am)
Re: [PATCH, RFC, tip/core/rcu] v3 scalable classic RCU imp ...
, Paul E. McKenney
, (Tue Sep 2, 7:55 am)
[PATCH, RFC] v4 scalable classic RCU implementation
, Paul E. McKenney
, (Fri Sep 5, 8:29 am)
Re: [PATCH, RFC] v4 scalable classic RCU implementation
, Andrew Morton
, (Fri Sep 5, 12:33 pm)
Re: [PATCH, RFC] v4 scalable classic RCU implementation
, Paul E. McKenney
, (Fri Sep 5, 4:04 pm)
Re: [PATCH, RFC] v4 scalable classic RCU implementation
, Andrew Morton
, (Fri Sep 5, 4:52 pm)
Re: [PATCH, RFC] v4 scalable classic RCU implementation
, Paul E. McKenney
, (Fri Sep 5, 9:16 pm)
Re: [PATCH, RFC] v4 scalable classic RCU implementation
, Manfred Spraul
, (Sat Sep 6, 9:37 am)
[RFC, PATCH] Add a CPU_STARTING notifier (was: Re: [PATCH, ...
, Manfred Spraul
, (Sun Sep 7, 3:18 am)
Re: [RFC, PATCH] Add a CPU_STARTING notifier (was: Re: [PA ...
, Andi Kleen
, (Sun Sep 7, 4:07 am)
Re: [PATCH, RFC] v4 scalable classic RCU implementation
, Paul E. McKenney
, (Sun Sep 7, 10:25 am)
Re: [RFC, PATCH] Add a CPU_STARTING notifier (was: Re: [PA ...
, Paul E. McKenney
, (Sun Sep 7, 12:46 pm)
Re: [PATCH, RFC] v4 scalable classic RCU implementation
, Paul E. McKenney
, (Mon Sep 15, 9:02 am)
Re: [PATCH, RFC] v4 scalable classic RCU implementation
, Manfred Spraul
, (Tue Sep 16, 9:52 am)
Re: [PATCH, RFC] v4 scalable classic RCU implementation
, Paul E. McKenney
, (Tue Sep 16, 10:30 am)
Re: [PATCH, RFC] v4 scalable classic RCU implementation
, Manfred Spraul
, (Tue Sep 16, 10:48 am)
Re: [PATCH, RFC] v4 scalable classic RCU implementation
, Paul E. McKenney
, (Tue Sep 16, 11:22 am)
Re: [PATCH, RFC] v4 scalable classic RCU implementation
, Manfred Spraul
, (Sun Sep 21, 4:09 am)
Re: [PATCH, RFC] v4 scalable classic RCU implementation
, Paul E. McKenney
, (Sun Sep 21, 2:14 pm)
[PATCH, RFC] v6 scalable classic RCU implementation
, Paul E. McKenney
, (Tue Sep 23, 4:53 pm)
Re: [PATCH, RFC] v6 scalable classic RCU implementation
, Ingo Molnar
, (Thu Sep 25, 12:26 am)
Re: [PATCH, RFC] v6 scalable classic RCU implementation
, Ingo Molnar
, (Thu Sep 25, 12:29 am)
Re: [PATCH, RFC] v6 scalable classic RCU implementation
, Paul E. McKenney
, (Thu Sep 25, 7:05 am)
Re: [PATCH, RFC] v6 scalable classic RCU implementation
, Paul E. McKenney
, (Thu Sep 25, 7:18 am)
[PATCH, RFC] v7 scalable classic RCU implementation
, Paul E. McKenney
, (Fri Oct 10, 9:09 am)
Re: [PATCH, RFC] v7 scalable classic RCU implementation
, Manfred Spraul
, (Sun Oct 12, 8:52 am)
Re: [PATCH, RFC] v7 scalable classic RCU implementation
, Paul E. McKenney
, (Sun Oct 12, 3:46 pm)
Re: [PATCH, RFC] v7 scalable classic RCU implementation
, Manfred Spraul
, (Mon Oct 13, 11:03 am)
Re: [PATCH, RFC] v7 scalable classic RCU implementation
, Paul E. McKenney
, (Tue Oct 14, 6:11 pm)
Re: [PATCH, RFC] v7 scalable classic RCU implementation
, Manfred Spraul
, (Wed Oct 15, 1:13 am)
Re: [PATCH, RFC] v7 scalable classic RCU implementation
, Paul E. McKenney
, (Wed Oct 15, 8:26 am)
Re: [PATCH, RFC] v7 scalable classic RCU implementation
, Gautham R Shenoy
, (Fri Oct 17, 1:34 am)
Re: [PATCH, RFC] v7 scalable classic RCU implementation
, Gautham R Shenoy
, (Fri Oct 17, 8:35 am)
Re: [PATCH, RFC] v7 scalable classic RCU implementation
, Paul E. McKenney
, (Fri Oct 17, 8:43 am)
Re: [PATCH, RFC] v7 scalable classic RCU implementation
, Paul E. McKenney
, (Fri Oct 17, 8:46 am)
Re: [PATCH, RFC] v7 scalable classic RCU implementation
, Manfred Spraul
, (Wed Oct 22, 11:41 am)
Re: [PATCH, RFC] v7 scalable classic RCU implementation
, Paul E. McKenney
, (Wed Oct 22, 2:02 pm)
Re: [PATCH, RFC] v7 scalable classic RCU implementation
, Manfred Spraul
, (Wed Oct 22, 2:24 pm)
Re: [PATCH, RFC] v7 scalable classic RCU implementation
, Paul E. McKenney
, (Mon Oct 27, 9:45 am)
Re: [PATCH, RFC] v7 scalable classic RCU implementation
, Manfred Spraul
, (Mon Oct 27, 12:48 pm)
Re: [PATCH, RFC] v7 scalable classic RCU implementation
, Paul E. McKenney
, (Mon Oct 27, 4:52 pm)
Re: [PATCH, RFC] v7 scalable classic RCU implementation
, Manfred Spraul
, (Mon Oct 27, 10:30 pm)
Re: [PATCH, RFC] v7 scalable classic RCU implementation
, Paul E. McKenney
, (Tue Oct 28, 8:17 am)
Re: [PATCH, RFC] v7 scalable classic RCU implementation
, Manfred Spraul
, (Tue Oct 28, 10:21 am)
Re: [PATCH, RFC] v7 scalable classic RCU implementation
, Paul E. McKenney
, (Tue Oct 28, 10:35 am)
Re: [PATCH, RFC] v7 scalable classic RCU implementation
, Manfred Spraul
, (Sun Nov 2, 1:10 pm)
Re: [PATCH, RFC] v7 scalable classic RCU implementation
, Paul E. McKenney
, (Mon Nov 3, 1:33 pm)
Re: [PATCH, RFC] v7 scalable classic RCU implementation
, Manfred Spraul
, (Wed Nov 5, 12:48 pm)
Re: [PATCH, RFC] v7 scalable classic RCU implementation
, Paul E. McKenney
, (Wed Nov 5, 2:27 pm)
[PATCH, RFC] v8 scalable classic RCU implementation
, Paul E. McKenney
, (Sat Nov 15, 4:20 pm)
Re: [PATCH, RFC] v7 scalable classic RCU implementation
, Paul E. McKenney
, (Mon Dec 8, 11:42 am)
Navigation
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Greg KH
Og dreams of kernels
Jens Axboe
[PATCH 31/33] Fusion: sg chaining support
Arnd Bergmann
Re: finding your own dead "CONFIG_" variables
Mark Brown
[PATCH 2/2] Subject: natsemi: Allow users to disable workaround for DspCfg reset
Tony Breeds
[LGUEST] Look in object dir for .config
git
:
Brian Downing
Re: Git in a Nutshell guide
John Benes
Re: master has some toys
Matthias Lederhofer
[PATCH 4/7] introduce GIT_WORK_TREE to specify the work tree
Alexander Sulfrian
[RFC/PATCH] RE: git calls SSH_ASKPASS even if DISPLAY is not set
Junio C Hamano
Re: Rss produced by git is not valid xml?