Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp112177pxj; Mon, 17 May 2021 22:30:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz+jduEEjrT0CJfhAprMIyHFFXno6/6UhOi46ZHW/TymsVQJ0AEt5DwtFcv01qBCE0N3eyb X-Received: by 2002:a17:907:9895:: with SMTP id ja21mr4318520ejc.426.1621315828745; Mon, 17 May 2021 22:30:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621315828; cv=none; d=google.com; s=arc-20160816; b=QfqYdRbT2Gw8Gf2r+QPwMfDhtzQJsig5n+iSv0YgaDLTX7YMwNgzWLjNovLwK0BOrL /xgWZeXp6f4v3+K/E4QGpS1R63SqVjwq1dQBqvAUcO78x/rylQtkO/M/j4L37myhDkDN l8nBQTLY0iDpV+Hg4Oz0soaJD9NPs1K0R66jQZPZEke7r3WxFC1Db0IBNqmu+/+d1Cyi aw9/scXkgp66aOJdJ9mBFEXzYFMsbfTB0ebiPjxI2B/R8wf/5okuWCDv9TmX4e2cgL27 3t5WjiTj84Ibdg/aXWGjcVKJiATDMZfY+AZjAQvn2KlqmgcT1tQ0pDNA1e1VkByZuR32 x7oQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=4GiaT74TnAESe3cq119Fy3hiRXC+t5PXDhZOy7yoJ+8=; b=o7sb1/Ld9V06CEu5vqPaSHYv7oxLLXRLy8CPrgmJO+8lDsqCXYNbeyIRvVYj3u7MVW Y3BSJRhdkMnpiag6DYALscEbIYVW7aQM5uPW+3LPAUphzVW1kUZzmggm/yHZFdTWuStT j4RWsm12vKzUl5ZnfqeTr3JNjXxXhkmLVuBvjI3gO01w8x1KDt9XXjCKqRP5hkZ6dY1b /WgDQntQwjUNnAnRSk1lJ/lL7d1RaA07NVil787Xdo3WlLH109lf9pNX+mpsMv8/KLFB wfBCVJU4IvX5zTIXzoL7nDog6uMQiC7tbG+nY+3eVxZOisdDjUOoH0YfTq6wGFf5k7tn E3LA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=VeYKcOhZ; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z22si12885219edm.578.2021.05.17.22.30.05; Mon, 17 May 2021 22:30:28 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=VeYKcOhZ; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240551AbhEQOq1 (ORCPT + 99 others); Mon, 17 May 2021 10:46:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:58372 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240462AbhEQOiM (ORCPT ); Mon, 17 May 2021 10:38:12 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1620A611EE; Mon, 17 May 2021 14:18:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621261082; bh=4f5ImuLCx27GIWpCDz8Y4TtSbqGDF6WydHXlpM/QCWQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VeYKcOhZNRONGJJGpGNSaS731DbgBZ+h5eeTjNqXl6p6eL3qw+YkWAzDey3jKWCi1 NygLvFDociixr/0jHKdECJBUWF5LmCZcHMZ4rURjhwpfnJSG6TL5cMC32SHiOZNMUF EPUJp4ue3D46JFem1KJwTdYponF3BwQZ6TAs/MxI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Gautham R. Shenoy" , Ingo Molnar , Vincent Guittot , Srikar Dronamraju , Mel Gorman , Sasha Levin Subject: [PATCH 5.12 303/363] sched/fair: Fix clearing of has_idle_cores flag in select_idle_cpu() Date: Mon, 17 May 2021 16:02:49 +0200 Message-Id: <20210517140312.840169767@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517140302.508966430@linuxfoundation.org> References: <20210517140302.508966430@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Gautham R. Shenoy [ Upstream commit 02dbb7246c5bbbbe1607ebdc546ba5c454a664b1 ] In commit: 9fe1f127b913 ("sched/fair: Merge select_idle_core/cpu()") in select_idle_cpu(), we check if an idle core is present in the LLC of the target CPU via the flag "has_idle_cores". We look for the idle core in select_idle_cores(). If select_idle_cores() isn't able to find an idle core/CPU, we need to unset the has_idle_cores flag in the LLC of the target to prevent other CPUs from going down this route. However, the current code is unsetting it in the LLC of the current CPU instead of the target CPU. This patch fixes this issue. Fixes: 9fe1f127b913 ("sched/fair: Merge select_idle_core/cpu()") Signed-off-by: Gautham R. Shenoy Signed-off-by: Ingo Molnar Reviewed-by: Vincent Guittot Reviewed-by: Srikar Dronamraju Acked-by: Mel Gorman Link: https://lore.kernel.org/r/1620746169-13996-1-git-send-email-ego@linux.vnet.ibm.com Signed-off-by: Sasha Levin --- 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 edcabae5c658..a073a839cd06 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -6212,7 +6212,7 @@ static int select_idle_cpu(struct task_struct *p, struct sched_domain *sd, bool } if (has_idle_core) - set_idle_cores(this, false); + set_idle_cores(target, false); if (sched_feat(SIS_PROP) && !has_idle_core) { time = cpu_clock(this) - time; -- 2.30.2