Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1009832pxb; Thu, 4 Feb 2021 02:50:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJyIuKPNaUSWRadGfNxe8c2vuFUI2SsNhnLXYb6Nq2gg3XYRC1hnrXj18/AG1dIiwRhBsIEN X-Received: by 2002:a17:906:854f:: with SMTP id h15mr7232338ejy.2.1612435806535; Thu, 04 Feb 2021 02:50:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612435806; cv=none; d=google.com; s=arc-20160816; b=G+R3sgXKNMcO/7NhRELtka2bjkv5txNdsY41t8lvfnBEoMuWjQOQpdI2RuMiApH93k 5L28/DEJJ5zJbRnKlcvN1/Tc+0VWctNzLnrxiuefM3jqJ4Caw/QSUvzLG+Zw+1T31+5S //qoUNENnBVHyoc0LKd0o4kEqebpu6B7/gpPUjGLx7CYGkNHlMAOrPX1oXn4BjN/emvF z/mnEW7w+k/BJPsGGPODrI9Kf8kJaQAufAC54pcp8s6GoiKM4/WgKSDxm3T8TZ8bHElY w9SqAqvR9sWSKkchPdaywBA3zdkBs33VvWusKBn9o6LkpMzByB5PgJXH+CpfnM4nSSdH h+0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=C3520+oeFsZquu+B/s9/U9hJT7UjxaK5iSpvR72XRis=; b=Wif2jBRt/TBpr2GQW1/Ot2IYiLlhZLqu/rPCENkEu4r6cUIBZVl5aZ8ntpx9pVOugI Eh+uUa82SWQYMuyDIxgX6Klher+c0xNPOt/Ah3VCQw+KXBn4KYUUYh4dVXrVPBxAhJqO pqp4ySw9IPaIUY80PUXZMVCEB7FfV9xs9pUL85cMcVIsjEZGO7FQ73PSykzkSBtqDjSb 3lW50A22D0OTjPWiFpyAvEKWMA2AMgtfA4LAfCbO5jfQGB7IUZD+1EzFUBITwbA3+ApI HhOVdOX8+X/rwTZptCMY76ZB2RqCXPl0PZk5WY1Lldli0x2FAT2M13OpdWUTYsShd2Hx 2Isg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s18si3224793ejd.741.2021.02.04.02.49.41; Thu, 04 Feb 2021 02:50:06 -0800 (PST) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235333AbhBDKqH (ORCPT + 99 others); Thu, 4 Feb 2021 05:46:07 -0500 Received: from foss.arm.com ([217.140.110.172]:55690 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235037AbhBDKqF (ORCPT ); Thu, 4 Feb 2021 05:46:05 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A198911D4; Thu, 4 Feb 2021 02:45:19 -0800 (PST) Received: from e107158-lin (e107158-lin.cambridge.arm.com [10.1.194.78]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id BF4243F719; Thu, 4 Feb 2021 02:45:17 -0800 (PST) Date: Thu, 4 Feb 2021 10:45:15 +0000 From: Qais Yousef To: Vincent Guittot Cc: Joel Fernandes , linux-kernel , Paul McKenney , Frederic Weisbecker , Dietmar Eggeman , Ben Segall , Daniel Bristot de Oliveira , Ingo Molnar , Juri Lelli , Mel Gorman , Peter Zijlstra , Steven Rostedt , "Uladzislau Rezki (Sony)" , Neeraj upadhyay Subject: Re: [PATCH] sched/fair: Rate limit calls to update_blocked_averages() for NOHZ Message-ID: <20210204104515.sa72pcyaihowtncx@e107158-lin> References: <20210129172727.GA30719@vingu-book> <20210203170916.ows7d2b56t34i2w4@e107158-lin> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/03/21 18:35, Vincent Guittot wrote: > > > raw_spin_unlock(&this_rq->lock); > > > - /* > > > - * This CPU is going to be idle and blocked load of idle CPUs > > > - * need to be updated. Run the ilb locally as it is a good > > > - * candidate for ilb instead of waking up another idle CPU. > > > - * Kick an normal ilb if we failed to do the update. > > > - */ > > > - if (!_nohz_idle_balance(this_rq, NOHZ_STATS_KICK, CPU_NEWLY_IDLE)) > > > > Since we removed the call to this function (which uses this_rq) > > > > > - kick_ilb(NOHZ_STATS_KICK); > > > + kick_ilb(NOHZ_STATS_KICK); > > > > And unconditionally call kick_ilb() which will find a suitable cpu to run the > > lb at regardless what this_rq is. > > > > Doesn't the below become unnecessary now? > > The end goal is to keep running on this cpu that is about to become idle. > > This patch is mainly there to check that Joel's problem disappears if > the update of the blocked load of the cpus is not done in the > newidle_balance context. I'm preparing few other patches on top to > clean up the full path +1 > > > > 10494 /* > > 10495 * This CPU doesn't want to be disturbed by scheduler > > 10496 * housekeeping > > 10497 */ > > 10498 if (!housekeeping_cpu(this_cpu, HK_FLAG_SCHED)) > > 10499 return; > > 10500 > > 10501 /* Will wake up very soon. No time for doing anything else*/ > > 10502 if (this_rq->avg_idle < sysctl_sched_migration_cost) > > 10503 return; > > > > And we can drop this_rq arg altogether? > > > > > raw_spin_lock(&this_rq->lock); > > > } > > > > > > @@ -10616,8 +10590,6 @@ static int newidle_balance(struct rq *this_rq, struct rq_flags *rf) > > > update_next_balance(sd, &next_balance); > > > rcu_read_unlock(); > > > > > > - nohz_newidle_balance(this_rq); > > > - > > > goto out; > > > } > > > > > > @@ -10683,6 +10655,8 @@ static int newidle_balance(struct rq *this_rq, struct rq_flags *rf) > > > > > > if (pulled_task) > > > this_rq->idle_stamp = 0; > > > + else > > > + nohz_newidle_balance(this_rq); > > > > Since nohz_newidle_balance() will not do any real work now, I couldn't figure > > out what moving this here achieves. Fault from my end to parse the change most > > likely :-) > > The goal is to schedule the update only if we are about to be idle and > nothing else has been queued in the meantime I see. This short coming already existed and not *strictly* related to moving update of blocked load out of newidle balance. Thanks -- Qais Yousef