Message ID | 20220826092422.39591-11-linmiaohe@huawei.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | A few cleanup patches for hugetlb | expand |
> On Aug 26, 2022, at 17:24, Miaohe Lin <linmiaohe@huawei.com> wrote: > > If CONFIG_SYSFS and CONFIG_SYSCTL are both undefined, hugetlb doesn't work > now as there's no way to set max huge pages. Make sure at least one of the > above configs is defined to make hugetlb works as expected. Right. I think the majority of the people are usually use /proc knob to reserve HugeTLB pages than /sys fs. So I suggest to add a “depends on SYSCTL” item. What’s your thoughts? Thanks. > > Signed-off-by: Miaohe Lin <linmiaohe@huawei.com> > --- > fs/Kconfig | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/fs/Kconfig b/fs/Kconfig > index a547307c1ae8..b266e7b5de85 100644 > --- a/fs/Kconfig > +++ b/fs/Kconfig > @@ -235,6 +235,7 @@ config ARCH_SUPPORTS_HUGETLBFS > config HUGETLBFS > bool "HugeTLB file system support" > depends on X86 || IA64 || SPARC64 || ARCH_SUPPORTS_HUGETLBFS || BROKEN > + select SYSFS if !SYSCTL > help > hugetlbfs is a filesystem backing for HugeTLB pages, based on > ramfs. For architectures that support it, say Y here and read > -- > 2.23.0 > >
On 2022/8/27 9:59, Muchun Song wrote: > > >> On Aug 26, 2022, at 17:24, Miaohe Lin <linmiaohe@huawei.com> wrote: >> >> If CONFIG_SYSFS and CONFIG_SYSCTL are both undefined, hugetlb doesn't work >> now as there's no way to set max huge pages. Make sure at least one of the >> above configs is defined to make hugetlb works as expected. > > Right. I think the majority of the people are usually use /proc knob to > reserve HugeTLB pages than /sys fs. So I suggest to add a “depends on SYSCTL” > item. What’s your thoughts? It seems some functions, e.g. demotion, is exported via SYSFS instead of SYSCTL. So maybe "depends on SYSFS || SYSCTL", i.e. depends on (X86 || IA64 || SPARC64 || ARCH_SUPPORTS_HUGETLBFS || BROKEN) && (SYSFS || SYSCTL) will be more suitable? Thanks, Miaohe Lin
diff --git a/fs/Kconfig b/fs/Kconfig index a547307c1ae8..b266e7b5de85 100644 --- a/fs/Kconfig +++ b/fs/Kconfig @@ -235,6 +235,7 @@ config ARCH_SUPPORTS_HUGETLBFS config HUGETLBFS bool "HugeTLB file system support" depends on X86 || IA64 || SPARC64 || ARCH_SUPPORTS_HUGETLBFS || BROKEN + select SYSFS if !SYSCTL help hugetlbfs is a filesystem backing for HugeTLB pages, based on ramfs. For architectures that support it, say Y here and read
If CONFIG_SYSFS and CONFIG_SYSCTL are both undefined, hugetlb doesn't work now as there's no way to set max huge pages. Make sure at least one of the above configs is defined to make hugetlb works as expected. Signed-off-by: Miaohe Lin <linmiaohe@huawei.com> --- fs/Kconfig | 1 + 1 file changed, 1 insertion(+)