diff options
author | Miaohe Lin <linmiaohe@huawei.com> | 2021-05-04 18:34:35 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2021-05-05 11:27:21 -0700 |
commit | dddf31a49a0eb858bba58876c3c67dd8ea81b800 (patch) | |
tree | e6c46e8b9640e07449701ddfd9f9c13a15c6f188 /mm/pgalloc-track.h | |
parent | bf3d12b9f7f9e7c4ae4aa94c6c81400d3bf688e6 (diff) | |
download | linux-dddf31a49a0eb858bba58876c3c67dd8ea81b800.tar.bz2 |
mm/hugeltb: clarify (chg - freed) won't go negative in hugetlb_unreserve_pages()
The resv_map could be NULL since this routine can be called in the evict
inode path for all hugetlbfs inodes and we will have chg = 0 in this case.
But (chg - freed) won't go negative as Mike pointed out:
"If resv_map is NULL, then no hugetlb pages can be allocated/associated
with the file. As a result, remove_inode_hugepages will never find any
huge pages associated with the inode and the passed value 'freed' will
always be zero."
Add a comment clarifying this to make it clear and also avoid confusion.
Link: https://lkml.kernel.org/r/20210410072348.20437-4-linmiaohe@huawei.com
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Cc: Feilong Lin <linfeilong@huawei.com>
Cc: Mike Kravetz <mike.kravetz@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/pgalloc-track.h')
0 files changed, 0 insertions, 0 deletions