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 74A8E3955F3 for ; Wed, 13 May 2026 20:33:55 +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=1778704443; cv=none; b=BJrRr0Xky1aNGzxswGos20DZEEHt281hTIYg9J2DRcJbOLoLZGwW+K9Yr/IYbYlZNegXqtpUZkFvcvMLtVP8lKCQ3qg2tgAO7sZMhiG2wIuq3grdTfmD/jJBgkiL/Ig2j+WazeI3V6SBWnhhU6zgvjPKTfDv/UOjfwPD0WOFE1Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778704443; c=relaxed/simple; bh=LeKY5OSGAFQHBTheCebjoiSuXh/qiznyE2rafuiDcYw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=QhxHfofduPQAkoaV9niUxesWLiiUWdMLFVYMz7EKCKPcpbpxLR/3du0oHpgwXbZWTDQUVvNaGuVrhGfHBwajOXT/dM4+bnXg1lV9KQvVz46X9iCz1XbKQlJ74c3tk9nn7NJdhw4Zr7i6Uw4LzNxidT5nUvto8d2PKZM8TyaxTMM= 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=csQXKvMv; 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="csQXKvMv" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1778704436; x=1810240436; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=LeKY5OSGAFQHBTheCebjoiSuXh/qiznyE2rafuiDcYw=; b=csQXKvMvmMuUz8TLTse9EX4mJtBJauaFn/g9ugXIwzCHdktO3dxSduVi hpSsvnpNd1LZEC3HDwa+iuMydO8BuQ6vMWrCF+XnFoKfQ8iDj/nl+1iFw /rquPd9Ywmy0JvBuq+U0E1bm24Ql76gENuxOzaKYl+mO1JuvQvjqMjpUz H3wSpfVnQJ14Hat7nmiGWt0TyNnkL2kKjWQGCLJizAxXL/jtXBMS4jzt5 n/ou9f8sa8egayIgyUmohFpsofMr5hjSZCIiGoE6u5p0YqcaGZm+krebl WVoOi7R7G6jOajV3POEcNtX7ootZPYWRorIjCY+VCFoFvI+qg35tS/fpe g==; X-CSE-ConnectionGUID: QK1cemjYRhOV+auh2VIN9w== X-CSE-MsgGUID: aQCTKQ6rRsyk/RkU3jUmqA== X-IronPort-AV: E=McAfee;i="6800,10657,11785"; a="79623313" X-IronPort-AV: E=Sophos;i="6.23,233,1770624000"; d="scan'208";a="79623313" 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:50 -0700 X-CSE-ConnectionGUID: /TZAYCgTSkmniKeQefjO/Q== X-CSE-MsgGUID: LdA4D9VaQPai4TkFq4gShQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.23,233,1770624000"; d="scan'208";a="238076412" Received: from b04f130c83f2.jf.intel.com ([10.165.154.98]) by orviesa008.jf.intel.com with ESMTP; 13 May 2026 13:33:50 -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 16/16] sched/cache: Fix stale preferred_llc for a new task Date: Wed, 13 May 2026 13:39:27 -0700 Message-Id: <0ec7309d0e24ede97656754d1505b7490403d966.1778703694.git.tim.c.chen@linux.intel.com> 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 On fork without CLONE_VM, the child gets a new mm, the parent's preferred_llc value is stale for the child. Fix this by resetting the task's preferred_llc to -1. This bug was reported by sashiko. Fixes: 47d8696b95f7 ("sched/cache: Assign preferred LLC ID to processes") Signed-off-by: Chen Yu Co-developed-by: Tim Chen Signed-off-by: Tim Chen --- kernel/sched/fair.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 7e64cd18727e..73da6f8fc9ec 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -1914,6 +1914,11 @@ void init_sched_mm(struct task_struct *p) init_task_work(work, task_cache_work); work->next = work; + /* + * Reset new task's preference to avoid + * polluting account_llc_enqueue(). + */ + p->preferred_llc = -1; } #else /* CONFIG_SCHED_CACHE */ -- 2.32.0