Received: by 2002:ac0:a591:0:0:0:0:0 with SMTP id m17-v6csp432012imm; Thu, 5 Jul 2018 02:53:55 -0700 (PDT) X-Google-Smtp-Source: AAOMgpd+wKX1XUCGylTerDDqm9y+GzO+EledBp8LVUoZXi+Hgzae8S0iHer7fzA0tqKmEa7DDy7p X-Received: by 2002:a17:902:bcc3:: with SMTP id o3-v6mr5424348pls.336.1530784435437; Thu, 05 Jul 2018 02:53:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530784435; cv=none; d=google.com; s=arc-20160816; b=nI+Ox46Xe2kGyucmyeYQlaTjI6NaB3yK8dwfwCC8759GQb2mMnmL6+PB7D+5UGXmS2 Z3w+l6p+t3AAsxau1vs/BW3bGdgxRtcWpGZ8XY8CuQ5p41n7WJFGd3l8mMH9PIFGy5is X/FHHR8zFTPOZZSe+PIDiwVyE8ZWbkvtaGqE/GlfKXsqqsLfISXGl/8eWcwXBeGGAZLy OkcvY1j1XJy4hiJtCSO1eCFy3RNCMO8D5Le2jT3cK+zP+KyevVomO0IyQS29HKbJKw/K wZgxZgybRX/O3pk2k2YxFC238l53AogC77UbBaCRy66BukZgi+hbSyYsYFKSQZvAy3eu xKUA== 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:references:cc:to:from:subject:arc-authentication-results; bh=iCuGOSd8aSu6LgqFcTh6Qvl7F370Zu9ikk//sH9qHC0=; b=FY5oRALVUFA+dw4Tg0n+wy+Jx8xdvorp2ekETMg48McaxbGDj6Gg1syqueKGMqWWtD 4huS0gLZhSNN4e9FAZASVVezvuLc8nYTuULIbRaMYZVrjEaKgshZFF+a/ekFnce1tgFi 7g5CXr9Wj9p9AAXz/dElKI/ItWU90eOvWeNK/IusXHWngkppibctIXtGUHyRoO+o6m3N Teg4DrCdes1Ic1ndL+iScetrs/mnYJfafcUvqITrDDnRrcKf6YrFG30CbQbEVVCTozK1 fSVcTnZAMd0rPhdEYY2/+ONgTVKlz1xqod0tvLgE9Bn8U4BhHchEMzP8FNVsGFkC4seB YoyQ== 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 w1-v6si5289035pgw.546.2018.07.05.02.53.41; Thu, 05 Jul 2018 02:53:55 -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 S1753403AbeGEJw0 (ORCPT + 99 others); Thu, 5 Jul 2018 05:52:26 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:46834 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753070AbeGEJwZ (ORCPT ); Thu, 5 Jul 2018 05:52:25 -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 1AE707A9; Thu, 5 Jul 2018 02:52:25 -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 8EF163F2EA; Thu, 5 Jul 2018 02:52:23 -0700 (PDT) Subject: Re: [lkp-robot] [sched/fair] fbd5188493: WARNING:inconsistent_lock_state From: Dietmar Eggemann To: kernel test robot , Matt Fleming Cc: 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> Message-ID: <7c3d20fa-4997-e6ed-3750-e054ce1bd610@arm.com> Date: Thu, 5 Jul 2018 11:52:21 +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: <0ac4845e-cf6b-c5e3-a16c-f2fc457c5ef5@arm.com> Content-Type: text/plain; charset=windows-1252 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 10:58 AM, Dietmar Eggemann wrote: > Hi, > > On 07/05/2018 10:02 AM, kernel test robot wrote: >> >> FYI, we noticed the following commit (built with gcc-7): >> >> commit: fbd51884933192c9cada60628892024495942482 ("[PATCH] sched/fair: Avoid divide by zero when rebalancing domains") >> url: https://github.com/0day-ci/linux/commits/Matt-Fleming/sched-fair-Avoid-divide-by-zero-when-rebalancing-domains/20180705-024633 >> >> >> in testcase: trinity >> with following parameters: >> >> runtime: 300s >> >> test-description: Trinity is a linux system call fuzz tester. >> test-url: http://codemonkey.org.uk/projects/trinity/ >> >> >> on test machine: qemu-system-x86_64 -enable-kvm -cpu host -smp 2 -m 1G > > [...] > >> [ 0.335612] WARNING: inconsistent lock state > > I get the same on arm64 (juno r0) during boot consistently: 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;