Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3900999pxu; Wed, 9 Dec 2020 03:36:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJwh4gwYMZkSdZY2WM4RSMctbo19JDqOBD98cz/c8o/5N1x/s12TFeMw18Z6AHZylMPeUXk0 X-Received: by 2002:aa7:c358:: with SMTP id j24mr1584459edr.265.1607513788125; Wed, 09 Dec 2020 03:36:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607513788; cv=none; d=google.com; s=arc-20160816; b=Jwc+qaykBS6jCotFtTJg1GLRWtG8pLAGFI5k3D6MeU6igNUZF/J+3FMAm1DOyDM2Od cWdlcVukeu4NTthkMtv47FytIUtYpnzpzdNpaxKQmz+If8PoQkywKdbsHUGiCT3f6A++ 2XWFlHN+URKKt/3e5RAt4OAwEjRd6TmxbBiRSvGDdpxxjbFC9hZO/nCwXs+Nq01SU57/ 0JUqhAg3Syq0d6+EuS/tsOdyquxR7flMWGWfFyiRKUlGyucI3ZGmUJ5oIkVOLnPIUFt+ bNz74Ag+gQqhPz8k2+7NSovDKa1mrjWkagph1vVZsc1Fe2VbkyqUWzqttK4Iyjo/Hmr2 i6vQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=NPfFfrElIDStONDJkMvIeLOLZ7+ijtyaKRs9tvGh5pY=; b=xr5IIEVAzte31CO7AplsHnC9faFVIHuRF8lNAxZPM8mIhTBeFZWiRjofW8lCEPZs4L CtAIFfLY+4Zf//9GradeBvJ06thXLujEYuDpXcnKjVbegnOLgyAKxWU+iYqxPb/m8AbU pEfDtCktrsTN45d3Cspd3LjlhxxH3Lu3/VEujG6IySHS9207d5qhJKbw/hma9Ucvpjrq 68YqS/bbL/sMMSiCEhQ+StjHHmUPxZDjGM3BWMJu92dx6r33JXne/3oGDi7Qd0lWpxxn iAlcknWUCaf37VAiz0Lhugc7S3PfKxbXlgbQ4LiyUrpxjpA9ZoXR6+fQ6/4oVrQAQhi7 sPAw== 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 x11si601472ejb.241.2020.12.09.03.36.05; Wed, 09 Dec 2020 03:36:28 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730800AbgLILdy (ORCPT + 99 others); Wed, 9 Dec 2020 06:33:54 -0500 Received: from outbound-smtp15.blacknight.com ([46.22.139.232]:33277 "EHLO outbound-smtp15.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729988AbgLILdy (ORCPT ); Wed, 9 Dec 2020 06:33:54 -0500 Received: from mail.blacknight.com (pemlinmail02.blacknight.ie [81.17.254.11]) by outbound-smtp15.blacknight.com (Postfix) with ESMTPS id 93DE71C3E97 for ; Wed, 9 Dec 2020 11:33:02 +0000 (GMT) Received: (qmail 24101 invoked from network); 9 Dec 2020 11:33:02 -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); 9 Dec 2020 11:33:02 -0000 Date: Wed, 9 Dec 2020 11:33:00 +0000 From: Mel Gorman To: "Li, Aubrey" Cc: Vincent Guittot , Peter Ziljstra , Ingo Molnar , LKML , Barry Song , Juri Lelli , Valentin Schneider , Linux-ARM Subject: Re: [PATCH 2/4] sched/fair: Move avg_scan_cost calculations under SIS_PROP Message-ID: <20201209113300.GN3371@techsingularity.net> References: <20201208153501.1467-1-mgorman@techsingularity.net> <20201208153501.1467-3-mgorman@techsingularity.net> <3255625e-fa92-dc09-9fab-5621122f4af0@linux.intel.com> <20201209090507.GM3371@techsingularity.net> <14963d1e-02ea-c298-d6b4-2db637913ee3@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <14963d1e-02ea-c298-d6b4-2db637913ee3@linux.intel.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 09, 2020 at 07:07:11PM +0800, Li, Aubrey wrote: > On 2020/12/9 17:05, Mel Gorman wrote: > > On Wed, Dec 09, 2020 at 01:28:11PM +0800, Li, Aubrey wrote: > >>>> nr = div_u64(span_avg, avg_cost); > >>>> else > >>>> nr = 4; > >>>> - } > >>>> - > >>>> - time = cpu_clock(this); > >>>> > >>>> - cpumask_and(cpus, sched_domain_span(sd), p->cpus_ptr); > >>>> + time = cpu_clock(this); > >>>> + } > >>>> > >>>> for_each_cpu_wrap(cpu, cpus, target) { > >>>> if (!--nr) > >> > >> nr is the key of this throttling mechanism, need to be placed under sched_feat(SIS_PROP) as well. > >> > > > > It isn't necessary as nr in initialised to INT_MAX if !SIS_PROP. > >If !SIS_PROP, nr need to -1 then tested in the loop, instead of testing directly. > But with SIS_PROP, need adding a test in the loop. > Since SIS_PROP is default true, I think it's okay to keep the current way. > It's because it's default true and the cost is negligible that I'm leaving it alone. The branch cost and nr accounting cost is negligible and it avoids peppering select_idle_cpu() with too many SIS_PROP checks. -- Mel Gorman SUSE Labs