From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qt1-f182.google.com (mail-qt1-f182.google.com [209.85.160.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6D58C2C032E for ; Wed, 11 Feb 2026 14:21:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770819711; cv=none; b=QrstFBd/tx8SHEvAuLJ12g2Ai0jnJ865Eq9ynxfsCXVNMyk17ywTzMapsMlqwDP1Fg0G1H1IqXgRLia3bS8rQdRpW6QGqa+gS4QYewXxkjIK5j0ckWlxneHrJtok3LfzSpMotA3+Ujo6d66bfjL49a+GUMBrK154VkcTc66zw/4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770819711; c=relaxed/simple; bh=cpDFlTKOf6SRUpXUrBaJswHvvyZKhTQQ6ZD4dW4iSMA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Ha1LtHHxw9KnowkBNpuav24DbRbNC2Cv+3vIhL3Ny/FUlS6xDD8NqcrCh6EJGCt+N+i9zKD3swyBOPGoK9Q+OvwBom2JWOKsr4Sfk4LcW9P5e2wpGd2tkfZufxRfyspX5ogBzFLoOAuOFZHGHySsfK2DssrGKS05BA5MBe4rIkw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gourry.net; spf=pass smtp.mailfrom=gourry.net; dkim=pass (2048-bit key) header.d=gourry.net header.i=@gourry.net header.b=NYsehbo0; arc=none smtp.client-ip=209.85.160.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gourry.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gourry.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gourry.net header.i=@gourry.net header.b="NYsehbo0" Received: by mail-qt1-f182.google.com with SMTP id d75a77b69052e-505a1789a27so11578101cf.3 for ; Wed, 11 Feb 2026 06:21:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gourry.net; s=google; t=1770819708; x=1771424508; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=dEL3esNNatCbr/bkbGQf1MBlSa4lnjGnRCnp5HwHRC4=; b=NYsehbo0V6TU+gbZf568YGqM+PZfcqrqfkyFlAhdlGQWWxDQOCg9uQgKxS4qkK1tmP h5Q5dGg/7AHTjNnJ6+CqERzmL3CWcsQTJMIMlwGhU2I6SrCZq8/j5NVZXOioVoB7+ggm 2X/Kd0iBV6pBUncqCV2YqyAxzr3QQsyypEk+Q9DBpHcUF4TuVcovNgmAiSW+ddkNX8Pr rPwu1UjxJFyV/ZsChrxnSinHbIp/4vTkdE0rrVYGq21VEoqFAnrF0BHNe7I4kCqJQWNo 6/yhiC5i0knoWgrb+UBbFRx8hBMooNSXc0Nq48H6WU+hFLb4vbEXf0aCy+8NCYoS2LAw 7+ww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770819708; x=1771424508; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dEL3esNNatCbr/bkbGQf1MBlSa4lnjGnRCnp5HwHRC4=; b=XpgDFtxSRTQt3W9+yWe0YSGxemD5KPAJeaSFZRJIT9f+Q7u+VpLT346Rcoxn/lNVwt s2AFFZu2MLw69aV2t2yN6UYKsZFVayxkw/cDpIH0EAJl3t74ozTSC6w3LFKXXX1ulZB4 4mvgT/9nuF2wq+na1jXrSIDnpfhrbB6yixe8fCtxxBr0LBkBtTECUHm7s6u5wvVtI2qb joCUSMPrchEFn+FfPFdDpAfAlRoojYwobGGC5B7rV5OBxWJ9aEfBX3gJcDqpHc+6To4v Ql9Leeb0xInTRkYPLQNhLdgIuzfd5i20qdCerPDYJjINqzwJgJXIF28u2UkG/PNJUa1o LgiA== X-Forwarded-Encrypted: i=1; AJvYcCXlUKzmGUCvSfXhqiswA3VZQ24USTDW/TXgb0K8LIGSddwuokzetlODAxibIZFU++GgD3105lCHQE6IMR8=@vger.kernel.org X-Gm-Message-State: AOJu0YxqH0Eu9NKkknYj+aazi6kBiCSqbKb4XGo6MTUV0Rw5BekIJ+AJ wO2xhgg78Pyb/1csGWMNopS9KsjxvY+ZoHDVB8bZ037LpSwj3SobFDBNwPMRSSmKy1Y= X-Gm-Gg: AZuq6aL5t6y33AEsCK+w2CLtbOQF2oqV6CJz1JUOeMJJMMw7N8IRDeTbo9fDdS5hlgn AxqbixFnNc9BMbENHm8deqOLJahr/og2pD8ZmYcKFuekjR+w+HwAPXdpaKnBgrivJdI4KhYo3ki z77rHUYhot2a+TvvRyTsvi9aRH9mBM69LpwWU9YE2omEqL9Sug29S3Dhkug5N+c5oxPiO+R6nJx lwRVfRtBt25hfUa3MJ29f4G7L9E/3yQRe9zVtb1Vk3nNHL/bp+VJWsRH/KY63MFqt557kz9/FnB 2jsbFBSwVtzQb8IQ2TBfoZQWY1rezfMoQ5jmN+yGAPakwV2wbzODfnDCPv5NoKC6+kklANAPTrl rg3cgBwOHO+KN4bUSOHFFTaspKqB08OULVdN+tNIZxATL04d6kivzCj1GMrq7+rGiGBpMGHigTn tBJTPUD3k9D+FJzk1lC7orH16t9tuyu+++DDTIJ8L+u2zMHKAXExLxl39HltY/C5T2DuqKuE02y pV0PiB43A== X-Received: by 2002:a05:622a:646:b0:502:6ed5:7b04 with SMTP id d75a77b69052e-50639a199b4mr244208631cf.74.1770819707999; Wed, 11 Feb 2026 06:21:47 -0800 (PST) Received: from gourry-fedora-PF4VCD3F (pool-96-255-20-138.washdc.ftas.verizon.net. [96.255.20.138]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-506847d7bdesm14877131cf.6.2026.02.11.06.21.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Feb 2026 06:21:47 -0800 (PST) Date: Wed, 11 Feb 2026 09:21:45 -0500 From: Gregory Price To: Cui Chao Cc: Andrew Morton , Jonathan Cameron , Mike Rapoport , Wang Yinfeng , dan.j.williams@intel.com, Pratyush Brahma , David Hildenbrand , linux-cxl@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, qemu-devel@nongnu.org Subject: Re: [PATCH v3 1/1] mm: numa_memblks: Identify the accurate NUMA ID of CFMW Message-ID: References: <20260211103320.2064211-1-cuichao1753@phytium.com.cn> <20260211103320.2064211-2-cuichao1753@phytium.com.cn> 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: <20260211103320.2064211-2-cuichao1753@phytium.com.cn> On Wed, Feb 11, 2026 at 06:33:20PM +0800, Cui Chao wrote: > In some physical memory layout designs, the address space of CFMW (CXL > Fixed Memory Window) resides between multiple segments of system memory > belonging to the same NUMA node. In numa_cleanup_meminfo, these multiple > segments of system memory are merged into a larger numa_memblk. When > identifying which NUMA node the CFMW belongs to, it may be incorrectly > assigned to the NUMA node of the merged system memory. > > When a CXL RAM region is created in userspace, the memory capacity of > the newly created region is not added to the CFMW-dedicated NUMA node. > Instead, it is accumulated into an existing NUMA node (e.g., NUMA0 > containing RAM). This makes it impossible to clearly distinguish > between the two types of memory, which may affect memory-tiering > applications. > > Example memory layout: > > Physical address space: > 0x00000000 - 0x1FFFFFFF System RAM (node0) > 0x20000000 - 0x2FFFFFFF CXL CFMW (node2) > 0x40000000 - 0x5FFFFFFF System RAM (node0) > 0x60000000 - 0x7FFFFFFF System RAM (node1) > > After numa_cleanup_meminfo, the two node0 segments are merged into one: > 0x00000000 - 0x5FFFFFFF System RAM (node0) // CFMW is inside the range > 0x60000000 - 0x7FFFFFFF System RAM (node1) > > So the CFMW (0x20000000-0x2FFFFFFF) will be incorrectly assigned to node0. > > To address this scenario, accurately identifying the correct NUMA node > can be achieved by checking whether the region belongs to both > numa_meminfo and numa_reserved_meminfo. > Changelog comments after this are a bit much but other than that > > Fixes: 779dd20cfb56 ("cxl/region: Add region creation support") > Signed-off-by: Cui Chao > Reviewed-by: Jonathan Cameron Reviewed-by: Gregory Price