From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B5FEF368D66 for ; Wed, 13 May 2026 20:33:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.17 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778704432; cv=none; b=RZdfwgkAMd0J0wtb4p3LDpp/B/KJ8nbHlqaB5wilcHRjN4rnK2LJ5Q9mC9Y25TlIR5JOtmwGHjyl8ibGcX2BsIztVR6atI597XuWQRyI/BLqnkYpKfAcWp+Wprgnf3yny7VoLptVVcAETfSl7udeq/wuG6FYG1k8ey246cP8NE0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778704432; c=relaxed/simple; bh=UGo6DN50Uv/tRUerMamkZ/Y7eGfcGZqAsqtg5pBXdUo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=tWaC3iIZ3bWg52+XSoyq+uR9J7v5btGiCpDW+Cg2eu8mplC71kK081orr4kP35Lgqb8+TG8C0cY+tNZ697GOVTbP4d1Vt+Z57KUb10dir8QSA+lsuSHXI69dVYh7V3c2U+TyuVmEeRcL4mA/bnhGikjWsQY31/4OPeC0rEee+pE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=pass smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=SXyVODbl; arc=none smtp.client-ip=198.175.65.17 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="SXyVODbl" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1778704431; x=1810240431; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=UGo6DN50Uv/tRUerMamkZ/Y7eGfcGZqAsqtg5pBXdUo=; b=SXyVODblH1seiWkaEWmDeGSwisRQpwjwuounnu/NxGcwUFkptEIiw3EL ERSzljRetjiuM5eVVRFs5qN7S1Wa0bqXcFpicqYbmiyzudDfnSH7pVb63 GmyeJ/lM63WOiXSPDmQFXfE5JCseekmuLAIB5ALFcUeDv8lfwOddm5NBG GhjYct8t9lp7Umx44a9KUH9leNxspYaMJcYw1fG1HYk0yi0d8b4mfIeIa mqkM1noQM8q4N4Q2R43oLNzQ79lIyvdwXePjFdtan3CEezzz7wkoYFG9T tWMakTLyjcsTrBFABg/gbJgg14ba6HkY4+I6Q5RifHWV/JrKyTvKpft2o A==; X-CSE-ConnectionGUID: Y4K4TgKESPSYposRryIQOw== X-CSE-MsgGUID: Iy41SqAWTruo1d1RFJCang== X-IronPort-AV: E=McAfee;i="6800,10657,11785"; a="79623199" X-IronPort-AV: E=Sophos;i="6.23,233,1770624000"; d="scan'208";a="79623199" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by orvoesa109.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 May 2026 13:33:44 -0700 X-CSE-ConnectionGUID: g2LzkM4+RWySZsJCkY5Tbg== X-CSE-MsgGUID: UIXm4gRrQjWfkBmKQJpgDw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.23,233,1770624000"; d="scan'208";a="238076392" Received: from b04f130c83f2.jf.intel.com ([10.165.154.98]) by orviesa008.jf.intel.com with ESMTP; 13 May 2026 13:33:44 -0700 From: Tim Chen To: Peter Zijlstra , Ingo Molnar , K Prateek Nayak , Vincent Guittot Cc: Chen Yu , Juri Lelli , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , Madadi Vineeth Reddy , Hillf Danton , Shrikanth Hegde , Jianyong Wu , Yangyu Chen , Tingyin Duan , Vern Hao , Vern Hao , Len Brown , Tim Chen , Aubrey Li , Zhao Liu , Chen Yu , Adam Li , Aaron Lu , Tim Chen , Josh Don , Gavin Guo , Qais Yousef , Libo Chen , Luo Gengkun , linux-kernel@vger.kernel.org Subject: [Patch v4 11/16] sched/cache: Fix checking active load balance by only considering the CFS task Date: Wed, 13 May 2026 13:39:22 -0700 Message-Id: X-Mailer: git-send-email 2.32.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Chen Yu The currently running task cur may not be a CFS task, such as an RT or Deadline task. For non-CFS tasks, the task_util(cur) utilization average is not maintained, so this might pass a stale or meaningless value to can_migrate_llc(). Check if the task is CFS before getting its task_util(). This bug was reported by sashiko. Fixes: 714059f79ff0 ("sched/cache: Handle moving single tasks to/from their preferred LLC") Signed-off-by: Chen Yu Co-developed-by: Tim Chen Signed-off-by: Tim Chen --- kernel/sched/fair.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 9e6edd40cd80..8617cd3642c7 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -10509,7 +10509,8 @@ alb_break_llc(struct lb_env *env) /* * All tasks prefer to stay on their current CPU. * Do not pull a task from its preferred CPU if: - * 1. It is the only task running there(not too imbalance); OR + * 1. It is the only task running and does not exceed + * imbalance allowance; OR * 2. Migrating it away from its preferred LLC would violate * the cache-aware scheduling policy. */ @@ -10522,7 +10523,7 @@ alb_break_llc(struct lb_env *env) return true; cur = rcu_dereference_all(env->src_rq->curr); - if (cur) + if (cur && cur->sched_class == &fair_sched_class) util = task_util(cur); if (can_migrate_llc(env->src_cpu, env->dst_cpu, -- 2.32.0