Received: by 2002:ac0:a591:0:0:0:0:0 with SMTP id m17-v6csp731623imm; Thu, 5 Jul 2018 08:01:21 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcU5qXAkuG+jzZd7SGiv5dobN8x5RDhH5Qc2pCLcIJFu5ZxGRwqVDWcpOkdgjC7w3nLZE6V X-Received: by 2002:a65:6203:: with SMTP id d3-v6mr5950496pgv.420.1530802881615; Thu, 05 Jul 2018 08:01:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530802881; cv=none; d=google.com; s=arc-20160816; b=ZngyrAtipS/8+7htHQ8q7MJBbTLsKNpYOQpuIdxpX3LYhvByPcMqGTYaeB3I+6j6a0 tH0XLU6wJCDKwirUT0QIVgb3FpZAZ6EJ/Q0Kf96d/Y0e3Cd4cr2RjXcqfoC9/xAZL7hp gHCnZTsVU8JWj8OQQM99P64Wqsxm3yfmTIjd8U23KwRFfGd7Tg0ChqQbpvriXj6Q4v4W c8YbMD81Z+ULQ78+PAfSpCx47eRo4/CxDrrFrNQ/rmtPyTD17toYdCJBlD6F0sX6PHMp LYE2e0ijfq29p8UUW9jbYkpcgmE4S66rA0LXJFHLlKrWuH/UtGhGfzW82U9jot50v+Za BkXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=49D5XRtW4pZuJYovJNP30pNNBQMNiRHFjqx5LVrmSN0=; b=rd6iuARgdwnTw+C7EL84V9K77WgeI71QbWTtccmmU5/bbpBavNsihkF6AS7s6mOtAv h9ofl41KsRPIxtfHtbVk05fW1nTcFVk0jxXu7OqzZTqRslYD14QPoItmNhrGHQW+6PsE EGOE+Pr8iE1gkBhwf9icoPgKqhl1dr+zcbqcd68HhPjUBQUqcEsqiiGhllp1Vm1sxDZ5 MFyQYnK1ZRN8ZeIp+5his0VpvhkWYm4/0Bum4cRd2pHaOywT47ttk+gMTanmcB4Dqk6h +Hy9lZxBzJmUfeEd7XFt6ClRnlKY8nEQqA41aLuF/qrBu31wE6mQHpcLtlWF7VqxIJqO b98w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d35-v6si6202938pla.116.2018.07.05.08.00.57; Thu, 05 Jul 2018 08:01:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753846AbeGEO7L (ORCPT + 99 others); Thu, 5 Jul 2018 10:59:11 -0400 Received: from foss.arm.com ([217.140.101.70]:51444 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753614AbeGEO7K (ORCPT ); Thu, 5 Jul 2018 10:59:10 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 5D2CA18A; Thu, 5 Jul 2018 07:59:10 -0700 (PDT) Received: from [0.0.0.0] (e107985-lin.cambridge.arm.com [10.1.210.41]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id C66413F5BA; Thu, 5 Jul 2018 07:59:06 -0700 (PDT) Subject: Re: [lkp-robot] [sched/fair] fbd5188493: WARNING:inconsistent_lock_state To: Matt Fleming Cc: kernel test robot , Peter Zijlstra , linux-kernel@vger.kernel.org, Ingo Molnar , Mike Galbraith , lkp@01.org References: <20180705080227.GH23907@yexl-desktop> <0ac4845e-cf6b-c5e3-a16c-f2fc457c5ef5@arm.com> <7c3d20fa-4997-e6ed-3750-e054ce1bd610@arm.com> <20180705132458.GA3864@codeblueprint.co.uk> From: Dietmar Eggemann Message-ID: <42d319f5-1a3a-fb69-5ec5-d2e9836e49c9@arm.com> Date: Thu, 5 Jul 2018 16:59:02 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20180705132458.GA3864@codeblueprint.co.uk> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/05/2018 03:24 PM, Matt Fleming wrote: > On Thu, 05 Jul, at 11:52:21AM, Dietmar Eggemann wrote: >> >> Moving the code from _nohz_idle_balance to nohz_idle_balance let it disappear: >> >> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c >> index 02be51c9dcc1..070924f07c68 100644 >> --- a/kernel/sched/fair.c >> +++ b/kernel/sched/fair.c >> @@ -9596,16 +9596,6 @@ static bool _nohz_idle_balance(struct rq *this_rq, unsigned int flags, >> */ >> smp_mb(); >> >> - /* >> - * Ensure this_rq's clock and load are up-to-date before we >> - * rebalance since it's possible that they haven't been >> - * updated for multiple schedule periods, i.e. many seconds. >> - */ >> - raw_spin_lock_irq(&this_rq->lock); >> - update_rq_clock(this_rq); >> - cpu_load_update_idle(this_rq); >> - raw_spin_unlock_irq(&this_rq->lock); >> - >> for_each_cpu(balance_cpu, nohz.idle_cpus_mask) { >> if (balance_cpu == this_cpu || !idle_cpu(balance_cpu)) >> continue; >> @@ -9701,6 +9691,16 @@ static bool nohz_idle_balance(struct rq *this_rq, enum cpu_idle_type idle) >> if (!(flags & NOHZ_KICK_MASK)) >> return false; >> >> + /* >> + * Ensure this_rq's clock and load are up-to-date before we >> + * rebalance since it's possible that they haven't been >> + * updated for multiple schedule periods, i.e. many seconds. >> + */ >> + raw_spin_lock_irq(&this_rq->lock); >> + update_rq_clock(this_rq); >> + cpu_load_update_idle(this_rq); >> + raw_spin_unlock_irq(&this_rq->lock); >> + >> _nohz_idle_balance(this_rq, flags, idle); >> >> return true; >> > > Hmm.. it still looks to me like we should be saving and restoring IRQs > since this can be called from IRQ context, no? You mean in nohz_idle_balance()? Yes. I just wanted to hint that since you need this cpu_load_update_idle() in the nohz idle balance case and not in idle balance, you could just update it in nohz_idle_balance() rather than in _nohz_idle_balance() (which is also called in nohz_newidle_balance()) avoiding this inconsistent lock state warning. [...]