Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1587989 > unrolled thread

Re: [Merge branch 'core-debugobjects-for-linus' of git] 575260e3f8: WARNING: CPU: 0 PID: 1 at kernel/time/hrtimer.c:1090 hrtimer_init

Started byLinus Torvalds <torvalds@linux-foundation.org>
First post2017-02-24 23:40 +0100
Last post2017-02-25 12:10 +0100
Articles 4 — 4 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [Merge branch 'core-debugobjects-for-linus' of git] 575260e3f8:  WARNING: CPU: 0 PID: 1 at kernel/time/hrtimer.c:1090 hrtimer_init Linus Torvalds <torvalds@linux-foundation.org> - 2017-02-24 23:40 +0100
    Re: [Merge branch 'core-debugobjects-for-linus' of git] 575260e3f8:  WARNING: CPU: 0 PID: 1 at kernel/time/hrtimer.c:1090 hrtimer_init Fengguang Wu <wfg@linux.intel.com> - 2017-02-25 03:00 +0100
      Re: [Merge branch 'core-debugobjects-for-linus' of git] 575260e3f8: WARNING: CPU: 0 PID: 1 at kernel/time/hrtimer.c:1090 hrtimer_init Marc Zyngier <marc.zyngier@arm.com> - 2017-02-25 12:50 +0100
    Re: [Merge branch 'core-debugobjects-for-linus' of git] 575260e3f8:  WARNING: CPU: 0 PID: 1 at kernel/time/hrtimer.c:1090 hrtimer_init Thomas Gleixner <tglx@linutronix.de> - 2017-02-25 12:10 +0100

#1587989 — Re: [Merge branch 'core-debugobjects-for-linus' of git] 575260e3f8: WARNING: CPU: 0 PID: 1 at kernel/time/hrtimer.c:1090 hrtimer_init

FromLinus Torvalds <torvalds@linux-foundation.org>
Date2017-02-24 23:40 +0100
SubjectRe: [Merge branch 'core-debugobjects-for-linus' of git] 575260e3f8: WARNING: CPU: 0 PID: 1 at kernel/time/hrtimer.c:1090 hrtimer_init
Message-ID<tewGS-6Uo-11@gated-at.bofh.it>
This looks like two -tip trees together show some issue - the timer
updates from Thomas triggering a debugobjects check from Ingo, thus
fingering my merge as the culprit.

Added Thomas/Ingo to the cc, leaving everything quoted for their
edification and enjoyment.

           Linus

On Thu, Feb 23, 2017 at 10:45 PM, kernel test robot
<fengguang.wu@intel.com> wrote:
> Greetings,
>
> 0day kernel testing robot got the below dmesg and the first bad commit is
>
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
>
> commit 575260e3f8f8ac72dc0c41a4a20190d1a5f2b887
> Merge: 1cd4027 0cad93c3
> Author:     Linus Torvalds <torvalds@linux-foundation.org>
> AuthorDate: Mon Feb 20 11:19:09 2017 -0800
> Commit:     Linus Torvalds <torvalds@linux-foundation.org>
> CommitDate: Mon Feb 20 11:19:09 2017 -0800
>
>     Merge branch 'core-debugobjects-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
>
>     Pull debugobjects updates from Ingo Molnar:
>      "A number of scalability improvements by Waimang Long"
>
>     * 'core-debugobjects-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
>       debugobjects: Improve variable naming
>       debugobjects: Reduce contention on the global pool_lock
>       debugobjects: Scale thresholds with # of CPUs
>       debugobjects: Track number of kmem_cache_alloc/kmem_cache_free done
>
> 1cd4027cfe  Merge branch 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
> 0cad93c345  debugobjects: Improve variable naming
> 575260e3f8  Merge branch 'core-debugobjects-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
> +------------------------------------------------+------------+------------+------------+
> |                                                | 1cd4027cfe | 0cad93c345 | 575260e3f8 |
> +------------------------------------------------+------------+------------+------------+
> | boot_successes                                 | 202        | 90         | 0          |
> | boot_failures                                  | 0          | 2          | 26         |
> | invoked_oom-killer:gfp_mask=0x                 | 0          | 2          | 1          |
> | Mem-Info                                       | 0          | 2          | 1          |
> | WARNING:at_kernel/time/hrtimer.c:#hrtimer_init | 0          | 0          | 26         |
> +------------------------------------------------+------------+------------+------------+
>
> [    6.585095] usbcore: registered new interface driver rndis_wlan
> [    6.586060] mac80211_hwsim: initializing netlink
> [    6.587805] ieee80211 phy0: Selected rate control algorithm 'minstrel_ht'
> [    6.589765] ieee80211 phy0: hwaddr 02:00:00:00:00:00 registered
> [    6.590718] ------------[ cut here ]------------
> [    6.591473] WARNING: CPU: 0 PID: 1 at kernel/time/hrtimer.c:1090 hrtimer_init+0x11f/0x199
> [    6.592949] Invalid clockid 4. Using MONOTONIC
> [    6.593646] Modules linked in:
> [    6.594202] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.10.0-00312-g575260e3 #2
> [    6.595371] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.9.3-20161025_171302-gandalf 04/01/2014
> [    6.596852] Call Trace:
> [    6.597330]  dump_stack+0x82/0xb8
> [    6.597908]  __warn+0xc2/0xdd
> [    6.598446]  warn_slowpath_fmt+0x4b/0x53
> [    6.599090]  ? lock_is_held_type+0x4b/0x54
> [    6.599748]  hrtimer_init+0x11f/0x199
> [    6.600372]  ? mac80211_hwsim_get_tsf+0x1d/0x1d
> [    6.601089]  tasklet_hrtimer_init+0x1b/0x4f
> [    6.601758]  mac80211_hwsim_new_radio+0x7fe/0x916
> [    6.602491]  ? set_debug_rodata+0x12/0x12
> [    6.603149]  init_mac80211_hwsim+0x138/0x29f
> [    6.603834]  ? rndis_wlan_driver_init+0x1b/0x1b
> [    6.604542]  do_one_initcall+0x90/0x142
> [    6.605176]  ? set_debug_rodata+0x12/0x12
> [    6.605833]  kernel_init_freeable+0x1cb/0x258
> [    6.606522]  ? rest_init+0x13b/0x13b
> [    6.607126]  kernel_init+0xe/0xf5
> [    6.607693]  ret_from_fork+0x31/0x40
> [    6.608341] ---[ end trace e131c19313689169 ]---
> [    6.609819] ieee80211 phy1: Selected rate control algorithm 'minstrel_ht'
>
> git bisect start 37c85961c3f87f2141c84e53df31e59db072fd2e v4.10 --
> git bisect  bad fd4a61e08aa79f2b7835b25c6f94f27bd2d65990  # 03:55      0-     10  sched/core: Fix build paravirt build on arm and arm64
> git bisect  bad 280d7a1edef214eefb1cb34915c73767355dd1b3  # 04:24      0-      6  Merge branch 'x86-fpu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
> git bisect  bad 32e2d7c8afb35d59fbf7d96619538427568ecb68  # 05:02      0-      3  Merge branch 'efi-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
> git bisect good c9b9f207b90468bf9583f7ed71c15d0142bbf9b1  # 05:06     20+      1  Merge tag 'for-v4.11' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply
> git bisect good 1cd4027cfe33390dc3f442aea8e7caeeeaa861a1  # 07:19     22+      0  Merge branch 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
> git bisect  bad 575260e3f8f8ac72dc0c41a4a20190d1a5f2b887  # 07:37      0-     16  Merge branch 'core-debugobjects-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
> git bisect good 97dd552eb23c83dbf626a6e84666c7e281375d47  # 12:59     22+      0  debugobjects: Scale thresholds with # of CPUs
> git bisect good 0cad93c3453fc9d11692d3924ac3a520821bbf64  # 14:11     22+      0  debugobjects: Improve variable naming
> # first bad commit: [575260e3f8f8ac72dc0c41a4a20190d1a5f2b887] Merge branch 'core-debugobjects-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
> git bisect good 1cd4027cfe33390dc3f442aea8e7caeeeaa861a1  # 14:16     66+      0  Merge branch 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
> git bisect good 0cad93c3453fc9d11692d3924ac3a520821bbf64  # 14:21     66+      2  debugobjects: Improve variable naming
> # extra tests on HEAD of linux-review/Ming-Lei/MAINTAINERS-update-firmware-loader-entry/20170223-095208
> git bisect  bad e9a88fe6c1f018d34f582d59734f1e7da31ef9cd  # 14:21      0-     21  MAINTAINERS: update firmware loader entry
> # extra tests on tree/branch linus/master
> git bisect  bad f1ef09fde17f9b77ca1435a5b53a28b203afb81c  # 14:40      0-     39  Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace
> # extra tests on tree/branch linux-next/master
> git bisect  bad 27fde840c0aaca31213844b8bc914281cdb101fa  # 14:45      0-     26  Add linux-next specific files for 20170223
>
> ---
> 0-DAY kernel test infrastructure                Open Source Technology Center
> https://lists.01.org/pipermail/lkp                          Intel Corporation

[toc] | [next] | [standalone]


#1588038

FromFengguang Wu <wfg@linux.intel.com>
Date2017-02-25 03:00 +0100
Message-ID<tezOq-wv-3@gated-at.bofh.it>
In reply to#1587989
Hi Linus,

On Fri, Feb 24, 2017 at 02:37:04PM -0800, Linus Torvalds wrote:
>This looks like two -tip trees together show some issue - the timer
>updates from Thomas triggering a debugobjects check from Ingo, thus
>fingering my merge as the culprit.
>
>Added Thomas/Ingo to the cc, leaving everything quoted for their
>edification and enjoyment.

The call trace looks similar to the below bug, so CC mac80211
maintainer and Marc.

The discussed fix patch is for drivers/net/wireless/mac80211_hwsim.c
and is not mainlined yet due to in a different tree.

Regards,
Fengguang

----- Forwarded message from Marc Zyngier <marc.zyngier@arm.com> -----

Date: Fri, 17 Feb 2017 10:09:06 +0000
From: Marc Zyngier <marc.zyngier@arm.com>
To: Thomas Gleixner <tglx@linutronix.de>, kernel test robot <fengguang.wu@intel.com>
CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Tomasz Nowicki <tn@semihalf.com>, Christoffer Dall
	<christoffer.dall@linaro.org>, Sasha Levin <alexander.levin@verizon.com>, "linux-wireless@vger.kernel.org"
	<linux-wireless@vger.kernel.org>, Johannes Berg <johannes.berg@intel.com>
Subject: Re: [linux-stable] 4fc2942b6e kernel BUG at kernel/time/hrtimer.c:109!
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.6.0

On 17/02/17 09:28, Thomas Gleixner wrote:
> On Fri, 17 Feb 2017, kernel test robot wrote:
>
>> Hi Marc,
>>
>> We find this oops in linux-4.4.y. The gcc-6 compiled mainline kernel is fine.

The last bit is worrying, as mainline has the exact same bug. Has it
been tested the same way?

>>
>> commit 4fc2942b6e2de2efc8a9d3784d4b0d3543149613
>>      hrtimer: Catch illegal clockids
>
> And that commit is doing what the subject line says. Catch illegal usage.
>
>> [   38.101342] Call Trace:
>> [   38.101342] Call Trace:
>> [   38.102045]  [<ffffffff8109aee1>] tasklet_hrtimer_init+0x16/0x52
>> [   38.102045]  [<ffffffff8109aee1>] tasklet_hrtimer_init+0x16/0x52
>> [   38.103698]  [<ffffffff81c767c7>] mac80211_hwsim_new_radio+0x766/0x84d
>
> The real bug is in this code:
>
> drivers/net/wireless/mac80211_hwsim.c
>
> mac80211_hwsim_new_radio()
>
>         tasklet_hrtimer_init(&data->beacon_timer,
>                              mac80211_hwsim_beacon,
>                              CLOCK_MONOTONIC_RAW, HRTIMER_MODE_ABS);
>
> CLOCK_MONOTONIC_RAW is not a supported clockid for hrtimers. Sigh.
>
> Fix below.
>
> Thanks,
>
> 	tglx
>
> 8<------------------
>
> diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
> index 0cd95120bc78..da363ec91a1c 100644
> --- a/drivers/net/wireless/mac80211_hwsim.c
> +++ b/drivers/net/wireless/mac80211_hwsim.c
> @@ -2535,9 +2535,8 @@ static int mac80211_hwsim_new_radio(struct genl_info *info,
>  				    data->debugfs,
>  				    data, &hwsim_simulate_radar);
>
> -	tasklet_hrtimer_init(&data->beacon_timer,
> -			     mac80211_hwsim_beacon,
> -			     CLOCK_MONOTONIC_RAW, HRTIMER_MODE_ABS);
> +	tasklet_hrtimer_init(&data->beacon_timer, mac80211_hwsim_beacon,
> +			     CLOCK_MONOTONIC, HRTIMER_MODE_ABS);
>
>  	spin_lock_bh(&hwsim_radio_lock);
>  	list_add_tail(&data->list, &hwsim_radios);
>

Acked-by: Marc Zyngier <marc.zyngier@arm.com>

	M.
-- 
Jazz is not dead. It just smells funny...

----- End forwarded message -----

[toc] | [prev] | [next] | [standalone]


#1588132 — Re: [Merge branch 'core-debugobjects-for-linus' of git] 575260e3f8: WARNING: CPU: 0 PID: 1 at kernel/time/hrtimer.c:1090 hrtimer_init

FromMarc Zyngier <marc.zyngier@arm.com>
Date2017-02-25 12:50 +0100
SubjectRe: [Merge branch 'core-debugobjects-for-linus' of git] 575260e3f8: WARNING: CPU: 0 PID: 1 at kernel/time/hrtimer.c:1090 hrtimer_init
Message-ID<teJ1n-7a1-1@gated-at.bofh.it>
In reply to#1588038
On Sat, Feb 25 2017 at  1:54:16 am GMT, Fengguang Wu <wfg@linux.intel.com> wrote:
> Hi Linus,
>
> On Fri, Feb 24, 2017 at 02:37:04PM -0800, Linus Torvalds wrote:
>>This looks like two -tip trees together show some issue - the timer
>>updates from Thomas triggering a debugobjects check from Ingo, thus
>>fingering my merge as the culprit.
>>
>>Added Thomas/Ingo to the cc, leaving everything quoted for their
>>edification and enjoyment.
>
> The call trace looks similar to the below bug, so CC mac80211
> maintainer and Marc.
>
> The discussed fix patch is for drivers/net/wireless/mac80211_hwsim.c
> and is not mainlined yet due to in a different tree.

I enjoy running jokes as much as the next guy, but this one is starting
to get long in the tooth (I have 4 separate reports of it, and patches
have been proposed at least twice). Can someone please apply the below
patch or anything to the same effect?

Thanks,

	M.

From 8a2c82e1024caab5155db4cccbfe20b42f80acd1 Mon Sep 17 00:00:00 2001
From: Marc Zyngier <marc.zyngier@arm.com>
Date: Sat, 25 Feb 2017 10:42:36 +0000
Subject: [PATCH] mac80211_hwsim: Do not use undefined clockids

Since 336a9cde10d6 ("hrtimer: Catch invalid clockids again"),
we spit out a warning at runtime when an illegal clockid is used,
catching the offender red handed, and falling back to CLOCK_MONOTONIC.

mac80211_hwsim is trying to use CLOCK_MONOTONIC_RAW, which doesn't
exist in the kernel. Before the above fix, we would have used
clockid 0, which happens to be CLOCK_MONOTONIC. This patch simply
makes this behaviour the expected one.

Cc: Johannes Berg <johannes.berg@intel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Fixes: 1d940aaab881 ("mac80211_hwsim: use CLOCK_MONOTONIC_RAW")
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
---
 drivers/net/wireless/mac80211_hwsim.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
index 1620a5d2757d..0889fc81ce9e 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -2671,7 +2671,7 @@ static int mac80211_hwsim_new_radio(struct genl_info *info,
 
 	tasklet_hrtimer_init(&data->beacon_timer,
 			     mac80211_hwsim_beacon,
-			     CLOCK_MONOTONIC_RAW, HRTIMER_MODE_ABS);
+			     CLOCK_MONOTONIC, HRTIMER_MODE_ABS);
 
 	spin_lock_bh(&hwsim_radio_lock);
 	list_add_tail(&data->list, &hwsim_radios);
-- 
2.11.0


-- 
Jazz is not dead, it just smell funny.

[toc] | [prev] | [next] | [standalone]


#1588124

FromThomas Gleixner <tglx@linutronix.de>
Date2017-02-25 12:10 +0100
Message-ID<teIoF-6UJ-9@gated-at.bofh.it>
In reply to#1587989
On Fri, 24 Feb 2017, Linus Torvalds wrote:

> This looks like two -tip trees together show some issue - the timer
> updates from Thomas triggering a debugobjects check from Ingo, thus
> fingering my merge as the culprit.

Nah. The bisect is bogus.

> Added Thomas/Ingo to the cc, leaving everything quoted for their
> edification and enjoyment.

This has crept up in next already and I explained it a more than once to
0-day folks, that this is caused by the wireless stuff and now catched by
the sanity check of the clockids for hrtimers which got in via timers/core.

It catches the bogus hrtimer_init(CLOCK_MONOTONIC_RAW) in the wireless
code. 

> > [    6.591473] WARNING: CPU: 0 PID: 1 at kernel/time/hrtimer.c:1090 hrtimer_init+0x11f/0x199
> > [    6.592949] Invalid clockid 4. Using MONOTONIC

    	 	   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^	   

> > [    6.599748]  hrtimer_init+0x11f/0x199
> > [    6.600372]  ? mac80211_hwsim_get_tsf+0x1d/0x1d
> > [    6.601089]  tasklet_hrtimer_init+0x1b/0x4f
> > [    6.601758]  mac80211_hwsim_new_radio+0x7fe/0x916
> > [    6.602491]  ? set_debug_rodata+0x12/0x12
> > [    6.603149]  init_mac80211_hwsim+0x138/0x29f

I've sent the patch 3 times already. Here it is once more.

Thanks,

	tglx
	
8<-----------------

Subject: mac80211_hwsim: Replace bogus hrtimer clockid

mac80211_hwsim initializes a hrtimer with clockid
CLOCK_MONOTONIC_RAW. That's not supported.

Use CLOCK_MONOTNIC instead.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
index 1620a5d2757d..0889fc81ce9e 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -2671,7 +2671,7 @@ static int mac80211_hwsim_new_radio(struct genl_info *info,
 
 	tasklet_hrtimer_init(&data->beacon_timer,
 			     mac80211_hwsim_beacon,
-			     CLOCK_MONOTONIC_RAW, HRTIMER_MODE_ABS);
+			     CLOCK_MONOTONIC, HRTIMER_MODE_ABS);
 
 	spin_lock_bh(&hwsim_radio_lock);
 	list_add_tail(&data->list, &hwsim_radios);

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web