From: Eric B Munson Date: Thu, 13 Jan 2011 23:47:27 +0000 (-0800) Subject: hugetlb: do not allow pagesize >= MAX_ORDER pool adjustment X-Git-Tag: v2.6.38-rc1~90 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=adbe8726dc2a3805630d517270db17e3af86e526;p=pandora-kernel.git 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. [akpm@linux-foundation.org: avoid multiple return paths in nr_hugepages_store_common()] [caiqian@redhat.com: add checking in hugetlb_overcommit_handler()] Signed-off-by: Eric B Munson Reported-by: CAI Qian Cc: Andrea Arcangeli Cc: Michal Hocko Cc: Nishanth Aravamudan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed