From patchwork Thu Jun 9 10:40:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12875227 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 8C5B2C43334 for ; Thu, 9 Jun 2022 10:41:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 075A78D0003; Thu, 9 Jun 2022 06:41:14 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 025538D0001; Thu, 9 Jun 2022 06:41:13 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E09AB8D0003; Thu, 9 Jun 2022 06:41:13 -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 CDA8C8D0001 for ; Thu, 9 Jun 2022 06:41:13 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay12.hostedemail.com (Postfix) with ESMTP id A7CEB121110 for ; Thu, 9 Jun 2022 10:41:13 +0000 (UTC) X-FDA: 79558355226.05.695307A Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) by imf30.hostedemail.com (Postfix) with ESMTP id 883A68006C for ; Thu, 9 Jun 2022 10:41:12 +0000 (UTC) Received: by mail-pl1-f178.google.com with SMTP id r1so2688897plo.10 for ; Thu, 09 Jun 2022 03:41:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=0L4gtE6Nwxhqko2H3PVb/r993pNhceWeKw07NNRQ85Q=; b=NrMB5dQ59veFB/XnXQezjBFT8bcCwIl+jP9JXN1LY3wqizYRbZhWCeG2BBxkzHxgKA TW9eCxYWQ5pRg2LcWQMuXTOq9cGKeQTSaK6UExTCqC9B0AgJMTcxo10PadO4FY01B8dE HHCVZIC4UQ0UOGii059G94L0dyi/EXzmsDHqwzIGVrif4HzFOFuF4zO70v8WaBYuqxoZ ItVHkYfr/Ivd3N58JXuzhQ88h8IlrxdP+0Kv4ZMM4dPVqPkHXlz9wXLfpPywaN0m0HLs kZJuse1PW00OrZqVYQhnMPQJ/7cf71kZ/KMnOIAFW1xrYKZohKGNsw59OZK1s0LJqXf3 hMvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=0L4gtE6Nwxhqko2H3PVb/r993pNhceWeKw07NNRQ85Q=; b=pSMjvCAtkTbhA99ABxTbd2bP53lp4VrQaHBF446rY2l4awJcRJNHNe0hXfNpWQxh5a EAcSf3PpOQm9R7HOCDDtQCP9jc96kL2xMoGkicKRdEK3G6fEe+bvuKrHfMV0vzagOuDm xsxvnMLPlVtSRKzRu9q5UQi+JB6xYwoiweB6V2F66PWwvp9XSWfXXw4003MaKJDqAqtB 9/BGds9z5vvDs8jUTgNQXkq4KcxeQUan/DO4kXhUMW/DjKXT9xNPv8HaVt+Ho285J4KD 3kkdk2bJX0kRotQvxPRFgZt1rAyL3unaYFuV3HTN/V45k1oG4JQkrX2GQXo0oSeQE4xe PpBQ== X-Gm-Message-State: AOAM533B/sIHv7B0uBpJBbSNgUlxceldZV4LBgr9INzEvJsPcnygXyKR usdF+ik5ZkWdKg0b2DDq8dtmBw== X-Google-Smtp-Source: ABdhPJzt6m5YXoPxvbvRGzD1gjnrN+7PwLhdRyVD97c8O32Cyzco5wjx5mltJH0di35bufdVPJ7fhg== X-Received: by 2002:a17:90b:2404:b0:1e3:4db0:f32a with SMTP id nr4-20020a17090b240400b001e34db0f32amr2828865pjb.201.1654771271434; Thu, 09 Jun 2022 03:41:11 -0700 (PDT) Received: from FVFYT0MHHV2J.bytedance.net ([139.177.225.238]) by smtp.gmail.com with ESMTPSA id b127-20020a62cf85000000b0051b9c02e4a3sm17458544pfg.178.2022.06.09.03.41.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jun 2022 03:41:11 -0700 (PDT) From: Muchun Song To: mcgrof@kernel.org, keescook@chromium.org, yzaikin@google.com, akpm@linux-foundation.org, vbabka@suse.cz, mgorman@techsingularity.net, peterz@infradead.org, dhowells@redhat.com, willy@infradead.org, Liam.Howlett@Oracle.com, mhocko@suse.com Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, Muchun Song , stable@vger.kernel.org Subject: [PATCH v2] mm: sysctl: fix missing numa_stat when !CONFIG_HUGETLB_PAGE Date: Thu, 9 Jun 2022 18:40:32 +0800 Message-Id: <20220609104032.18350-1-songmuchun@bytedance.com> X-Mailer: git-send-email 2.32.1 (Apple Git-133) MIME-Version: 1.0 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1654771273; a=rsa-sha256; cv=none; b=Tv4vwE6J2XCNGrRWyijnmH5+Aym12ycmbyR4XzGAijrar8/oUSHe8t1xNh91/XNrzjTCoU 8ObCNdPOgy9rwdLfYdU8nlPX0D2tDyTCrQLTPjmo+aYBrTZH7s/9s0xr7VLknT6BVZSPH+ 64RtWRNdfdPs5xxHTm0P/zdqeMNL36Y= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=pass header.d=bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=NrMB5dQ5; spf=pass (imf30.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.214.178 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1654771273; 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:references:dkim-signature; bh=0L4gtE6Nwxhqko2H3PVb/r993pNhceWeKw07NNRQ85Q=; b=ohcqrs0DUD7MZlwP0KUn8ybr7oy3GgreNSxGtU1B0ix2UddU6kBRQxs/a5aJ1IPuWWgfnE A6wFxaAz4Ctb/tUDeqQ6VCvxdVypt7T02TCocylkzJNeuG34oJZCDCI8lQWXKLZAPb2R2W 52O/67E+oBHsD9GrkkE6Wzqs/MrzZEY= X-Rspamd-Queue-Id: 883A68006C Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=NrMB5dQ5; spf=pass (imf30.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.214.178 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com X-Rspam-User: X-Rspamd-Server: rspam06 X-Stat-Signature: iq1a7iwbzmi9aiobbuaqq85qz7hjs9tb X-HE-Tag: 1654771272-36176 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: "numa_stat" should not be included in the scope of CONFIG_HUGETLB_PAGE, if CONFIG_HUGETLB_PAGE is not configured even if CONFIG_NUMA is configured, "numa_stat" is missed form /proc. Move it out of CONFIG_HUGETLB_PAGE to fix it. Fixes: 4518085e127d ("mm, sysctl: make NUMA stats configurable") Signed-off-by: Muchun Song Cc: Acked-by: Michal Hocko Acked-by: Mel Gorman --- v2: - Simplify the fix, thanks to Michal. kernel/sysctl.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 50a2c29efc94..485d2b1bc873 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -2091,6 +2091,17 @@ static struct ctl_table vm_table[] = { .extra1 = SYSCTL_ZERO, .extra2 = SYSCTL_TWO_HUNDRED, }, +#ifdef CONFIG_NUMA + { + .procname = "numa_stat", + .data = &sysctl_vm_numa_stat, + .maxlen = sizeof(int), + .mode = 0644, + .proc_handler = sysctl_vm_numa_stat_handler, + .extra1 = SYSCTL_ZERO, + .extra2 = SYSCTL_ONE, + }, +#endif #ifdef CONFIG_HUGETLB_PAGE { .procname = "nr_hugepages", @@ -2107,15 +2118,6 @@ static struct ctl_table vm_table[] = { .mode = 0644, .proc_handler = &hugetlb_mempolicy_sysctl_handler, }, - { - .procname = "numa_stat", - .data = &sysctl_vm_numa_stat, - .maxlen = sizeof(int), - .mode = 0644, - .proc_handler = sysctl_vm_numa_stat_handler, - .extra1 = SYSCTL_ZERO, - .extra2 = SYSCTL_ONE, - }, #endif { .procname = "hugetlb_shm_group",