From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932793AbdBVObl (ORCPT ); Wed, 22 Feb 2017 09:31:41 -0500 Received: from mail-pg0-f51.google.com ([74.125.83.51]:33028 "EHLO mail-pg0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932444AbdBVObd (ORCPT ); Wed, 22 Feb 2017 09:31:33 -0500 Subject: Re: 9908859acaa9 cpuidle/menu: add per CPU PM QoS resume latency consideration To: Mike Galbraith , Peter Zijlstra References: <1487768197.27533.5.camel@gmx.de> <20170222131218.GS6515@twins.programming.kicks-ass.net> <1487769542.4487.2.camel@gmx.de> Cc: LKML From: Alex Shi Message-ID: Date: Wed, 22 Feb 2017 22:31:26 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <1487769542.4487.2.camel@gmx.de> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/22/2017 09:19 PM, Mike Galbraith wrote: > On Wed, 2017-02-22 at 14:12 +0100, Peter Zijlstra wrote: >> On Wed, Feb 22, 2017 at 01:56:37PM +0100, Mike Galbraith wrote: >>> Hi, >>> >>> Do we really need a spinlock for that in the idle loop? >> >> Urgh, that's broken on RT, you cannot schedule the idle loop. > > That's what made me notice the obnoxious little bugger. Hi Mike, Sorry for this bug. Guess the rt_spin_lock call some function in rtmutex.c:995. Could you like to show me how to reproduce this bug? > > [ 77.608340] BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:995 > [ 77.608342] in_atomic(): 1, irqs_disabled(): 1, pid: 0, name: swapper/1 > [ 77.608343] INFO: lockdep is turned off. > [ 77.608344] irq event stamp: 59222 > [ 77.608353] hardirqs last enabled at (59221): [] rcu_idle_exit+0x2f/0x50 > [ 77.608362] hardirqs last disabled at (59222): [] do_idle+0x9a/0x290 > [ 77.608372] softirqs last enabled at (0): [] copy_process.part.34+0x5f1/0x22a0 > [ 77.608374] softirqs last disabled at (0): [< (null)>] (null) > [ 77.608374] Preemption disabled at: > [ 77.608383] [] schedule_preempt_disabled+0x22/0x30 > [ 77.608387] CPU: 1 PID: 0 Comm: swapper/1 Tainted: G W E 4.11.0-rt9-rt #163 > [ 77.608389] Hardware name: Intel Corporation BRICKLAND/BRICKLAND, BIOS BRHSXSD1.86B.0056.R01.1409242327 09/24/2014 > [ 77.608390] Call Trace: > [ 77.608399] dump_stack+0x85/0xc8 > [ 77.608405] ___might_sleep+0x15d/0x260 > [ 77.608409] rt_spin_lock+0x24/0x80 > [ 77.608419] dev_pm_qos_read_value+0x1e/0x40 > [ 77.608424] menu_select+0x56/0x3e0 > [ 77.608426] ? rcu_eqs_enter_common.isra.40+0x9d/0x160 > [ 77.608435] cpuidle_select+0x13/0x20 > [ 77.608438] do_idle+0x182/0x290 > [ 77.608445] cpu_startup_entry+0x48/0x50 > [ 77.608450] start_secondary+0x133/0x160 > [ 77.608453] start_cpu+0x14/0x14 >