From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F206FC2D0E4 for ; Tue, 17 Nov 2020 11:43:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 98B052465E for ; Tue, 17 Nov 2020 11:43:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728238AbgKQLnW (ORCPT ); Tue, 17 Nov 2020 06:43:22 -0500 Received: from outbound-smtp25.blacknight.com ([81.17.249.193]:42406 "EHLO outbound-smtp25.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725355AbgKQLnW (ORCPT ); Tue, 17 Nov 2020 06:43:22 -0500 Received: from mail.blacknight.com (pemlinmail06.blacknight.ie [81.17.255.152]) by outbound-smtp25.blacknight.com (Postfix) with ESMTPS id 87A53CAFE3 for ; Tue, 17 Nov 2020 11:43:20 +0000 (GMT) Received: (qmail 27865 invoked from network); 17 Nov 2020 11:43:20 -0000 Received: from unknown (HELO techsingularity.net) (mgorman@techsingularity.net@[84.203.22.4]) by 81.17.254.9 with ESMTPSA (AES256-SHA encrypted, authenticated); 17 Nov 2020 11:43:19 -0000 Date: Tue, 17 Nov 2020 11:43:18 +0000 From: Mel Gorman To: Peter Zijlstra Cc: Will Deacon , Davidlohr Bueso , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Tejun Heo Subject: Re: [PATCH] sched: Fix rq->nr_iowait ordering Message-ID: <20201117114318.GX3371@techsingularity.net> References: <20201116091054.GL3371@techsingularity.net> <20201116131102.GA29992@willie-the-truck> <20201116133721.GQ3371@techsingularity.net> <20201116142005.GE3121392@hirez.programming.kicks-ass.net> <20201116193149.GW3371@techsingularity.net> <20201117083016.GK3121392@hirez.programming.kicks-ass.net> <20201117093829.GD3121429@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <20201117093829.GD3121429@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 17, 2020 at 10:38:29AM +0100, Peter Zijlstra wrote: > Subject: sched: Fix rq->nr_iowait ordering > From: Peter Zijlstra > Date: Thu, 24 Sep 2020 13:50:42 +0200 > > schedule() ttwu() > deactivate_task(); if (p->on_rq && ...) // false > atomic_dec(&task_rq(p)->nr_iowait); > if (prev->in_iowait) > atomic_inc(&rq->nr_iowait); > > Allows nr_iowait to be decremented before it gets incremented, > resulting in more dodgy IO-wait numbers than usual. > > Note that because we can now do ttwu_queue_wakelist() before > p->on_cpu==0, we lose the natural ordering and have to further delay > the decrement. > > Fixes: Fixes: c6e7bd7afaeb ("sched/core: Optimize ttwu() spinning on p->on_cpu") > Reported-by: Tejun Heo > Signed-off-by: Peter Zijlstra (Intel) s/Fixes: Fixes:/Fixes:/ Ok, very minor hazard that the same logic gets duplicated that someone might try "fix" but git blame should help. Otherwise, it makes sense as I've received more than one "bug" that complained that a number was larger than they expected even if no other problem was present so Acked-by: Mel Gorman -- Mel Gorman SUSE Labs From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 12A0BC5519F for ; Tue, 17 Nov 2020 11:45:04 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 88D98223AB for ; Tue, 17 Nov 2020 11:45:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="kU1xdArm" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 88D98223AB Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=techsingularity.net Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=GgDDo4vEQcsRnaEE4085avBm7AnbaFszDcAdXHrPImo=; b=kU1xdArm0QOnjbMtiTQ7W8iDt kLgVpLfbkszZfw/8p2BMJy6GwHN/psbMdVr58yR1N/b1jPddI+gdKA8NMqUZFqbWaVqaDnHUAQ0F2 Dyq8qJm3cmMpmH15tlMW3bKddrTbie8JstlOTtAacdipf4FX8JVcEx1J8QyUROuoKgdeYtF53LxBu qINvuyuuHIut/jDNQkHflejzw7PHPMOp9Vi5FRSAwE2Du737fqXaurdTHfC8kHoDoLxNSSzuL1uIN DGOC8JEWlBytkVAOwE6QVj+xk8WGbZ7vc+ftwNoG8PjY+wUXJ+Cf7CmYD78kpnGgXRmWLYTZ/gXF1 mR9CfTgwA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kezOU-0007ng-RZ; Tue, 17 Nov 2020 11:43:31 +0000 Received: from outbound-smtp11.blacknight.com ([46.22.139.106]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kezOP-0007n2-Rc for linux-arm-kernel@lists.infradead.org; Tue, 17 Nov 2020 11:43:27 +0000 Received: from mail.blacknight.com (pemlinmail06.blacknight.ie [81.17.255.152]) by outbound-smtp11.blacknight.com (Postfix) with ESMTPS id 859121C4874 for ; Tue, 17 Nov 2020 11:43:20 +0000 (GMT) Received: (qmail 27865 invoked from network); 17 Nov 2020 11:43:20 -0000 Received: from unknown (HELO techsingularity.net) (mgorman@techsingularity.net@[84.203.22.4]) by 81.17.254.9 with ESMTPSA (AES256-SHA encrypted, authenticated); 17 Nov 2020 11:43:19 -0000 Date: Tue, 17 Nov 2020 11:43:18 +0000 From: Mel Gorman To: Peter Zijlstra Subject: Re: [PATCH] sched: Fix rq->nr_iowait ordering Message-ID: <20201117114318.GX3371@techsingularity.net> References: <20201116091054.GL3371@techsingularity.net> <20201116131102.GA29992@willie-the-truck> <20201116133721.GQ3371@techsingularity.net> <20201116142005.GE3121392@hirez.programming.kicks-ass.net> <20201116193149.GW3371@techsingularity.net> <20201117083016.GK3121392@hirez.programming.kicks-ass.net> <20201117093829.GD3121429@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20201117093829.GD3121429@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201117_064326_068250_92E9EB9C X-CRM114-Status: GOOD ( 10.27 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tejun Heo , Davidlohr Bueso , Will Deacon , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Nov 17, 2020 at 10:38:29AM +0100, Peter Zijlstra wrote: > Subject: sched: Fix rq->nr_iowait ordering > From: Peter Zijlstra > Date: Thu, 24 Sep 2020 13:50:42 +0200 > > schedule() ttwu() > deactivate_task(); if (p->on_rq && ...) // false > atomic_dec(&task_rq(p)->nr_iowait); > if (prev->in_iowait) > atomic_inc(&rq->nr_iowait); > > Allows nr_iowait to be decremented before it gets incremented, > resulting in more dodgy IO-wait numbers than usual. > > Note that because we can now do ttwu_queue_wakelist() before > p->on_cpu==0, we lose the natural ordering and have to further delay > the decrement. > > Fixes: Fixes: c6e7bd7afaeb ("sched/core: Optimize ttwu() spinning on p->on_cpu") > Reported-by: Tejun Heo > Signed-off-by: Peter Zijlstra (Intel) s/Fixes: Fixes:/Fixes:/ Ok, very minor hazard that the same logic gets duplicated that someone might try "fix" but git blame should help. Otherwise, it makes sense as I've received more than one "bug" that complained that a number was larger than they expected even if no other problem was present so Acked-by: Mel Gorman -- Mel Gorman SUSE Labs _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel