lkml.org 
[lkml]   [2013]   [Oct]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 00/16] sched/wait: Collapse __wait_event macros -v5
On Thu, Oct 10, 2013 at 07:39:37PM +0200, Ingo Molnar wrote:
>
> * Paul E. McKenney <paulmck@linux.vnet.ibm.com> wrote:
>
> > On Thu, Oct 10, 2013 at 10:05:01AM +0200, Ingo Molnar wrote:
> > >
> > > * Paul E. McKenney <paulmck@linux.vnet.ibm.com> wrote:
> > >
> > > > And it now builds, boots, and passes short rcutorture tests, updated
> > > > patch below.
> > > >
> > > > One side-effect is the boot parameters, namely that what used to be
> > > > rcutree.blimit=10 is now simply tree.blimit=10. Not a problem for me, I
> > > > just made my test scripts probe the source tree and generate the
> > > > corresponding format. But is there some straightforward way to get the
> > > > name of the "rcu" directory involved? The obvious approach of
> > > > "rcu.tree.blimit=10" does not work -- the kernel happily ignores any
> > > > such parameter.
> > >
> > > Hm, that boot option parser attitude is a bit sad - more structure to boot
> > > parameters is IMHO a Good Thing.
> >
> > No argument here!
> >
> > > Does it accept :
> > >
> > > rcu/tree/blimit=10
> > >
> > > rcu/tree.blimit=10
> > >
> > > type of structure perhaps?
> >
> > Unfortunately, no. :-(
>
> So, I think this code lives within kernel/params.c. Might be fixable?

But of course! I was just trying to be lazy. ;-)

I could imagine adding a filename field to struct kernel_param that
was initialized with __FILE__, then making something like parameq()
that did the appropriate comparison allowing any match starting after a
"/" and ignoring the trailing ".h" or ".c", and then calling that from
parse_one() along with current parameq(). There doesn't seem to be any
point for doing the same to do_early_param().

There would be a few surprises with this approach, for example,
rcu_idle_gp_delay and rcu_idle_lazy_gp_delay, which are defined
in kernel/rcu/tree_plugin.h, would be:

tree_plugin.rcu_idle_gp_delay=4
tree_plugin.rcu_idle_lazy_gp_delay=6000

or:

rcu/tree_plugin.rcu_idle_gp_delay=4
rcu/tree_plugin.rcu_idle_lazy_gp_delay=6000

or:

kernel/rcu/tree_plugin.rcu_idle_gp_delay=4
kernel/rcu/tree_plugin.rcu_idle_lazy_gp_delay=6000

or I suppose even:

linux-rcu/kernel/rcu/tree_plugin.rcu_idle_gp_delay=4
linux-rcu/kernel/rcu/tree_plugin.rcu_idle_lazy_gp_delay=6000

instead of (say):

kernel/rcu/tree.rcu_idle_gp_delay=4
kernel/rcu/tree.rcu_idle_lazy_gp_delay=6000

This could of course also be fixed by comparing the filename up to
the last "/" followed by the current parameter name. Or, as Peter
Zijlstra suggested, by manually expanding kernel/rcu/tree_plugin.h into
kernel/rcu/tree.c.

Or I could use the non-standard __BASE_FILE__ instead of __FILE__, which
expands to .../kernel/rcu/tree.c. LLVM seems to define this as well,
so should be OK to use.

So it doesn't look too horrible. (Famous last words...)

Thoughts?

> > > > It looks like I should be able to do something like the following in
> > > > kernel/rcu/tree.c to get back the old parameter names:
> > > >
> > > > MODULE_ALIAS("rcutree");
> > > > #ifdef MODULE_PARAM_PREFIX
> > > > #undef MODULE_PARAM_PREFIX
> > > > #endif
> > > > #define MODULE_PARAM_PREFIX "rcutree."
> > >
> > > Yeah.
> > >
> > > ( To keep it simple, the undef should be unnecessary, it's not like anyone
> > > can slip in a MODULE_PARAM_PREFIX without you noticing, right? )
> >
> > Works with the #undef, trying it without it... And it works, but I do
> > get the following complaint from the compiler:
> >
> > /home/paulmck/public_git/linux-rcu/kernel/rcu/tree.c:66:0: warning: "MODULE_PARAM_PREFIX" redefined [enabled by default]
> > /home/paulmck/public_git/linux-rcu/include/linux/moduleparam.h:13:0: note: this is the location of the previous definition
> >
> > The problem is that moduleparam.h contains the following:
> >
> > #define MODULE_PARAM_PREFIX KBUILD_MODNAME "."
> >
> > So the #undef is ugly, but better than the compiler warning. :-(
>
> agreed.
>
> Thanks,
>
> Ingo
> --
> 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/
>



\
 
 \ /
  Last update: 2013-10-10 21:01    [W:0.173 / U:1.148 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site