diff options
author | zhong jiang <zhongjiang@huawei.com> | 2016-10-07 20:02:01 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-10-07 21:46:29 -0400 |
commit | 72e2936c04f7d2a4bf87d7f72d3bf11cf91ebb47 (patch) | |
tree | e074463b15c0c725afca88f16a5683ae437e0459 /fs/hugetlbfs/inode.c | |
parent | 63f53dea0c9866e93802d50a230c460a024c44e5 (diff) |
mm: remove unnecessary condition in remove_inode_hugepages
When the huge page is added to the page cahce (huge_add_to_page_cache),
the page private flag will be cleared. since this code
(remove_inode_hugepages) will only be called for pages in the page
cahce, PagePrivate(page) will always be false.
The patch remove the code without any functional change.
Link: http://lkml.kernel.org/r/1475113323-29368-1-git-send-email-zhongjiang@huawei.com
Signed-off-by: zhong jiang <zhongjiang@huawei.com>
Reviewed-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com>
Tested-by: Mike Kravetz <mike.kravetz@oracle.com>
Acked-by: Michal Hocko <mhocko@suse.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/hugetlbfs/inode.c')
-rw-r--r-- | fs/hugetlbfs/inode.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c index 4ea71eba40a5..7337cac29e9e 100644 --- a/fs/hugetlbfs/inode.c +++ b/fs/hugetlbfs/inode.c | |||
@@ -416,7 +416,6 @@ static void remove_inode_hugepages(struct inode *inode, loff_t lstart, | |||
416 | 416 | ||
417 | for (i = 0; i < pagevec_count(&pvec); ++i) { | 417 | for (i = 0; i < pagevec_count(&pvec); ++i) { |
418 | struct page *page = pvec.pages[i]; | 418 | struct page *page = pvec.pages[i]; |
419 | bool rsv_on_error; | ||
420 | u32 hash; | 419 | u32 hash; |
421 | 420 | ||
422 | /* | 421 | /* |
@@ -458,18 +457,17 @@ static void remove_inode_hugepages(struct inode *inode, loff_t lstart, | |||
458 | * cache (remove_huge_page) BEFORE removing the | 457 | * cache (remove_huge_page) BEFORE removing the |
459 | * region/reserve map (hugetlb_unreserve_pages). In | 458 | * region/reserve map (hugetlb_unreserve_pages). In |
460 | * rare out of memory conditions, removal of the | 459 | * rare out of memory conditions, removal of the |
461 | * region/reserve map could fail. Before free'ing | 460 | * region/reserve map could fail. Correspondingly, |
462 | * the page, note PagePrivate which is used in case | 461 | * the subpool and global reserve usage count can need |
463 | * of error. | 462 | * to be adjusted. |
464 | */ | 463 | */ |
465 | rsv_on_error = !PagePrivate(page); | 464 | VM_BUG_ON(PagePrivate(page)); |
466 | remove_huge_page(page); | 465 | remove_huge_page(page); |
467 | freed++; | 466 | freed++; |
468 | if (!truncate_op) { | 467 | if (!truncate_op) { |
469 | if (unlikely(hugetlb_unreserve_pages(inode, | 468 | if (unlikely(hugetlb_unreserve_pages(inode, |
470 | next, next + 1, 1))) | 469 | next, next + 1, 1))) |
471 | hugetlb_fix_reserve_counts(inode, | 470 | hugetlb_fix_reserve_counts(inode); |
472 | rsv_on_error); | ||
473 | } | 471 | } |
474 | 472 | ||
475 | unlock_page(page); | 473 | unlock_page(page); |