]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blame - mm/hugetlb_vmemmap.h
mm: memory_hotplug: disable memmap_on_memory when hugetlb_free_vmemmap enabled
[mirror_ubuntu-jammy-kernel.git] / mm / hugetlb_vmemmap.h
CommitLineData
f41f2ed4
MS
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Free some vmemmap pages of HugeTLB
4 *
5 * Copyright (c) 2020, Bytedance. All rights reserved.
6 *
7 * Author: Muchun Song <songmuchun@bytedance.com>
8 */
9#ifndef _LINUX_HUGETLB_VMEMMAP_H
10#define _LINUX_HUGETLB_VMEMMAP_H
11#include <linux/hugetlb.h>
12
13#ifdef CONFIG_HUGETLB_PAGE_FREE_VMEMMAP
ad2fa371 14int alloc_huge_page_vmemmap(struct hstate *h, struct page *head);
f41f2ed4 15void free_huge_page_vmemmap(struct hstate *h, struct page *head);
b65d4adb
MS
16
17/*
18 * How many vmemmap pages associated with a HugeTLB page that can be freed
19 * to the buddy allocator.
20 *
21 * Todo: Returns zero for now, which means the feature is disabled. We will
22 * enable it once all the infrastructure is there.
23 */
24static inline unsigned int free_vmemmap_pages_per_hpage(struct hstate *h)
25{
26 return 0;
27}
f41f2ed4 28#else
ad2fa371
MS
29static inline int alloc_huge_page_vmemmap(struct hstate *h, struct page *head)
30{
31 return 0;
32}
33
f41f2ed4
MS
34static inline void free_huge_page_vmemmap(struct hstate *h, struct page *head)
35{
36}
b65d4adb
MS
37
38static inline unsigned int free_vmemmap_pages_per_hpage(struct hstate *h)
39{
40 return 0;
41}
f41f2ed4
MS
42#endif /* CONFIG_HUGETLB_PAGE_FREE_VMEMMAP */
43#endif /* _LINUX_HUGETLB_VMEMMAP_H */