linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] rcu: fix section mismatch
@ 2008-01-19 19:56 Randy Dunlap
  2008-01-19 21:25 ` Sam Ravnborg
  0 siblings, 1 reply; 7+ messages in thread
From: Randy Dunlap @ 2008-01-19 19:56 UTC (permalink / raw)
  To: lkml; +Cc: dipankar, akpm, samr

From: Randy Dunlap <randy.dunlap@oracle.com>

rcu_online_cpu() should be __cpuinit instead of __devinit.

WARNING: vmlinux.o(.text+0x4b6d5): Section mismatch: reference to .init.text: (between 'rcu_cpu_notify' and 'wakeme_after_rcu')

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
---
 kernel/rcupdate.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-2.6.24-rc8-git2.orig/kernel/rcupdate.c
+++ linux-2.6.24-rc8-git2/kernel/rcupdate.c
@@ -549,7 +549,7 @@ static void rcu_init_percpu_data(int cpu
 	rdp->blimit = blimit;
 }
 
-static void __devinit rcu_online_cpu(int cpu)
+static void __cpuinit rcu_online_cpu(int cpu)
 {
 	struct rcu_data *rdp = &per_cpu(rcu_data, cpu);
 	struct rcu_data *bh_rdp = &per_cpu(rcu_bh_data, cpu);

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] rcu: fix section mismatch
  2008-01-19 19:56 [PATCH] rcu: fix section mismatch Randy Dunlap
@ 2008-01-19 21:25 ` Sam Ravnborg
  2008-01-21  0:38   ` Rusty Russell
  0 siblings, 1 reply; 7+ messages in thread
From: Sam Ravnborg @ 2008-01-19 21:25 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: lkml, dipankar, akpm

On Sat, Jan 19, 2008 at 11:56:43AM -0800, Randy Dunlap wrote:
> From: Randy Dunlap <randy.dunlap@oracle.com>
> 
> rcu_online_cpu() should be __cpuinit instead of __devinit.
> 
> WARNING: vmlinux.o(.text+0x4b6d5): Section mismatch: reference to .init.text: (between 'rcu_cpu_notify' and 'wakeme_after_rcu')
> 
> Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Acked-by: Sam Ravnborg <sam@ravnborg.org>

So if we have:
CONFIG_HOTPLUG=n
CONFIG_HOTPLUG_CPU=y

then this is a oops candidate.

Andrew - this looks like a 2.6.24 candidate.

	Sam


> ---
>  kernel/rcupdate.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> --- linux-2.6.24-rc8-git2.orig/kernel/rcupdate.c
> +++ linux-2.6.24-rc8-git2/kernel/rcupdate.c
> @@ -549,7 +549,7 @@ static void rcu_init_percpu_data(int cpu
>  	rdp->blimit = blimit;
>  }
>  
> -static void __devinit rcu_online_cpu(int cpu)
> +static void __cpuinit rcu_online_cpu(int cpu)
>  {
>  	struct rcu_data *rdp = &per_cpu(rcu_data, cpu);
>  	struct rcu_data *bh_rdp = &per_cpu(rcu_bh_data, cpu);
> --
> 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/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] rcu: fix section mismatch
  2008-01-19 21:25 ` Sam Ravnborg
@ 2008-01-21  0:38   ` Rusty Russell
  2008-01-21 19:08     ` Sam Ravnborg
  2008-01-21 23:34     ` Randy Dunlap
  0 siblings, 2 replies; 7+ messages in thread
From: Rusty Russell @ 2008-01-21  0:38 UTC (permalink / raw)
  To: Sam Ravnborg; +Cc: Randy Dunlap, lkml, dipankar, akpm

On Sunday 20 January 2008 08:25:49 Sam Ravnborg wrote:
> On Sat, Jan 19, 2008 at 11:56:43AM -0800, Randy Dunlap wrote:
> > rcu_online_cpu() should be __cpuinit instead of __devinit.
>
> So if we have:
> CONFIG_HOTPLUG=n
> CONFIG_HOTPLUG_CPU=y
>
> then this is a oops candidate.

At first glance, this can't happen because all CONFIG_HOTPLUG_CPU depends on 
CONFIG_HOTPLUG or selects it, for all archs.

But CONFIG_PM_SLEEP_SMP selects CONFIG_HOTPLUG_CPU, without requiring 
CONFIG_HOTPLUG: turning on SUSPEND or HIBERNATION does this.

Perhaps it's time to revisit reverse-depends for select?

Cheers,
Rusty.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] rcu: fix section mismatch
  2008-01-21  0:38   ` Rusty Russell
@ 2008-01-21 19:08     ` Sam Ravnborg
  2008-01-21 23:34     ` Randy Dunlap
  1 sibling, 0 replies; 7+ messages in thread
From: Sam Ravnborg @ 2008-01-21 19:08 UTC (permalink / raw)
  To: Rusty Russell; +Cc: Randy Dunlap, lkml, dipankar, akpm

On Mon, Jan 21, 2008 at 11:38:38AM +1100, Rusty Russell wrote:
> On Sunday 20 January 2008 08:25:49 Sam Ravnborg wrote:
> > On Sat, Jan 19, 2008 at 11:56:43AM -0800, Randy Dunlap wrote:
> > > rcu_online_cpu() should be __cpuinit instead of __devinit.
> >
> > So if we have:
> > CONFIG_HOTPLUG=n
> > CONFIG_HOTPLUG_CPU=y
> >
> > then this is a oops candidate.
> 
> At first glance, this can't happen because all CONFIG_HOTPLUG_CPU depends on 
> CONFIG_HOTPLUG or selects it, for all archs.
> 
> But CONFIG_PM_SLEEP_SMP selects CONFIG_HOTPLUG_CPU, without requiring 
> CONFIG_HOTPLUG: turning on SUSPEND or HIBERNATION does this.
For now it is a bug to select a symbol with dependencies...

If we could say that we always have HOTPLUG when we have HOTPLUG_CPU
that would kill a lot of a lot of Section Mismatch warnings.
But as things stands out we can build a kernel with HOTPLUG_CPU
but without HOTPLUG.

#if defined(CONFIG_HOTPLUG_CPU && !defined(CONFIG_HOTPLUG)
# error illegal configuration - talk to the PM guys
#endif

could do it?
 
> 
> Perhaps it's time to revisit reverse-depends for select?
Or maybe a higer level solution.
select is used for three pruposes:
- to include specific minimalitic functionality as for example done on
  the ARM Kconfig file with success
- to enable general functionality (the HAVE_* way to do it)
- to enable subsystems of different sizes

And it is only when people try to do the latter it blows up.
And they do so to make it easier for people to configure the kernel
but the end result is the opposite.

	Sam

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] rcu: fix section mismatch
  2008-01-21  0:38   ` Rusty Russell
  2008-01-21 19:08     ` Sam Ravnborg
@ 2008-01-21 23:34     ` Randy Dunlap
  2008-01-22  5:52       ` Sam Ravnborg
  1 sibling, 1 reply; 7+ messages in thread
From: Randy Dunlap @ 2008-01-21 23:34 UTC (permalink / raw)
  To: Rusty Russell; +Cc: Sam Ravnborg, lkml, dipankar, akpm

On Mon, 21 Jan 2008 11:38:38 +1100 Rusty Russell wrote:

> On Sunday 20 January 2008 08:25:49 Sam Ravnborg wrote:
> > On Sat, Jan 19, 2008 at 11:56:43AM -0800, Randy Dunlap wrote:
> > > rcu_online_cpu() should be __cpuinit instead of __devinit.
> >
> > So if we have:
> > CONFIG_HOTPLUG=n
> > CONFIG_HOTPLUG_CPU=y
> >
> > then this is a oops candidate.
> 
> At first glance, this can't happen because all CONFIG_HOTPLUG_CPU depends on 
> CONFIG_HOTPLUG or selects it, for all archs.

Mostly, but arch/mips/ seems to be different (neither depends nor selects)
unless it has changed very recently (I looked at 2.6.24-rc8).

> But CONFIG_PM_SLEEP_SMP selects CONFIG_HOTPLUG_CPU, without requiring 
> CONFIG_HOTPLUG: turning on SUSPEND or HIBERNATION does this.
> 
> Perhaps it's time to revisit reverse-depends for select?

It would be nice if someone did that.

---
~Randy

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] rcu: fix section mismatch
  2008-01-21 23:34     ` Randy Dunlap
@ 2008-01-22  5:52       ` Sam Ravnborg
  2008-01-22 16:20         ` Randy Dunlap
  0 siblings, 1 reply; 7+ messages in thread
From: Sam Ravnborg @ 2008-01-22  5:52 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: Rusty Russell, lkml, dipankar, akpm

On Mon, Jan 21, 2008 at 03:34:09PM -0800, Randy Dunlap wrote:
> On Mon, 21 Jan 2008 11:38:38 +1100 Rusty Russell wrote:
> 
> > On Sunday 20 January 2008 08:25:49 Sam Ravnborg wrote:
> > > On Sat, Jan 19, 2008 at 11:56:43AM -0800, Randy Dunlap wrote:
> > > > rcu_online_cpu() should be __cpuinit instead of __devinit.
> > >
> > > So if we have:
> > > CONFIG_HOTPLUG=n
> > > CONFIG_HOTPLUG_CPU=y
> > >
> > > then this is a oops candidate.
> > 
> > At first glance, this can't happen because all CONFIG_HOTPLUG_CPU depends on 
> > CONFIG_HOTPLUG or selects it, for all archs.
> 
> Mostly, but arch/mips/ seems to be different (neither depends nor selects)
> unless it has changed very recently (I looked at 2.6.24-rc8).

mips has
	default n

So they at least try to turn off this feature.

	Sam

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] rcu: fix section mismatch
  2008-01-22  5:52       ` Sam Ravnborg
@ 2008-01-22 16:20         ` Randy Dunlap
  0 siblings, 0 replies; 7+ messages in thread
From: Randy Dunlap @ 2008-01-22 16:20 UTC (permalink / raw)
  To: Sam Ravnborg; +Cc: Rusty Russell, lkml, dipankar, akpm

Sam Ravnborg wrote:
> On Mon, Jan 21, 2008 at 03:34:09PM -0800, Randy Dunlap wrote:
>> On Mon, 21 Jan 2008 11:38:38 +1100 Rusty Russell wrote:
>>
>>> On Sunday 20 January 2008 08:25:49 Sam Ravnborg wrote:
>>>> On Sat, Jan 19, 2008 at 11:56:43AM -0800, Randy Dunlap wrote:
>>>>> rcu_online_cpu() should be __cpuinit instead of __devinit.
>>>> So if we have:
>>>> CONFIG_HOTPLUG=n
>>>> CONFIG_HOTPLUG_CPU=y
>>>>
>>>> then this is a oops candidate.
>>> At first glance, this can't happen because all CONFIG_HOTPLUG_CPU depends on 
>>> CONFIG_HOTPLUG or selects it, for all archs.
>> Mostly, but arch/mips/ seems to be different (neither depends nor selects)
>> unless it has changed very recently (I looked at 2.6.24-rc8).
> 
> mips has
> 	default n
> 
> So they at least try to turn off this feature.

OK.

ISTM that conflating CONFIG_HOTPLUG and CONFIG_HOTPLUG_CPU is both a
mistake and confusing.  CONFIG_HOTPLUG help text specifically talks
about hot-pluggable devices and /dev.  I can imagine some engineers
saying that CPUs and MEM are (abstract) devices, but I don't think that
most users would go that far, so I think that HOTPLUG and HOTPLUG_CPU
should be totally independent.

-- 
~Randy

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-01-22 16:22 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-19 19:56 [PATCH] rcu: fix section mismatch Randy Dunlap
2008-01-19 21:25 ` Sam Ravnborg
2008-01-21  0:38   ` Rusty Russell
2008-01-21 19:08     ` Sam Ravnborg
2008-01-21 23:34     ` Randy Dunlap
2008-01-22  5:52       ` Sam Ravnborg
2008-01-22 16:20         ` Randy Dunlap

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).