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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 35F7CC6FA99 for ; Fri, 10 Mar 2023 14:25:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232332AbjCJOZK (ORCPT ); Fri, 10 Mar 2023 09:25:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42582 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232311AbjCJOYo (ORCPT ); Fri, 10 Mar 2023 09:24:44 -0500 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 65AFADDB2E; Fri, 10 Mar 2023 06:23:37 -0800 (PST) Received: from dggpemm500001.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4PY7X85ntKzHvKK; Fri, 10 Mar 2023 22:21:28 +0800 (CST) Received: from [10.174.177.243] (10.174.177.243) by dggpemm500001.china.huawei.com (7.185.36.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Fri, 10 Mar 2023 22:23:35 +0800 Message-ID: Date: Fri, 10 Mar 2023 22:23:34 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.5.1 Subject: Re: [PATCH] mm: hugetlb: move hugeltb sysctls to its own file Content-Language: en-US To: Luis Chamberlain , Mike Kravetz , Muchun Song CC: Andrew Morton , , , , Kees Cook , Iurii Zaikin References: <20230309122011.61969-1-wangkefeng.wang@huawei.com> From: Kefeng Wang In-Reply-To: <20230309122011.61969-1-wangkefeng.wang@huawei.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.174.177.243] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpemm500001.china.huawei.com (7.185.36.107) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2023/3/9 20:20, Kefeng Wang wrote: > This moves all hugetlb sysctls to its own file, also kill an > useless hugetlb_treat_movable_handler() defination. > > Signed-off-by: Kefeng Wang > --- > include/linux/hugetlb.h | 8 ------- > kernel/sysctl.c | 32 -------------------------- > mm/hugetlb.c | 51 ++++++++++++++++++++++++++++++++++++++--- > 3 files changed, 48 insertions(+), 43 deletions(-) > > +#ifdef CONFIG_SYSCTL > +static void hugetlb_sysctl_init(void); Hi Luis,this should add __init as it is called by hugetlb_init, could you help to change it, or I could send a new patch. > +#else > +static inline void hugetlb_sysctl_init(void) { } > +#endif > + > static int __init hugetlb_init(void) > { > int i; > @@ -4257,6 +4263,7 @@ static int __init hugetlb_init(void) > > hugetlb_sysfs_init(); > hugetlb_cgroup_file_init(); > + hugetlb_sysctl_init(); > ... > + > +static void hugetlb_sysctl_init(void) ditto, sorry for the mistake. Thanks. > +{ > + register_sysctl_init("vm", hugetlb_table); > +} > #endif /* CONFIG_SYSCTL */ > > void hugetlb_report_meminfo(struct seq_file *m)