Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp126890pxt; Wed, 4 Aug 2021 07:25:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw7yp4Qt/I4ozwW8apvoSSZu6X+e7QkjF1eenHNzfE3wtW/vCMh9HksJ7dVwOggcV3Bqi8l X-Received: by 2002:a17:906:7b49:: with SMTP id n9mr23993540ejo.299.1628087135098; Wed, 04 Aug 2021 07:25:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628087135; cv=none; d=google.com; s=arc-20160816; b=Tt7VAl1lv1JMtxzBMhIyV3NCaqtALYHxXFCsgGLOiLJFFNcKWk4JCIDPKpG2JYmf/6 tGBZnaCx7Exh+vd8FlGwbkacOysHKZArkRoqVmPkx9zEh+3llmZwiE5cPFgnAJcHBWH1 StsbHgWj0bbTwSenmSARVCMkWquCpgwzEsIcAFtC4B0GDO601G6No0VLaCESsoHUf0m+ dSP5ISwAzxV7FlVwleCAm6IKoFd4zN8LVgRS4OqYcPoPRfF54KZ/+ixGbpLdt0CNYOtG jgcPOqhcPun0C09tsEgsF7n5YVsyp98gxyOivnpFLYryoZEoGrH8x6qi8CtCVSH8vIdy Xbbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=C9waiC/mrE05NVQ7dNHr240yX/fofrAxHtHL4jAcGqw=; b=Flf3UZVMvdcCpUgFyJa/4nInyylAaH2RMg5qxYiBstbolJX8ESCZAdqCWpha3haZBB ZWtHXPow0n0l5mrH6F63Oz7SrqnOr1N5hULgITELaw3po0POxAQ50MBvbJs8+GmUk89J 3JgI1fjH/oej85e2YA7zeleZowwcpxLCkOpf7rN3e15bFLg6RsbxR23rNWTalqXJYi48 c7c/iOE5UzW2JCzJKAVvtpGAR+lRfwHdO2Ucgy+5zDg5KY+j8/i8Mnz2mgQIuanknFbk 4pHG0FmPXvuiySFO1paTAbopHmyTgMWLgNZ8FYWw6p4iZjRrn9PAjDx6FFDVFyq2BYjm HREA== 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 w3si2444901ejc.483.2021.08.04.07.25.04; Wed, 04 Aug 2021 07:25:35 -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 S234740AbhHDL7p (ORCPT + 99 others); Wed, 4 Aug 2021 07:59:45 -0400 Received: from outbound-smtp33.blacknight.com ([81.17.249.66]:39662 "EHLO outbound-smtp33.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235848AbhHDL7o (ORCPT ); Wed, 4 Aug 2021 07:59:44 -0400 Received: from mail.blacknight.com (pemlinmail02.blacknight.ie [81.17.254.11]) by outbound-smtp33.blacknight.com (Postfix) with ESMTPS id 5A86EBAC23 for ; Wed, 4 Aug 2021 12:59:30 +0100 (IST) Received: (qmail 30195 invoked from network); 4 Aug 2021 11:59:29 -0000 Received: from unknown (HELO stampy.112glenside.lan) (mgorman@techsingularity.net@[84.203.17.255]) by 81.17.254.9 with ESMTPA; 4 Aug 2021 11:59:29 -0000 From: Mel Gorman To: Ingo Molnar Cc: Peter Zijlstra , Vincent Guittot , Valentin Schneider , Song Bao Hua , LKML , Mel Gorman Subject: [PATCH 2/2] sched/fair: Avoid a second scan of target in select_idle_cpu Date: Wed, 4 Aug 2021 12:58:57 +0100 Message-Id: <20210804115857.6253-3-mgorman@techsingularity.net> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210804115857.6253-1-mgorman@techsingularity.net> References: <20210804115857.6253-1-mgorman@techsingularity.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When select_idle_cpu starts scanning for an idle CPU, it starts with a target CPU that has already been checked by select_idle_sibling. This patch starts with the next CPU instead. Signed-off-by: Mel Gorman --- kernel/sched/fair.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 8ad7666f387c..f412b4504378 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -6249,7 +6249,7 @@ static int select_idle_cpu(struct task_struct *p, struct sched_domain *sd, bool time = cpu_clock(this); } - for_each_cpu_wrap(cpu, cpus, target) { + for_each_cpu_wrap(cpu, cpus, target + 1) { if (has_idle_core) { i = select_idle_core(p, cpu, cpus, &idle_cpu); if ((unsigned int)i < nr_cpumask_bits) -- 2.31.1