Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
hugetlb: do not allow pagesize >= MAX_ORDER pool adjustment
Huge pages with order >= MAX_ORDER must be allocated at boot via the kernel command line, they cannot be allocated or freed once the kernel is up and running. Currently we allow values to be written to the sysfs and sysctl files controling pool size for these huge page sizes. This patch makes the store functions for nr_hugepages and nr_overcommit_hugepages return -EINVAL when the pool for a page size >= MAX_ORDER is changed. [[email protected]: avoid multiple return paths in nr_hugepages_store_common()] [[email protected]: add checking in hugetlb_overcommit_handler()] Signed-off-by: Eric B Munson <[email protected]> Reported-by: CAI Qian <[email protected]> Cc: Andrea Arcangeli <[email protected]> Cc: Michal Hocko <[email protected]> Cc: Nishanth Aravamudan <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
- Loading branch information