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]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6FA50CE8E9A for ; Thu, 24 Oct 2024 18:13:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E9FF46B009E; Thu, 24 Oct 2024 14:13:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E28DE6B009F; Thu, 24 Oct 2024 14:13:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CA2486B00A1; Thu, 24 Oct 2024 14:13:35 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id A87156B009E for ; Thu, 24 Oct 2024 14:13:35 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id C0F5F1C6CBE for ; Thu, 24 Oct 2024 18:13:13 +0000 (UTC) X-FDA: 82709293170.16.F6CE870 Received: from mail-io1-f44.google.com (mail-io1-f44.google.com [209.85.166.44]) by imf18.hostedemail.com (Postfix) with ESMTP id 228531C0006 for ; Thu, 24 Oct 2024 18:13:24 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=kQnrM6Uc; spf=pass (imf18.hostedemail.com: domain of dongjoo.linux.dev@gmail.com designates 209.85.166.44 as permitted sender) smtp.mailfrom=dongjoo.linux.dev@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1729793460; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=KElvkcoCdWuugkIgjm4VYhnrKDOwYCGs3Tu2Zr3567Y=; b=Q9eh+SZHTwP9K0+2cjUUFucZemd0YTQqORZpjlxQMYCWC1rwnewhbkbXMWQXvZRpsBtfNX /I7jZgNlh9yJgIz9FCVGhm2REqUVOARz8G/QvoGL7b6m1PPDbgh9btUxE78XColBMvlbID HSnjHOQ/ip2jCSOyqsbi0wjcV3ctRfg= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1729793460; a=rsa-sha256; cv=none; b=MTomwOTIUYTk9drH6p/VvHKI4EEXTxIfiKKDwiqdZZUZJuFQm5yJG7qXhlu9pvMVaEhL1c DSkBXNtrkmCUpMhlszpb/mwH3Sy6VXMu9WHGrS/bNECmkFfOPmxUWN3seNIwzlv8ZtfYSa rFETximmqqf2bHeEhgyTGpNpv11sNis= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=kQnrM6Uc; spf=pass (imf18.hostedemail.com: domain of dongjoo.linux.dev@gmail.com designates 209.85.166.44 as permitted sender) smtp.mailfrom=dongjoo.linux.dev@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-io1-f44.google.com with SMTP id ca18e2360f4ac-83abcfb9fd4so45248539f.3 for ; Thu, 24 Oct 2024 11:13:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729793612; x=1730398412; darn=kvack.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=KElvkcoCdWuugkIgjm4VYhnrKDOwYCGs3Tu2Zr3567Y=; b=kQnrM6Uc+okqRPnL1bq6M7TFWn2xnjzdXnluvSgp7W505mU2O/GdEVx5YQMk+HL+Wg rPDHj7oELU81lnzAzDg6hFlUdyw3ZpcB22dyaylDhy6OVhnQqmtMeeYiPZO3+L9guad3 IMdiP21zXIO6KpwDgGfBklarmmDq5uwDH7XumJCw9uDypA5/5/m2yTsLFfvL76cT4vAV HPex5YB1NuLfvWYS1agsfF9LJkwBw6//fY5ssHrUfqC5HnZQ9bBeBdAt2WxqTqSeUuUW 919jacGVsPy/BX/Xm6ir1HxACN3LkBm7sL4d/QC+IlG5KYjZXXdoevAHxKh145XkwN4g DQtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729793612; x=1730398412; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=KElvkcoCdWuugkIgjm4VYhnrKDOwYCGs3Tu2Zr3567Y=; b=mn2Oiisny8m1E4HVIBlpZ3wQW8uggg9EDCy3ZG7K6cWEofA+s2KRdX3+IkaLGWkvNl BsVTlAvW2zHLlhh11kNoGi711eJbd0o8aa+a4uyyW6DuHPbJopYl6aKmeLOvcJJjEdEV 9K8CLJWJLyLpPLA3tcg5KajRG+/vPGLqhEg76csTbbkYPr9wcZQ9jKiUSQSowob9+o+W 4dSWywWXj4oH6YrAVuz9wLNJRshlgAGR3H1g4K/Vo7X75Une5ibwFCZ+rjWmjxD24NDW DTSVX3uo+mpFnTc00QYBqeDntEpVH+2sduPrq0v499dpBTzLX7dX3An0tydmkR7Mje0h YsuA== X-Forwarded-Encrypted: i=1; AJvYcCVmX2jTx1CnxMt7Yy5SpBpJxCqoInSyvoEmDte/+VmeRRnxQd5epO0QnG70yAK8jyWyxIXe4vLKjA==@kvack.org X-Gm-Message-State: AOJu0YxyFpDSwxnNVHzLLvrHbEEl+dE3VOKRko063hTA06H76tSKonGb Zgs/Hkb30g4GTzkk0rVD1hFlQRHnJHA2vqEQh3ZOp0gUXYPOaa1R X-Google-Smtp-Source: AGHT+IEO8kuJdouS8g34Z/zlGvWlpr/YHS3v9uYxgiaFsqsdvu/XAX2S1QCl8xQXiByFKTdke7/H6Q== X-Received: by 2002:a05:6e02:12cd:b0:3a3:67b1:3080 with SMTP id e9e14a558f8ab-3a4d595c67amr75181115ab.7.1729793612093; Thu, 24 Oct 2024 11:13:32 -0700 (PDT) Received: from eqbm-smc020.dtc.local ([149.97.161.244]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7eaeaafb669sm8847432a12.7.2024.10.24.11.13.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2024 11:13:31 -0700 (PDT) Date: Thu, 24 Oct 2024 11:13:29 -0700 From: Dongjoo Seo To: Michal Hocko Cc: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, dave@stgolabs.net, dan.j.williams@intel.com, nifan@outlook.com, a.manzanares@samsung.com Subject: Re: [PATCH] mm/page_alloc: fix NUMA stats update for cpu-less nodes Message-ID: References: <20241023175037.9125-1-dongjoo.linux.dev@gmail.com> <20241023134121.68d4af59e2d9cc3e78a34cc8@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Rspamd-Queue-Id: 228531C0006 X-Stat-Signature: t4ryapucffi43s3om755krpxpgbqjxbu X-Rspamd-Server: rspam09 X-Rspam-User: X-HE-Tag: 1729793604-27914 X-HE-Meta: U2FsdGVkX19Uw9mCR9AyU8vjsBuv7sI42931EEpdazKKT2f4u9Ndf8BqDHG7sskXJYdAJpLjQPK7G8ubri7cYo/+HaWtKmdC0oV3ybqM/sXjHflWdJ6zVfyZq9mcYKnMeFtr/dU+09wXekjcFICYhyP6ZkrHgIo9zcbySS6mayjeg5UFuU7rGwd4kzl4D22vzdidyCYDU6xjIRma7Z5g7/uPwoZpJqT6EoxQtqov8YoszrCHXAIKavCt048/QrvavJGySG4qsprQrKahSsyfNT0YtmaU5DuTl2OvTPC7kvfuW/IeEynXwLTJyuh2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bPf4xF5dMWuvjZNcx6sXfzYUSIbo2ua4NJmlQExRuij3wIl2BGBGeogxuoOi/T3Xulo7fzu2dwv9z3l96ffTvHgzHZyNfhl20CkGpzVvPHYQ X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Thu, Oct 24, 2024 at 10:24:56AM +0200, Michal Hocko wrote: > On Wed 23-10-24 21:54:37, Dongjoo Seo wrote: > > On Thu, Oct 24, 2024 at 12:23:56AM +0200, Michal Hocko wrote: > > > On Wed 23-10-24 15:15:20, Dongjoo Seo wrote: > > > > Hi Andrew, Michal, > > > > > > > > Thanks for the feedback. > > > > > > > > The issue is that CPU-less nodes can lead to incorrect NUMA stats. > > > > For example, NUMA_HIT may incorrectly increase for CPU-less nodes > > > > because the current logic doesn't account for whether a node has CPUs. > > > > > > Define incorrect > > > > > > Current semantic doesn't really care about cpu less NUMA nodes because > > > current means whatever is required AFIU. This is certainly a long term > > > > I agree that, in the long term, special logging for preferred_zone > > and a separate counter might be necessary for CPU-less nodes. > > > > > semantic. Why does this need to change and why it makes sense to > > > pre-existing users? > > > > This patch doesn't change existing logic; the additional logic only > > applies when a CPU-less node is present, so there shouldn't be > > concerns for pre-existing users. Currently, the NUMA stats for > > configurations with CPU-less nodes are incorrect, as allocations > > are not properly accounted for. > > > > I believe this approach improves logging accuracy with minimal impact > > on the memory allocation path, but I'm open to alternative solutions. > > This isn't the only way to address the issue—any suggestions? > > I still do not understand the actual problem. CPU-less nodes are nothing > really special. They just never have local allocations for obvious > reasons. NUMA_HIT which your patch is special casing has a very well > defined meaning and that is that the memory allocated matches the > preferred node. That doesn't have any notion of CPU at all. Say somebody > explicitly requests to allocate from a CPU less node. Why should you > consider thiat as NUMA_OTHER just because that node has no CPUs? That > just seems completely wrong. Thank you for your feedback. After reviewing ur reply and [1], I realize my misunderstanding of numa_* stats. I mistakenly assumed node referred to CPU locality. The current logic is indeed memory-centric and operates correctly as it is. I appreciate the clarification, and I now understand that no changes are needed to special case CPU-less nodes in this context. Thanks again for pointing this out. [1] https://docs.kernel.org/admin-guide/numastat.html > -- > Michal Hocko > SUSE Labs