Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3611696pxu; Mon, 30 Nov 2020 06:51:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJwlvAmH7Hb5KsEqvdgWxuTkscvz9hKVOECGVAUNrxEu2IYgfIA9+uej4LWJaAavB2/uxu3o X-Received: by 2002:a17:906:5243:: with SMTP id y3mr21341040ejm.273.1606747918185; Mon, 30 Nov 2020 06:51:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606747918; cv=none; d=google.com; s=arc-20160816; b=C+J9sEOBb3iuTTpX6yLvhhpNis+WHucpiO36q+ew0mG2P+Qq7GYzfDTOjqGBzkCMMD lm6f6G4So+v8XTF3VAdnnZG/O5RQ/yuy6F4LemUgf9vBb302RjUP00WvurN3dzR7iYmV IqFrYhAj2xDXInA4L5umdrzRfvHCn62DMtF8fwvsZNHtm0HPnEwb+p0zt7BqX8ZaMCkr DAs1iIIfYujhQrnHpToteNmtZ1PwI62BMtmWdu1FeoYA5TZxhOyJlKzfRDUkbFYW9GbV PvNfVHpF6tOCMM/LY1LwvS9V9bcpx3KMtBD1IZzjDWcqz1hgm2okG2tyalR4f//xOsjU DXyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=VrUIm3t7/zD9+p/JP2SKsOxbaIp5CLKekidIYJeqkDo=; b=CYsfDXa1LrerlGII915sK63CK1m7DOXnXRdhXv21iykIk8N4XbfhfuzGMpm9g1SrIh ws2Xcms1otteagW2wyv1+9pO9+mWGiW1v9eK2GVjGoOHVEj83xxRNKiCbV3eHmgaz1Ro stTZdZUamoorM9LglhqfZVaBpqZYsiNpUXM3HRnt6rs5nssEqNAmLEkZP8jTLteuzh7R nWFMOTzqobmVdy4q2fvhhn5vmP/9uSCfwCLdYSIXVVk2ftjBLOAzfQCqv6HBloa/CswN 8wVku/F4potMDvNu+D76T/gs3GEobFj9lLhlrR62az2T6/L92VldHbL5+qmdcj4VAip3 hYuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tfvZlTIX; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h14si11741647eje.368.2020.11.30.06.51.34; Mon, 30 Nov 2020 06:51:58 -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; dkim=pass header.i=@linaro.org header.s=google header.b=tfvZlTIX; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727080AbgK3Orz (ORCPT + 99 others); Mon, 30 Nov 2020 09:47:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726886AbgK3Ory (ORCPT ); Mon, 30 Nov 2020 09:47:54 -0500 Received: from mail-lf1-x143.google.com (mail-lf1-x143.google.com [IPv6:2a00:1450:4864:20::143]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 389B3C0613CF for ; Mon, 30 Nov 2020 06:47:14 -0800 (PST) Received: by mail-lf1-x143.google.com with SMTP id a9so22121823lfh.2 for ; Mon, 30 Nov 2020 06:47:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=VrUIm3t7/zD9+p/JP2SKsOxbaIp5CLKekidIYJeqkDo=; b=tfvZlTIXXDAEXLK4Jp/+1iBbqGGqjaKk6ux5tOEMu6Nw2DQvwjftJjZXeSO+rusYxv rNJGypII/efIlpMNKRIy7TSJdC2YF/V678s8hg384lryL7fukB5zEBKzqY/6kpWXgUPz 3UCgdZoyBoN29z2AxCsGc3yrXOlwiUSv+gniNp1sV5G4v3YmJvlbo6nEC7UuDl11003S QN5EZcU+wEJ/bJQfep/M+ZvXfmjwy3AcJfSvZt+amvGqeId4p2l7ByzBu515zYxF2rLt cPBQbH4L7xNfbffKLXKk7XrVRMTvAgl9IGSksjW/3Q6gxQEUpJSuDjhlkdOMh1Top0DZ adIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=VrUIm3t7/zD9+p/JP2SKsOxbaIp5CLKekidIYJeqkDo=; b=PyKY+sgZS1FBjfABalj7EupnBmmsohkRvp12qHqKgqcXYxudambjCMj4jN0/hO8Ls3 q0di8gksZTpevzRzr/eQvkQel7M/8uH8OoAZL9ry96LhMuC/wBqT/Dm3MXEzeUFvvRnN mYTzTka5X5P7okxnZkmWKCSmTaHPkNarKjuudPNv68hwmqVU3AFPN3gHVRY+06ZSeVl4 jQt62hj6gp5Pi7ManKdy28dznDVImv7Cyl+Kx7UWMaUqawhnFvm3rlV3nA8EBaTNXU9F MeMkGGR8oBYAWH8jOcxkSkiKwgU0MCin8ofkBxzxCYX91TJ7cOoDfiklj7gf+be1UQiY EIQA== X-Gm-Message-State: AOAM533wZOxxQopkvwjSmLeugr3cxU/1clHaKa3T2ZmikWcoK6A8TwF9 8s8DEjaj5lV+4z4Q9aNlJtW/Ij4yv8i2GhHRsqvKQpAXnIU= X-Received: by 2002:a19:c191:: with SMTP id r139mr9748377lff.258.1606747632680; Mon, 30 Nov 2020 06:47:12 -0800 (PST) MIME-Version: 1.0 References: <20201130144020.GS3371@techsingularity.net> In-Reply-To: <20201130144020.GS3371@techsingularity.net> From: Vincent Guittot Date: Mon, 30 Nov 2020 15:47:01 +0100 Message-ID: Subject: Re: [PATCH] sched/fair: Clear SMT siblings after determining the core is not idle To: Mel Gorman Cc: Ingo Molnar , Peter Zijlstra , "Li, Aubrey" , Valentin Schneider , linux-kernel Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 30 Nov 2020 at 15:40, Mel Gorman wrote: > > The clearing of SMT siblings from the SIS mask before checking for an idle > core is a small but unnecessary cost. Defer the clearing of the siblings > until the scan moves to the next potential target. The cost of this was > not measured as it is borderline noise but it should be self-evident. Good point > > Signed-off-by: Mel Gorman Reviewed-by: Vincent Guittot > --- > kernel/sched/fair.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c > index 0d54d69ba1a5..d9acd55d309b 100644 > --- a/kernel/sched/fair.c > +++ b/kernel/sched/fair.c > @@ -6087,10 +6087,11 @@ static int select_idle_core(struct task_struct *p, struct sched_domain *sd, int > break; > } > } > - cpumask_andnot(cpus, cpus, cpu_smt_mask(core)); > > if (idle) > return core; > + > + cpumask_andnot(cpus, cpus, cpu_smt_mask(core)); > } > > /*