• F
    LoongArch: Enable ARCH_WANT_HUGETLB_PAGE_OPTIMIZE_VMEMMAP · b5c83268
    Feiyang Chen 提交于
    LoongArch inclusion
    category: feature
    bugzilla: https://gitee.com/openeuler/kernel/issues/I5OHOB
    
    --------------------------------
    
    The feature of minimizing overhead of struct page associated with each
    HugeTLB page is implemented on x86_64. However, the infrastructure of
    this feature is already there, so just select ARCH_WANT_HUGETLB_PAGE_
    OPTIMIZE_VMEMMAP is enough to enable this feature for LoongArch.
    
    To avoid the following build error on LoongArch we should include linux/
    static_key.h in page-flags.h.
    
    In file included from ./include/linux/mmzone.h:22,
    from ./include/linux/gfp.h:6,
    from ./include/linux/mm.h:7,
    from arch/loongarch/kernel/asm-offsets.c:9:
    ./include/linux/page-flags.h:208:1: warning: data definition has no
    type or storage class
    208 | DECLARE_STATIC_KEY_MAYBE(CONFIG_HUGETLB_PAGE_OPTIMIZE_VMEMMAP_DEFAULT_ON,
    | ^~~~~~~~~~~~~~~~~~~~~~~~
    ./include/linux/page-flags.h:208:1: error: type defaults to 'int' in
    declaration of 'DECLARE_STATIC_KEY_MAYBE' [-Werror=implicit-int]
    ./include/linux/page-flags.h:209:26: warning: parameter names (without
    types) in function declaration
    209 | hugetlb_optimize_vmemmap_key);
    | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ./include/linux/page-flags.h: In function 'hugetlb_optimize_vmemmap_enabled':
    ./include/linux/page-flags.h:213:16: error: implicit declaration of
    function 'static_branch_maybe' [-Werror=implicit-function-declaration]
    213 | return static_branch_maybe(CONFIG_HUGETLB_PAGE_OPTIMIZE_VMEMMAP_DEFAULT_ON,
    | ^~~~~~~~~~~~~~~~~~~
    ./include/linux/page-flags.h:213:36: error:
    'CONFIG_HUGETLB_PAGE_OPTIMIZE_VMEMMAP_DEFAULT_ON' undeclared (first
    use in this function); did you mean
    'CONFIG_HUGETLB_PAGE_OPTIMIZE_VMEMMAP'?
    213 | return static_branch_maybe(CONFIG_HUGETLB_PAGE_OPTIMIZE_VMEMMAP_DEFAULT_ON,
    | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    | CONFIG_HUGETLB_PAGE_OPTIMIZE_VMEMMAP
    ./include/linux/page-flags.h:213:36: note: each undeclared identifier
    is reported only once for each function it appears in
    ./include/linux/page-flags.h:214:37: error:
    'hugetlb_optimize_vmemmap_key' undeclared (first use in this
    function); did you mean 'hugetlb_optimize_vmemmap_enabled'?
    214 | &hugetlb_optimize_vmemmap_key);
    | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
    | hugetlb_optimize_vmemmap_enabled
    Signed-off-by: NFeiyang Chen <chenfeiyang@loongson.cn>
    Signed-off-by: NHuacai Chen <chenhuacai@loongson.cn>
    b5c83268
page-flags.h 31.0 KB