Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1860924ybt; Thu, 2 Jul 2020 16:12:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxXcjRcPH6HiWyvHLzfcFMlYf5aLinpinoeTEgoOXOnt3b3FtuMpbb+lWLXLhkCl5qG0AbT X-Received: by 2002:a17:906:c056:: with SMTP id bm22mr20505761ejb.444.1593731526419; Thu, 02 Jul 2020 16:12:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593731526; cv=none; d=google.com; s=arc-20160816; b=SQl10HgA6IBx1FbqfTTN5d2lcMWO0wCx2eERLMnvELPy+5YAUlAePio7uCbhvhJI3r 7CQcIVbdIelusLQmfwRT9spyaB7ric0ciXTimyfESIagppJfZ/nMsREPncYj24E2EEar qmiGZNCxlZ91V7xyCLW/VPlKoC45GSNM5YVB59C9uMq2grD1S2DqRxtkwWRCETassrGs soMXN+P44rlQG9FIpTk+AjZjxG5G+x7ZhF9SOVmcVpHKfuWE/d60CLWpOS6jd1BsHYIj p3fDFjQFQikeZghJqHMdr9lFq20uHOVDhIf5mDkm5u/zsbwnEoPUxMtmiJI45xcC7gLE DkLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=YaPYZxtqAE+9HgLmxCp4mta0nE3AiTRHy3Gg9wxlyPk=; b=qxg8GNZnkG6d9Vqhm2QCzZ1rp+JcGFEjUsWDpuVSSKs2FIHlhIr1Bb6ONCdfB9jc3a 8mrhMpFyknV/KRldg+MN3xxuKGhLp6+zYFoyVMb2Px1AUg1H5A1qW/PBvnMIFwXib/Cj SONMRLb33blkoJ7dPlDjz5PjtHcSp2nh8roanTH6bsSeyDLpLt7pnmjVMet0KAoBt6ot xYeIg0izWKzLD70D2AC9HvLnUf/Wa69lbyMYCNiaqeO9N8w8Z7T/tq95WrLuy5WS81Mw gVnUj7iQamMC+thSTX5P2pxNTXNkqyOE7Bf2kWBwmEYpyxHYU9W4rYoK7FFggRxRBuMv vGBQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t16si6935146edc.161.2020.07.02.16.11.43; Thu, 02 Jul 2020 16:12:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726786AbgGBXLZ (ORCPT + 99 others); Thu, 2 Jul 2020 19:11:25 -0400 Received: from mx2.suse.de ([195.135.220.15]:47238 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726753AbgGBXLU (ORCPT ); Thu, 2 Jul 2020 19:11:20 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id E973BAD3A; Thu, 2 Jul 2020 23:11:18 +0000 (UTC) Received: by lion.mk-sys.cz (Postfix, from userid 1000) id 2D8A4604BB; Fri, 3 Jul 2020 01:11:18 +0200 (CEST) Date: Fri, 3 Jul 2020 01:11:18 +0200 From: Michal Kubecek To: Mel Gorman Cc: Dave Jones , Linux Kernel , peterz@infradead.org, mingo@kernel.org, Linus Torvalds , "Paul E. McKenney" , Paul Gortmaker , Thomas Gleixner Subject: Re: weird loadavg on idle machine post 5.7 Message-ID: <20200702231118.gjgbi64c55gf7fvf@lion.mk-sys.cz> References: <20200702171548.GA11813@codemonkey.org.uk> <20200702213627.GF3183@techsingularity.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200702213627.GF3183@techsingularity.net> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 02, 2020 at 10:36:27PM +0100, Mel Gorman wrote: > > It builds, not booted, it's for discussion but maybe Dave is feeling brave! > > diff --git a/kernel/sched/core.c b/kernel/sched/core.c > index ca5db40392d4..52c73598b18a 100644 > --- a/kernel/sched/core.c > +++ b/kernel/sched/core.c > @@ -2592,9 +2592,6 @@ try_to_wake_up(struct task_struct *p, unsigned int state, int wake_flags) > } > > #ifdef CONFIG_SMP > - p->sched_contributes_to_load = !!task_contributes_to_load(p); > - p->state = TASK_WAKING; > - > /* > * Ensure we load p->on_cpu _after_ p->on_rq, otherwise it would be > * possible to, falsely, observe p->on_cpu == 0. > @@ -2650,6 +2647,13 @@ try_to_wake_up(struct task_struct *p, unsigned int state, int wake_flags) > */ > smp_cond_load_acquire(&p->on_cpu, !VAL); > > + /* > + * p is off the cpu and pi_lock is held to p->state is stable > + * for calculating whether it contributes to load. > + */ > + p->sched_contributes_to_load = !!task_contributes_to_load(p); > + p->state = TASK_WAKING; > + > cpu = select_task_rq(p, p->wake_cpu, SD_BALANCE_WAKE, wake_flags); > if (task_cpu(p) != cpu) { > wake_flags |= WF_MIGRATED; > > -- I felt brave but something is probably wrong: I tried to boot three times and all three attempts crashed during boot, all three in scheduler related functions: set_next_entity() check_preempt_wakeup() finish_task_switch() I left my USB-to-serial adapter in the office but I'll try again tomorrow on a test machine with serial console. Michal