Received: by 2002:a5d:925a:0:0:0:0:0 with SMTP id e26csp293699iol; Thu, 9 Jun 2022 04:08:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw/M4G1awoP4hHnjxGZM7pzcLgmfiLzUSvDnuT5nvASlRdOcBvI7j21b/qf7Cqtp4dm1NZE X-Received: by 2002:a17:90b:1c86:b0:1ea:4ceb:2788 with SMTP id oo6-20020a17090b1c8600b001ea4ceb2788mr2959731pjb.16.1654772881476; Thu, 09 Jun 2022 04:08:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654772881; cv=none; d=google.com; s=arc-20160816; b=HotLqoFMJXjHM5BPUWnjlOmTJokTo9/TYvHf4jDK00pDdPAlnoNWZ8xVoY3xS45HvE 42z03A6om1A5wJ0DlodvL7vYhEzMhiaGsI7Cg7oF/qX7ZdzJOrlWs9KPCL4xicJYLdiq WzT+jiksK+N05dPbLAZA8v4Ht6kNJ2Y3KQmhbFQ9xapwE6lXClOuS5KhDEhpAOiMFhjO Aqtis67Rh2Zkp3Crl/N5b7aUUdoySMkNeC+/Qmtv3HE6S11DMQmcz5PsQbOA5vJ9JZMS 8z3hTQlnAl/OOHtvyICz8oSYIWD7BNojnq8F0NXKG66lRIg+2JV/vPTeEcSyQDvwcqCo 8eIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=0L4gtE6Nwxhqko2H3PVb/r993pNhceWeKw07NNRQ85Q=; b=hEldPLMrisqYb+LqcI6egPRWpYFYIeHi0+lLAz3sEhmvDzbnD+FNG0+bINgBITG0L3 4xcdPhiRA/q7ko+K0dDMjcklwexGnli1tuksajyBmaJ8jd29MIeiYLsMIsFfGdvKa+AF qu2FaftdNSMjxod6r4ZzpoUd4kHw5rvzt0wB5FGjZwnmEi4IuZi8TRxhb8SC++q3kD5z SHXsTFMtu/dWOS1xRv5wPLS+Hg4Iivz5+HfJ/lG7MeOHVj6sWSJbDpRmWng7zvQ0/fk7 /H86EkGh3BKBc19frzC6DHNhX3SP7GY3NO04bVumxAcO/46EoczTEGKsNyFN1M4Cjc7R Oncw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=NrMB5dQ5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e15-20020a17090301cf00b0016180dd8c33si32645809plh.164.2022.06.09.04.07.45; Thu, 09 Jun 2022 04:08:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=NrMB5dQ5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243311AbiFIKli (ORCPT + 99 others); Thu, 9 Jun 2022 06:41:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243348AbiFIKlY (ORCPT ); Thu, 9 Jun 2022 06:41:24 -0400 Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 305F5267CD2 for ; Thu, 9 Jun 2022 03:41:12 -0700 (PDT) Received: by mail-pj1-x1034.google.com with SMTP id j7so21002725pjn.4 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=EjlkrA4kO5KRHFhwjp5ss9nScPVOK0M9xSPFlrUBag9D85KGLtIZY0RQNDpVjJNnCs F8I2fafw++myiyB3D9sCKKfDNsBUNxP1sncklI2t2yHvpnMmubUgXrVWEWlJtrwL1RwY iZTFwRlLOBg0N+IEmlU7Zz9CRLpkNYbJI2UHp8FA7HHOjv0+Kr2vuqJ3JBMXR7oULimT 9qdOWC2ZA6x7AcCBi9a+4mRSPxnYlcJAUGSSNfziBbxas6YH8p25F5G/vqHJ2vuY/7zj sVl2xX3Du2xNpI8aB6k2QLhuxZUxHhO9XpG918Ye6FIMCKux5g0yfHl7PhHuvTbMYE19 CSRw== X-Gm-Message-State: AOAM531pPFzbA2LT5ARgtpG5cR0evJzBWB9SQsf4PovCz/vwbDJ0wIIj 3RRaRNj0Jx9nW2BQKEf+Ajhl4A== 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 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org "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: --- 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", -- 2.11.0