2008-11-24 16:39:54

by Alexander Beregalov

[permalink] [raw]
Subject: 2.6.28-rc6: hpet: object is on stack, but not annotated

Hi

It is X86_64, SMP
It appears during boot process.

CONFIG_HPET_TIMER=y
CONFIG_HPET_EMULATE_RTC=y
CONFIG_HPET=y
CONFIG_HPET_MMAP=y
CONFIG_DEBUG_OBJECTS=y
# CONFIG_DEBUG_OBJECTS_SELFTEST is not set
CONFIG_DEBUG_OBJECTS_FREE=y
CONFIG_DEBUG_OBJECTS_TIMERS=y

hpet0: at MMIO 0xfed00000, IRQs 2, 8, 0
hpet0: 3 comparators, 64-bit 14.318180 MHz counter
ODEBUG: object is on stack, but not annotated
------------[ cut here ]------------
WARNING: at lib/debugobjects.c:251 __debug_object_init+0x2a4/0x352()
Modules linked in:
Pid: 1, comm: swapper Not tainted 2.6.28-rc6-00007-ged31348 #5
Call Trace:
[<ffffffff8023661b>] warn_on_slowpath+0x58/0x7d
[<ffffffff804de4b6>] ? printk+0x67/0x69
[<ffffffff8037fd54>] ? __debug_object_init+0x185/0x352
[<ffffffff8037fe73>] __debug_object_init+0x2a4/0x352
[<ffffffff8037ff4e>] debug_object_init+0x14/0x16
[<ffffffff8023f681>] init_timer+0x18/0x5b
[<ffffffff80220739>] hpet_cpuhp_notify+0x93/0x105
[<ffffffff80220872>] ? hpet_work+0x0/0x206
[<ffffffff803d0301>] ? hpet_alloc+0x32d/0x389
[<ffffffff80256db2>] ? trace_hardirqs_on_caller+0x10d/0x138
[<ffffffff80256dea>] ? trace_hardirqs_on+0xd/0xf
[<ffffffff806c45b7>] ? hpet_late_init+0x0/0x19e
[<ffffffff806c45b7>] ? hpet_late_init+0x0/0x19e
[<ffffffff806c4721>] hpet_late_init+0x16a/0x19e
[<ffffffff806c27a9>] ? print_all_ICs+0x0/0x540
[<ffffffff80209058>] _stext+0x58/0x138
[<ffffffff804e0ecb>] ? _spin_unlock+0x4a/0x57
[<ffffffff802db669>] ? proc_register+0x17f/0x193
[<ffffffff802db7a5>] ? create_proc_entry+0x7e/0x94
[<ffffffff80267d15>] ? register_irq_proc+0xb0/0xcc
[<ffffffff802d0000>] ? elf_core_dump+0x662/0xc71
[<ffffffff806b9625>] kernel_init+0x125/0x179
[<ffffffff804e087f>] ? trace_hardirqs_on_thunk+0x3a/0x3f
[<ffffffff8020c849>] child_rip+0xa/0x11
[<ffffffff8020bd38>] ? restore_args+0x0/0x30
[<ffffffff806b9500>] ? kernel_init+0x0/0x179
[<ffffffff8020c83f>] ? child_rip+0x0/0x11
---[ end trace 4eaa2a86a8e2da22 ]---
Switched to high resolution mode on CPU 0
Switched to high resolution mode on CPU 3
Switched to high resolution mode on CPU 2
Switched to high resolution mode on CPU 1


2008-11-24 18:14:17

by Alexander Beregalov

[permalink] [raw]
Subject: Re: 2.6.28-rc6: hpet: object is on stack, but not annotated

2008/11/24 Alexander Beregalov <[email protected]>:
> hpet0: at MMIO 0xfed00000, IRQs 2, 8, 0
> hpet0: 3 comparators, 64-bit 14.318180 MHz counter
> ODEBUG: object is on stack, but not annotated
> ------------[ cut here ]------------
> WARNING: at lib/debugobjects.c:251 __debug_object_init+0x2a4/0x352()

Bisected down to 26afe5f2fbf06ea0765aaa316640c4dd472310c0
(x86: HPET_MSI Initialise per-cpu HPET timers)

Revert helps

2008-11-24 18:18:21

by Thomas Gleixner

[permalink] [raw]
Subject: Re: 2.6.28-rc6: hpet: object is on stack, but not annotated

On Mon, 24 Nov 2008, Alexander Beregalov wrote:

> 2008/11/24 Alexander Beregalov <[email protected]>:
> > hpet0: at MMIO 0xfed00000, IRQs 2, 8, 0
> > hpet0: 3 comparators, 64-bit 14.318180 MHz counter
> > ODEBUG: object is on stack, but not annotated
> > ------------[ cut here ]------------
> > WARNING: at lib/debugobjects.c:251 __debug_object_init+0x2a4/0x352()
>
> Bisected down to 26afe5f2fbf06ea0765aaa316640c4dd472310c0
> (x86: HPET_MSI Initialise per-cpu HPET timers)
>
> Revert helps

That's just a warning about a missing annotation. The commit is fine.

Thanks,

tglx

2008-12-04 11:14:43

by Pavel Machek

[permalink] [raw]
Subject: Re: 2.6.28-rc6: hpet: object is on stack, but not annotated

On Mon 2008-11-24 19:17:44, Thomas Gleixner wrote:
> On Mon, 24 Nov 2008, Alexander Beregalov wrote:
>
> > 2008/11/24 Alexander Beregalov <[email protected]>:
> > > hpet0: at MMIO 0xfed00000, IRQs 2, 8, 0
> > > hpet0: 3 comparators, 64-bit 14.318180 MHz counter
> > > ODEBUG: object is on stack, but not annotated
> > > ------------[ cut here ]------------
> > > WARNING: at lib/debugobjects.c:251 __debug_object_init+0x2a4/0x352()
> >
> > Bisected down to 26afe5f2fbf06ea0765aaa316640c4dd472310c0
> > (x86: HPET_MSI Initialise per-cpu HPET timers)
> >
> > Revert helps
>
> That's just a warning about a missing annotation. The commit is fine.

You must be using very different metric of what "fine" means than rest
of the world.

(No, introducing WARN_ON()s is not fine; it spams kerneloops.org at least...)

Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

2009-01-12 10:40:29

by Alexander Beregalov

[permalink] [raw]
Subject: Re: 2.6.28-rc6: hpet: object is on stack, but not annotated

2008/12/4 Pavel Machek <[email protected]>:
> On Mon 2008-11-24 19:17:44, Thomas Gleixner wrote:
>> On Mon, 24 Nov 2008, Alexander Beregalov wrote:
>>
>> > 2008/11/24 Alexander Beregalov <[email protected]>:
>> > > hpet0: at MMIO 0xfed00000, IRQs 2, 8, 0
>> > > hpet0: 3 comparators, 64-bit 14.318180 MHz counter
>> > > ODEBUG: object is on stack, but not annotated
>> > > ------------[ cut here ]------------
>> > > WARNING: at lib/debugobjects.c:251 __debug_object_init+0x2a4/0x352()
>> >
>> > Bisected down to 26afe5f2fbf06ea0765aaa316640c4dd472310c0
>> > (x86: HPET_MSI Initialise per-cpu HPET timers)
>> >
>> > Revert helps
>>
>> That's just a warning about a missing annotation. The commit is fine.
>
> You must be using very different metric of what "fine" means than rest
> of the world.
>
> (No, introducing WARN_ON()s is not fine; it spams kerneloops.org at least...)

The warning is still here on 2.6.29-rc1.
It taints the kernel.

2009-01-12 11:52:46

by Peter Zijlstra

[permalink] [raw]
Subject: Re: 2.6.28-rc6: hpet: object is on stack, but not annotated

On Mon, 2009-01-12 at 13:40 +0300, Alexander Beregalov wrote:
> 2008/12/4 Pavel Machek <[email protected]>:
> > On Mon 2008-11-24 19:17:44, Thomas Gleixner wrote:
> >> On Mon, 24 Nov 2008, Alexander Beregalov wrote:
> >>
> >> > 2008/11/24 Alexander Beregalov <[email protected]>:
> >> > > hpet0: at MMIO 0xfed00000, IRQs 2, 8, 0
> >> > > hpet0: 3 comparators, 64-bit 14.318180 MHz counter
> >> > > ODEBUG: object is on stack, but not annotated
> >> > > ------------[ cut here ]------------
> >> > > WARNING: at lib/debugobjects.c:251 __debug_object_init+0x2a4/0x352()
> >> >
> >> > Bisected down to 26afe5f2fbf06ea0765aaa316640c4dd472310c0
> >> > (x86: HPET_MSI Initialise per-cpu HPET timers)
> >> >
> >> > Revert helps
> >>
> >> That's just a warning about a missing annotation. The commit is fine.
> >
> > You must be using very different metric of what "fine" means than rest
> > of the world.
> >
> > (No, introducing WARN_ON()s is not fine; it spams kerneloops.org at least...)
>
> The warning is still here on 2.6.29-rc1.
> It taints the kernel.

Does this fix it?

Signed-off-by: Peter Zijlstra <[email protected]>
---
arch/x86/kernel/hpet.c | 2 +-
include/linux/workqueue.h | 6 ++++++
2 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c
index cd759ad..bb2e0f0 100644
--- a/arch/x86/kernel/hpet.c
+++ b/arch/x86/kernel/hpet.c
@@ -628,7 +628,7 @@ static int hpet_cpuhp_notify(struct notifier_block *n,

switch (action & 0xf) {
case CPU_ONLINE:
- INIT_DELAYED_WORK(&work.work, hpet_work);
+ INIT_DELAYED_WORK_ON_STACK(&work.work, hpet_work);
init_completion(&work.complete);
/* FIXME: add schedule_work_on() */
schedule_delayed_work_on(cpu, &work.work, 0);
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h
index b362911..47151c8 100644
--- a/include/linux/workqueue.h
+++ b/include/linux/workqueue.h
@@ -118,6 +118,12 @@ struct execute_work {
init_timer(&(_work)->timer); \
} while (0)

+#define INIT_DELAYED_WORK_ON_STACK(_work, _func) \
+ do { \
+ INIT_WORK(&(_work)->work, (_func)); \
+ init_timer_on_stack(&(_work)->timer); \
+ } while (0)
+
#define INIT_DELAYED_WORK_DEFERRABLE(_work, _func) \
do { \
INIT_WORK(&(_work)->work, (_func)); \

2009-01-12 11:59:53

by Ingo Molnar

[permalink] [raw]
Subject: Re: 2.6.28-rc6: hpet: object is on stack, but not annotated


* Peter Zijlstra <[email protected]> wrote:

> > > (No, introducing WARN_ON()s is not fine; it spams kerneloops.org at
> > > least...)
> >
> > The warning is still here on 2.6.29-rc1. It taints the kernel.
>
> Does this fix it?

i've applied it to tip/timers/urgent and will send it to Linus if it
passes Alexander's testing too. Below is the prettified commit.

Thanks guys,

Ingo
-------------->
>From b1f1006971b6f8d330c6e8ecf240f51c9eb67f4d Mon Sep 17 00:00:00 2001
From: Peter Zijlstra <[email protected]>
Date: Mon, 12 Jan 2009 12:52:23 +0100
Subject: [PATCH] locking, hpet: annotate false positive warning

Alexander Beregalov reported that this warning is caused by the HPET code:

> hpet0: at MMIO 0xfed00000, IRQs 2, 8, 0
> hpet0: 3 comparators, 64-bit 14.318180 MHz counter
> ODEBUG: object is on stack, but not annotated
> ------------[ cut here ]------------
> WARNING: at lib/debugobjects.c:251 __debug_object_init+0x2a4/0x352()

> Bisected down to 26afe5f2fbf06ea0765aaa316640c4dd472310c0
> (x86: HPET_MSI Initialise per-cpu HPET timers)

The commit is fine - but the on-stack workqueue entry needs annotation.

Reported-and-bisected-by: Alexander Beregalov <[email protected]>
Signed-off-by: Peter Zijlstra <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
---
arch/x86/kernel/hpet.c | 2 +-
include/linux/workqueue.h | 6 ++++++
2 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c
index cd759ad..bb2e0f0 100644
--- a/arch/x86/kernel/hpet.c
+++ b/arch/x86/kernel/hpet.c
@@ -628,7 +628,7 @@ static int hpet_cpuhp_notify(struct notifier_block *n,

switch (action & 0xf) {
case CPU_ONLINE:
- INIT_DELAYED_WORK(&work.work, hpet_work);
+ INIT_DELAYED_WORK_ON_STACK(&work.work, hpet_work);
init_completion(&work.complete);
/* FIXME: add schedule_work_on() */
schedule_delayed_work_on(cpu, &work.work, 0);
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h
index b362911..47151c8 100644
--- a/include/linux/workqueue.h
+++ b/include/linux/workqueue.h
@@ -118,6 +118,12 @@ struct execute_work {
init_timer(&(_work)->timer); \
} while (0)

+#define INIT_DELAYED_WORK_ON_STACK(_work, _func) \
+ do { \
+ INIT_WORK(&(_work)->work, (_func)); \
+ init_timer_on_stack(&(_work)->timer); \
+ } while (0)
+
#define INIT_DELAYED_WORK_DEFERRABLE(_work, _func) \
do { \
INIT_WORK(&(_work)->work, (_func)); \

2009-01-12 12:28:18

by Alexander Beregalov

[permalink] [raw]
Subject: Re: 2.6.28-rc6: hpet: object is on stack, but not annotated

2009/1/12 Ingo Molnar <[email protected]>:
>
> * Peter Zijlstra <[email protected]> wrote:
>
>> > > (No, introducing WARN_ON()s is not fine; it spams kerneloops.org at
>> > > least...)
>> >
>> > The warning is still here on 2.6.29-rc1. It taints the kernel.
>>
>> Does this fix it?
Yes, it does. Thanks Peter.
>
> i've applied it to tip/timers/urgent and will send it to Linus if it
> passes Alexander's testing too. Below is the prettified commit.
Yes, please.
>
> Thanks guys,
>
> Ingo
> -------------->
> From b1f1006971b6f8d330c6e8ecf240f51c9eb67f4d Mon Sep 17 00:00:00 2001
> From: Peter Zijlstra <[email protected]>
> Date: Mon, 12 Jan 2009 12:52:23 +0100
> Subject: [PATCH] locking, hpet: annotate false positive warning
>
> Alexander Beregalov reported that this warning is caused by the HPET code:
>
>> hpet0: at MMIO 0xfed00000, IRQs 2, 8, 0
>> hpet0: 3 comparators, 64-bit 14.318180 MHz counter
>> ODEBUG: object is on stack, but not annotated
>> ------------[ cut here ]------------
>> WARNING: at lib/debugobjects.c:251 __debug_object_init+0x2a4/0x352()
>
>> Bisected down to 26afe5f2fbf06ea0765aaa316640c4dd472310c0
>> (x86: HPET_MSI Initialise per-cpu HPET timers)
>
> The commit is fine - but the on-stack workqueue entry needs annotation.
>
> Reported-and-bisected-by: Alexander Beregalov <[email protected]>
> Signed-off-by: Peter Zijlstra <[email protected]>
> Signed-off-by: Ingo Molnar <[email protected]>
> ---
> arch/x86/kernel/hpet.c | 2 +-
> include/linux/workqueue.h | 6 ++++++
> 2 files changed, 7 insertions(+), 1 deletions(-)
>
> diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c
> index cd759ad..bb2e0f0 100644
> --- a/arch/x86/kernel/hpet.c
> +++ b/arch/x86/kernel/hpet.c
> @@ -628,7 +628,7 @@ static int hpet_cpuhp_notify(struct notifier_block *n,
>
> switch (action & 0xf) {
> case CPU_ONLINE:
> - INIT_DELAYED_WORK(&work.work, hpet_work);
> + INIT_DELAYED_WORK_ON_STACK(&work.work, hpet_work);
> init_completion(&work.complete);
> /* FIXME: add schedule_work_on() */
> schedule_delayed_work_on(cpu, &work.work, 0);
> diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h
> index b362911..47151c8 100644
> --- a/include/linux/workqueue.h
> +++ b/include/linux/workqueue.h
> @@ -118,6 +118,12 @@ struct execute_work {
> init_timer(&(_work)->timer); \
> } while (0)
>
> +#define INIT_DELAYED_WORK_ON_STACK(_work, _func) \
> + do { \
> + INIT_WORK(&(_work)->work, (_func)); \
> + init_timer_on_stack(&(_work)->timer); \
> + } while (0)
> +
> #define INIT_DELAYED_WORK_DEFERRABLE(_work, _func) \
> do { \
> INIT_WORK(&(_work)->work, (_func)); \
>

2009-01-12 12:34:18

by Ingo Molnar

[permalink] [raw]
Subject: Re: 2.6.28-rc6: hpet: object is on stack, but not annotated


* Alexander Beregalov <[email protected]> wrote:

> 2009/1/12 Ingo Molnar <[email protected]>:
> >
> > * Peter Zijlstra <[email protected]> wrote:
> >
> >> > > (No, introducing WARN_ON()s is not fine; it spams kerneloops.org at
> >> > > least...)
> >> >
> >> > The warning is still here on 2.6.29-rc1. It taints the kernel.
> >>
> >> Does this fix it?
> Yes, it does. Thanks Peter.

thanks - added your Tested-by tag to the commit too.

Ingo