]> git.baikalelectronics.ru Git - kernel.git/commit
mm/hugetlb: add available_huge_pages() func
authorXin Hao <xhao@linux.alibaba.com>
Thu, 22 Sep 2022 02:19:29 +0000 (10:19 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 3 Oct 2022 21:03:35 +0000 (14:03 -0700)
commit8346d69d8bcb6c526a0d8bd126241dff41a60723
treece7dfcae9b1c8c6af6be33e13549cd380e346ff3
parent6b91e5dfb3c7ef485587e7ab494dcb47bcdadce3
mm/hugetlb: add available_huge_pages() func

In hugetlb.c there are several places which compare the values of
'h->free_huge_pages' and 'h->resv_huge_pages', it looks a bit messy, so
add a new available_huge_pages() function to do these.

Link: https://lkml.kernel.org/r/20220922021929.98961-1-xhao@linux.alibaba.com
Signed-off-by: Xin Hao <xhao@linux.alibaba.com>
Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com>
Reviewed-by: Muchun Song <songmuchun@bytedance.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Oscar Salvador <osalvador@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/hugetlb.c