From patchwork Tue Dec 10 21:37:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory Price X-Patchwork-Id: 13902103 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 4E393E77182 for ; Tue, 10 Dec 2024 21:38:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CF2C48D0014; Tue, 10 Dec 2024 16:38:16 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C1F788D0013; Tue, 10 Dec 2024 16:38:16 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A9B018D0014; Tue, 10 Dec 2024 16:38:16 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 884B88D0013 for ; Tue, 10 Dec 2024 16:38:16 -0500 (EST) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 43E42A0F5A for ; Tue, 10 Dec 2024 21:38:16 +0000 (UTC) X-FDA: 82880362488.05.301BAC4 Received: from mail-qk1-f178.google.com (mail-qk1-f178.google.com [209.85.222.178]) by imf27.hostedemail.com (Postfix) with ESMTP id DBA414000D for ; Tue, 10 Dec 2024 21:37:48 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=gourry.net header.s=google header.b=JRhRRfTD; spf=pass (imf27.hostedemail.com: domain of gourry@gourry.net designates 209.85.222.178 as permitted sender) smtp.mailfrom=gourry@gourry.net; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1733866670; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=7SLO2zP3WSxmf0tbBTHWC3uKgLqzLgdzgwGcqHy1nF8=; b=WBHCEW7Akb5yI814VA6gw5BvW66Kj3xAjadzA5H+QxrA01TVl3czNTzBiIbwwcI8mWQdYv mdCp1SHEo53MfLuUe7TleLYOaO6MhBxj0j9/FMkNMEnpPYHr7wrBNSqqbqPxwlUFt2JfkV YBRhtA0xMitxldiYe1kBBfBwRP2st3Q= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=gourry.net header.s=google header.b=JRhRRfTD; spf=pass (imf27.hostedemail.com: domain of gourry@gourry.net designates 209.85.222.178 as permitted sender) smtp.mailfrom=gourry@gourry.net; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1733866670; a=rsa-sha256; cv=none; b=sWF1sqQO3bsFnRCRJelI+a6Cr5VVeDxQW0dbVV2+GvlDtEU6qw7TctMcVMKrOe5ysZGqxS iPr2mwm2ezsgLAohL03VX0uLQt0xB0Y8zDVXkOaocg1vCJadr825Kx6ifpbG1uYY3+y1Vv mxnyDQIIV2TmhaYcv3BSVnUB7qtzlFo= Received: by mail-qk1-f178.google.com with SMTP id af79cd13be357-7b6e9db19c8so43419685a.3 for ; Tue, 10 Dec 2024 13:38:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gourry.net; s=google; t=1733866693; x=1734471493; darn=kvack.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=7SLO2zP3WSxmf0tbBTHWC3uKgLqzLgdzgwGcqHy1nF8=; b=JRhRRfTDfTpyyAq6F+YE+lGNZ9YNtyIyRB9asGJusL0E8u43CdDDyrbYFzDkI+Whpo /T8nDA7CN0Hm8SGlmtO9TmxiUcj/SmoXtDQVLsh5c172W++2jvQFz+vWKVJoS/s7Wj4u fmJrTNCQOErXET8/BSmkyqxP8TPc4pcEwhawiSRVociFfH9iHj4oQC4Mut24Ln88B1HC wAWlPGUQnAwTUcrayF7fJu9nT4A9DFo/a0eCeqqXpNteY4eAQIdwdgU8NUZsk4Pjl+zE 3CErrRVTvdxvqjLK27DXHSMe/ETDQ29LIhkYvOF8a855PFircHaxRQpoMA48RuMWUTR2 iMNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733866693; x=1734471493; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7SLO2zP3WSxmf0tbBTHWC3uKgLqzLgdzgwGcqHy1nF8=; b=W2jcbDd3jck9sjutjWFypCM1+xfs9YLgTAXHIx+GO1csOJ59ysEF6l7DjG/+g+XlQK oqCCVs4j5H97+IEfuOBLbSDMlh7tujckUaa4y8w8jotSkhI1UUW4foBaMnqLzFqmlHat YwxMUw2WLy/+X7jWfT9iAT4ibmO5Du3LfX6oPnmCt4InM7mcSte/B0y5+XdXhT5rRTL7 d3a7iwpU3DJGRHO9N4RtQA8BD4n31yfHa9+AbHW5TSQOU4idSdqFEkMDNFgchDcJi8iy uQ0V6Xp19QtxFWYDkvyx0XB8cyIKk3gNDhjyrO9RnTrFAXAY4plXOUfb2qbctpdVCYFS JGvw== X-Gm-Message-State: AOJu0YwR9q6c7oEmAn8RQ/7r9FvQ2wkaE+tPqIXgqeCVxuCy5TMCNvzV AC1+lAWdGhifizCLG4cVqHzCbb5fytZqbDew1K+VQI+vuO4xMPKhbmCppB8wHa7TZkkrOUGZord p X-Gm-Gg: ASbGncv/vKYLGQqW27eYvyV4CorGwkhqQ7NdOkAwu2OrtuXiPAChRIaioVXOst93vQ9 F5S2owJDbLpMrMXd6Fn2pZT4KZy7hHeY3KKqysdUt6A53CFLWtsY9Tf6LryHZB9SH+hTwrhfBIg 9aBLD6QlPVagMYXLn3BzVGjPnDlQ+HQSM1SH99mLdKf1zSKga+j3YGatVTqacvCx4PZC+MgXPyO GtZIHX3C0Up1ivK+/USINxfs8wbrUqcnpdC4jtnP4GXCzTq8HhCxkopNCNC9kz+O8B/0hhsM0On eSqMMyErhJfWMF45NSR8ZuxASCUT45ljuljyK90= X-Google-Smtp-Source: AGHT+IGR91VwyQ9Xd3L5CFowo5m6Bq9C98LuxwXRSibAvLZ+jNUO5jNdqjrNPT9txkkOjxePaZAJ4Q== X-Received: by 2002:a05:620a:4014:b0:7b6:d3b3:575e with SMTP id af79cd13be357-7b6eb4d1730mr126961285a.47.1733866693178; Tue, 10 Dec 2024 13:38:13 -0800 (PST) Received: from PC2K9PVX.TheFacebook.com (pool-173-79-56-208.washdc.fios.verizon.net. [173.79.56.208]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-467296f61f6sm65978991cf.43.2024.12.10.13.38.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 13:38:12 -0800 (PST) From: Gregory Price To: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, nehagholkar@meta.com, abhishekd@meta.com, kernel-team@meta.com, david@redhat.com, nphamcs@gmail.com, gourry@gourry.net, akpm@linux-foundation.org, hannes@cmpxchg.org, kbusch@meta.com, ying.huang@linux.alibaba.com Subject: [RFC v2 PATCH 2/5] memory: move conditionally defined enums use inside ifdef tags Date: Tue, 10 Dec 2024 16:37:41 -0500 Message-ID: <20241210213744.2968-3-gourry@gourry.net> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241210213744.2968-1-gourry@gourry.net> References: <20241210213744.2968-1-gourry@gourry.net> MIME-Version: 1.0 X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: DBA414000D X-Rspam-User: X-Stat-Signature: qd8j3nntjb8e5a383g4oscfjsac8zbej X-HE-Tag: 1733866668-987337 X-HE-Meta: U2FsdGVkX19HNvciW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O97GHuMzDog3AmhPkXbnjw0xrHlJkWSuZEiT97phEFFJ27iI0LISk+nod6amKdFXT5fWw0nwapWmW7WJDWl347fOMTQioRuMyPhMX4phRR5JhR9rYtdgEFnn75+IlSTbyQzvKZKCpK2c2EsCS6uS6fm35Bv4OfaITbohn0OpyyWSAbzIBR26+rthdmgdMP1c7f1O7YX3DOviYi+vjrsg== X-Bogosity: Ham, tests=bogofilter, spamicity=0.140560, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: NUMA_HINT_FAULTS and NUMA_HINT_FAULTS_LOCAL are only defined if CONFIG_NUMA_BALANCING is defined, but are used outside the tags in numa_migrate_check(). Fix this. TNF_SHARED is only used if CONFIG_NUMA_BALANCING is enabled, so moving this line inside the ifdef is also safe - despite use of TNF_* elsewhere in the function. TNF_* are not conditionally defined. Signed-off-by: Gregory Price --- mm/memory.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/memory.c b/mm/memory.c index 83fd35c034d7..6ad7616918c4 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -5573,14 +5573,14 @@ int numa_migrate_check(struct folio *folio, struct vm_fault *vmf, /* Record the current PID acceesing VMA */ vma_set_access_pid_bit(vma); - count_vm_numa_event(NUMA_HINT_FAULTS); #ifdef CONFIG_NUMA_BALANCING + count_vm_numa_event(NUMA_HINT_FAULTS); count_memcg_folio_events(folio, NUMA_HINT_FAULTS, 1); -#endif if (folio_nid(folio) == numa_node_id()) { count_vm_numa_event(NUMA_HINT_FAULTS_LOCAL); *flags |= TNF_FAULT_LOCAL; } +#endif return mpol_misplaced(folio, vmf, addr); }