Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3399714pxv; Mon, 26 Jul 2021 03:25:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw1wmgZJtuY4BeTxyLQrtbd32jS5A00RM/nIYqMcVyvqH7QrcRnG2y6LBgWvp/5CmNx5b4Y X-Received: by 2002:a05:6638:33a6:: with SMTP id h38mr15933104jav.130.1627295113351; Mon, 26 Jul 2021 03:25:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627295113; cv=none; d=google.com; s=arc-20160816; b=njZQt+rjvvrwi67BEHjIa3ziK/ebL8wW9zvqVbILX96xu2tmSnnW4+euDhLxkv9CB4 mP5RkzCKFyQCDGPrglGnrVLOY1rX9XMCdFLD7gspP5Om6VTpuO1rXs4zZBoaxNW0H2Zk PXKGaII9WivFu+cCvr7Cf2jUNcWVAJJOul6fdy0aEOwc78R01L/VrBvxVy7s1lQR8h/d JGvH2SxROFCV4GNtZpdV49YZWpJs5rsRWiaFRs+TMQWicc60QUg44DxfjVb9tx7cXo1A W+GSefhxWJ4JO8SZb/FeQ5oPam90EAhYOOEtYTHEoQn5SOskmaXr02CV+SN/2m/iIVeJ eHig== 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=ZaITgwAqphXC0iGqvBNyCQS7BH7uHKMgQ5O2XVAylSk=; b=IDIC/7Nijmu24EZX3ptdYXZcuzVeIZjg/yVGvSDciUALcm1dCuntxaWn+apE/BXgMn OmtSuldZIbuXM6G/7MlA+7NO9oZD3VxjMi70ftB/AUBW84owb/3aOX+7V1qM/jBOBI+S xXnA9H3Puy6e9DS0Kp4JaTX/OXqM6oCSnvcjaCcuqsNi5ziWSWHYlRBe7knHMvltp85m GfoVM1SnVlMvVhsoZTdyBx+khwBbmBvDFMnFXCSlI136mMJPybeEiB6MZ3WLRWYpHgP9 sAofaatkCKQPO9DZZNGQucvOpdqxfwmCFmCVeclc0SBlk1bIVdUor9ge10Dam5lU1r53 st1Q== 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 p19si29874448iov.90.2021.07.26.03.25.02; Mon, 26 Jul 2021 03:25:13 -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 S232834AbhGZJnX (ORCPT + 99 others); Mon, 26 Jul 2021 05:43:23 -0400 Received: from outbound-smtp26.blacknight.com ([81.17.249.194]:55334 "EHLO outbound-smtp26.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232099AbhGZJnV (ORCPT ); Mon, 26 Jul 2021 05:43:21 -0400 Received: from mail.blacknight.com (pemlinmail06.blacknight.ie [81.17.255.152]) by outbound-smtp26.blacknight.com (Postfix) with ESMTPS id BAEB8CAC8A for ; Mon, 26 Jul 2021 11:23:49 +0100 (IST) Received: (qmail 23264 invoked from network); 26 Jul 2021 10:23:49 -0000 Received: from unknown (HELO stampy.112glenside.lan) (mgorman@techsingularity.net@[84.203.17.255]) by 81.17.254.9 with ESMTPA; 26 Jul 2021 10:23:49 -0000 From: Mel Gorman To: LKML Cc: Ingo Molnar , Peter Zijlstra , Vincent Guittot , Valentin Schneider , Aubrey Li , Mel Gorman Subject: [PATCH 5/9] sched/fair: Avoid a second scan of target in select_idle_cpu Date: Mon, 26 Jul 2021 11:22:43 +0100 Message-Id: <20210726102247.21437-6-mgorman@techsingularity.net> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210726102247.21437-1-mgorman@techsingularity.net> References: <20210726102247.21437-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 75ff991a460a..125c020746b8 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -6254,7 +6254,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.26.2