From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.18]) (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 D76E5378D8A for ; Mon, 27 Jul 2026 01:39:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785116373; cv=none; b=Q3jdW6k1N1va3raL0NoP6cub7tMLjOP/pAteigtaf6JgXbbC6CMequcm9Iz8VkGlWBaDE6DWIWRAq8nifV8k4I428cTBLqO7o8HQAqZm9UHkWnCKShS9BA6HnNO7STBCF4WwALrzF30zRcU6qdNCbmZm2AnSkWGzxAS+5qcxLGU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785116373; c=relaxed/simple; bh=R/rdHYO11u+sL6zuonJpoUbnQYNyAXtMQOVBeuaFq0U=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=KAbIDrFBlw6cWsxLmuS8oWb4uNIchAexYhPuBstjI0VKOeDmPOZEoZC/SApDH3U7c5neCvrP/SbMt/ZywJnzVl8I7QlJEI2qD+ID0Ws7EJh66girNbVOKpAXgju6gxOZGb9rC9I3rWqRk5xbfj9iDNHlpwPzZhGYl8GEyB0Tv5Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=Tv07eATy; arc=none smtp.client-ip=192.198.163.18 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Tv07eATy" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1785116370; x=1816652370; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=R/rdHYO11u+sL6zuonJpoUbnQYNyAXtMQOVBeuaFq0U=; b=Tv07eATyz4J4lIsWKP9KCMdCG6P+Hn8B9ww38rBNe9/Noo2scCIj9Fs8 Pi+OZMv7rc1o+WDeYxhbddMIduuhDNL614k7rB70g73tPJHsuVwdYNqS9 nLzoBLlS6vkegyhtEUJFPuY5H+jx5ArDaukUjgXtwNDujOjuQ0wIk3+rr 3rrRVRBNW8RoNXO80n1Gzj6535ZOQW7zXmg4rilx08D0e/CW/kTvfa1SX DCAYSd+9He9DyfAs0s7U12LNPP6NRIUwPgLlmshLLmVAAyqX2CbQePG9O J4kZiU8uq3t0S6C6bZtVTUbFnjafwwHPDhdH4ROcaZwS+r9vghg1rAVvU Q==; X-CSE-ConnectionGUID: wJWR3fUwSJKsSMIB4nhx0w== X-CSE-MsgGUID: ADpVxjhWT260eDMz7w/6+g== X-IronPort-AV: E=McAfee;i="6800,10657,11857"; a="84805183" X-IronPort-AV: E=Sophos;i="6.25,187,1779174000"; d="scan'208";a="84805183" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by fmvoesa112.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jul 2026 18:39:27 -0700 X-CSE-ConnectionGUID: OjLiAyBZQa+LrSIZWQnrsQ== X-CSE-MsgGUID: Unphd7eNSQaAC66bmPB2gg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.25,187,1779174000"; d="scan'208";a="259907041" Received: from chenyu-dev.sh.intel.com ([10.239.62.107]) by orviesa009.jf.intel.com with ESMTP; 26 Jul 2026 18:39:24 -0700 From: Chen Yu To: Peter Zijlstra , Vincent Guittot Cc: K Prateek Nayak , Ingo Molnar , Juri Lelli , Tim Chen , Valentin Schneider , Mel Gorman , Steven Rostedt , Dietmar Eggemann , Ben Segall , linux-kernel@vger.kernel.org, Chen Yu , Yi Lai Subject: [PATCH] sched/cache: Fix a thread aggregation conflict when there is one runnable task Date: Mon, 27 Jul 2026 09:29:14 +0800 Message-Id: <20260727012914.229171-1-yu.c.chen@intel.com> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit On systems with SD_ASYM_PACKING set at the PKG domain level (e.g., with ITMT enabled), the sched_asym() check in sched_balance_find_src_rq() prevents pulling a single task from a higher-priority CPU to a lower-priority CPU. This blocks migrate_llc_task migrations where a task wants to move to its preferred LLC for cache locality. For example, CPU 0 (highest priority) has a task preferring LLC3, but the load balancer on CPU 120 (LLC3) cannot pull it because: sched_asym(PKG_sd, cpu=0, dst_cpu=120) and nr_running == 1 The task remains stuck in the wrong LLC indefinitely. Fix this by exempting migrate_llc_task from the sched_asym filter. Fixes: e4c9a4cb244a ("sched/cache: Add migrate_llc_task migration type for cache-aware balancing") Reported-by: Yi Lai Signed-off-by: Chen Yu --- kernel/sched/fair.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index d78467ec6ee1..e6e6fa84c9e1 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -12986,8 +12986,12 @@ static struct rq *sched_balance_find_src_rq(struct lb_env *env, * * If balancing between cores, let lower priority CPUs help * SMT cores with more than one busy sibling. + * + * For migrate_llc_task, skip this check: cache locality + * outweighs the asym priority. */ - if (sched_asym(env->sd, i, env->dst_cpu) && nr_running == 1) + if (sched_asym(env->sd, i, env->dst_cpu) && nr_running == 1 && + env->migration_type != migrate_llc_task) continue; switch (env->migration_type) { -- 2.25.1