From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id ED909C624D3 for ; Tue, 1 Sep 2026 12:47:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6D3CE6B00BB; Tue, 1 Sep 2026 08:47:49 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 685806B00BE; Tue, 1 Sep 2026 08:47:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 59B4C6B00C0; Tue, 1 Sep 2026 08:47:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 342716B00BB for ; Tue, 1 Sep 2026 08:47:49 -0400 (EDT) Received: from smtpin13.hostedemail.com (lb01a-stub [10.200.18.249]) by unirelay08.hostedemail.com (Postfix) with ESMTP id A8DF71403E0 for ; Tue, 1 Sep 2026 12:47:48 +0000 (UTC) X-FDA: 85165170216.13.1F9B3E3 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf02.hostedemail.com (Postfix) with ESMTP id 90A5C80008 for ; Tue, 1 Sep 2026 12:47:46 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b="LRH/L1Jd"; spf=pass (imf02.hostedemail.com: domain of peterz@infradead.org designates 90.155.50.34 as permitted sender) smtp.mailfrom=peterz@infradead.org; dmarc=pass (policy=none) header.from=infradead.org ARC-Seal: i=1; a=rsa-sha256; d=hostedemail.com; s=arc-20220608; cv=none; t=1788266866; b=OinDJBd8jxim2wGSjnr1CbDa4zaKKP2hdUvWCrQh640CvItalS44jtzsq17GghNgRqojOl bTzqLH2Y0uu35ugbfjwcwTITccrbUhtH1gj1BWAeerIHCKo7Ec6ZsNVTw+kQwZVkTFq0V6 WeL5xXS4RiBmQ8d7l4MAn8b9/l3EygY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1788266866; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=sCcI1xDRgy13rJLNRCaipdSq/zHJb80XoO4QrN/D7d4=; b=ZQli/wmnvdXFjGU4C9TEkNbDNYNE0IP3TZ+dQNhrBBGoQeOjZvdbZk/NHaNgwBsIRRDB0i B6INA/mjuLahbhgODGwzRV6iyMzPFm/2/WwWLX/kR+JyJ6/d7tNVo3jiyt44hZwSnJYqgN VNsu3u32DW7VE9XOyeRT+iQcaiMt/IM= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b="LRH/L1Jd"; spf=pass (imf02.hostedemail.com: domain of peterz@infradead.org designates 90.155.50.34 as permitted sender) smtp.mailfrom=peterz@infradead.org; dmarc=pass (policy=none) header.from=infradead.org 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=sCcI1xDRgy13rJLNRCaipdSq/zHJb80XoO4QrN/D7d4=; b=LRH/L1JdeSKQMpoPSr2wSN7WmB fzfB+ZCm1SNnodEdvJo3EBXK75+WWQQafDgDQ8yfgf3JgaoNkOEXqPTlUgtMO0HGNWxmYaC9Ku8gf aosrdu0gtHg4dwmYEVeALhBdXOWm4Mi/QMQIWtCpcOT1CSMix16u5+Z9SPT8DCXSaLfhcwf3Z0Dpf DvLZKPjEnPkW7Nf0rSlqZtcfAVLB2ogBxaNR03gnTSNH/eENs3gRA6EYLzKplJT4DC19r0+zy5oEU 4wtVD4h0wBReSJV9HSeB68YseXCQPWG2faqwhXNgRU5Rr7KnaPz3lYsfgvcK0Rlz4GYCpMvqOoRIa NMFfFyVg==; 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.99.1 #2 (Red Hat Linux)) id 1x1Ntp-000000057uY-2PPd; Tue, 01 Sep 2026 12:47:37 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id 5EF67300578; Tue, 01 Sep 2026 14:47:36 +0200 (CEST) Date: Tue, 1 Sep 2026 14:47:36 +0200 From: Peter Zijlstra To: Jianyong Wu Cc: Ingo Molnar , Juri Lelli , Vincent Guittot , Chen Yu , Tim Chen , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , K Prateek Nayak , Shrikanth Hegde , Phil Auld , Andrew Morton , David Hildenbrand , linux-kernel@vger.kernel.org, linux-mm@kvack.org, jianyong.wu@outlook.com, zhongyuan@hygon.cn, huangsj@hygon.cn, wangfengyu@hygon.cn, yingzhiwei@hygon.cn, justin.he@arm.com Subject: Re: [RFC PATCH v2 17/23] sched/fair: Fine-granularity NUMA balancing Message-ID: <20260901124736.GI776954@noisy.programming.kicks-ass.net> References: <20260827122816.756234-1-wujianyong@hygon.cn> <20260828020731.785556-1-wujianyong@hygon.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260828020731.785556-1-wujianyong@hygon.cn> X-Rspam-User: X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 90A5C80008 X-Stat-Signature: p6116f9dym3mncb9kof17faqaugerxw3 X-HE-Tag: 1788266866-493891 X-HE-Meta: U2FsdGVkX1+z6+MurQCQjZZfSnt5CSqr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BFvX+vJWpG7gZDHa3BgzofskTDkSIw3y2BfEF/4iBwB6g2aleXSPC+7Z0M9o/RrTAHFb3vwKmz/jITQXQMfqWn9UkWppbeEj/8OSHMyGFw94ac= Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Fri, Aug 28, 2026 at 10:07:31AM +0800, Jianyong Wu wrote: > NUMA balancing currently consists of two coupled components: > task migration and page migration. These two mechanisms work in tandem. > However, task migration may conflict with other subsystems such as CAS, > which aggregates tasks solely via task migration. Conflicts arise when > both CAS and NUMA balancing are enabled simultaneously. > > This patch addresses the problem by introducing a fine-grained NUMA > balancing mechanism, allowing task migration and page migration to > be enabled or disabled independently. Sorry, but this doesn't make sense. At every point NUMA migration should take precedence over LLC. The remote node penalty is much greater than the 'other' llc penalty. It is always beneficial to get tasks placed near the memory, and if tasks cannot be so moved, to move memory near to where the tasks are. As a secondary concern, it is beneficial to keep tasks constrained to a minimal set of LLCs inside this node. Disabling page-migration or numa task-migration separately completely wrecks things and you might as well just disable NUMA balancing. Now, if the process spans multiple nodes we should go do the same again as this patch set does for llc, spread/interleave over the minimal set of nodes that do fit.