From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (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 B19633B7B71 for ; Thu, 9 Apr 2026 13:41:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775742109; cv=none; b=LBV6dsTUTlWWmYQj0FOhfq3+ONekNp8wUg/ZDN0sot7lEfllhM7nuOrNH4KBZG+bBS760urIqixXeF1Xgwa/CKTZM1I6Jb8YP7EN+K3nk8CntvSVdhsWYaVWv0Dvi3CEniUr25ls6obltva963u9Q0RM5pmbhhbHM1D63BF+T5o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775742109; c=relaxed/simple; bh=WnWit3cBLmrq6J9DFSmJ8T+na1SV2qmKeN9IqAdkjK8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=rDtO2fzhr8WP+VYm/t5TNhDqSYtse7pqSrmCT+CxgbiSbVEjC0rs6d3Ndyh58lf0XXBWVID20lSonj/cFu48dZZ6QbCpfWEzYHCmJL9IOFRbrfquDf7pA0MpVXzdDBQMx2+MgBY0TlvJ1AZfHJ3hmHOvI8M3Bip0aa815ES5KuE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=ex6fudQU; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="ex6fudQU" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=y38LIzBfhLCt7W1d5V6x0Yp+uxOWfRl9coRtUavuB2Q=; b=ex6fudQUqClwbVCm2lpXC2LT8O HIc3L98+Rer5aRCTgKFelaVtm/7B8ERfObADfhqueLtfOEIZrVh4F/K6jCvIb9Sg1oGmG4ExUxk86 rO0r05Yo53uRs6cAe9+lTPLpIY3PdZW03PqH1+SXGkKjhWGFIZWbQNk1xK1uy+jnoQeZBMKOcBjgW lcLAvQZ4PyJTRnbhgZCtb4tIPi3R0xpIZhN7fvs9qWX/HntpUwjAt/jhb9foH+e5ir8VHcEHoOmHN UE0JExqMsFk6ynn37uOUIdXlqwXE5iNZ544iehn/ZOlbtT2k0yBEIPXNsIm7ssNIKw0QF4B0wUFi3 9k254+ug==; Received: from 77-249-17-252.cable.dynamic.v4.ziggo.nl ([77.249.17.252] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.98.2 #2 (Red Hat Linux)) id 1wApd7-000000073Lh-3yP2; Thu, 09 Apr 2026 13:41:10 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id 9D6A0302431; Thu, 09 Apr 2026 15:41:08 +0200 (CEST) Date: Thu, 9 Apr 2026 15:41:08 +0200 From: Peter Zijlstra To: Luo Gengkun Cc: Tim Chen , Ingo Molnar , K Prateek Nayak , "Gautham R . Shenoy" , Vincent Guittot , 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 , Aubrey Li , Zhao Liu , Chen Yu , Adam Li , Aaron Lu , Tim Chen , Josh Don , Gavin Guo , Qais Yousef , Libo Chen , linux-kernel@vger.kernel.org Subject: Re: [Patch v4 02/22] sched/cache: Limit the scan number of CPUs when calculating task occupancy Message-ID: <20260409134108.GA3102624@noisy.programming.kicks-ass.net> References: <57ed5fcec9b242803fe4ea2ce6e7f3de6a6efc6b.1775065312.git.tim.c.chen@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Thu, Apr 09, 2026 at 09:17:10PM +0800, Luo Gengkun wrote: > > > On 2026/4/2 5:52, Tim Chen wrote: > > From: Chen Yu > > > > When NUMA balancing is enabled, the kernel currently iterates over all > > online CPUs to aggregate process-wide occupancy data. On large systems, > > this global scan introduces significant overhead. > > > > To reduce scan latency, limit the search to a subset of relevant CPUs: > > 1. The task's preferred NUMA node. > > 2. The node where the task is currently running. > > 3. The node that contains the task's current preferred LLC.. > > > > While focusing solely on the preferred NUMA node is ideal, a > > process-wide scan must remain flexible because the "preferred node" > > is a per-task attribute. Different threads within the same process may > > have different preferred nodes, causing the process-wide preference to > > migrate. Maintaining a mask that covers both the preferred and active > > running nodes ensures accuracy while significantly reducing the number of > > CPUs inspected. > > To address the issue of scanning overhead, there is a more targeted > approach: only scanning the CPUs actually accessed by the process, and > evicting these CPUs when they remain unaccessed for a specific period of > time. > > This significantly reduces unnecessary scanning in most scenario. I have > attached the patch below for review. Please feel free to integrate or modify > these changes. > > Thansk! > Luo Gengkun Please fix your MUA, whatever you tried to send is horribly white space mangled.