diff options
author | Matthew Wilcox (Oracle) <willy@infradead.org> | 2019-09-24 01:34:30 +0300 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-09-25 01:54:08 +0300 |
commit | d8c6546b1aea843fbeb4d54a1202f1adda6504be (patch) | |
tree | 4b0fcc4a1afc9342472d59293b50fce20f2d70e7 /mm/rmap.c | |
parent | 94ad9338109fe9d0b8a4a16828719dd6dcaee4c2 (diff) | |
download | linux-d8c6546b1aea843fbeb4d54a1202f1adda6504be.tar.xz |
mm: introduce compound_nr()
Replace 1 << compound_order(page) with compound_nr(page). Minor
improvements in readability.
Link: http://lkml.kernel.org/r/20190721104612.19120-4-willy@infradead.org
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: 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 'mm/rmap.c')
-rw-r--r-- | mm/rmap.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/mm/rmap.c b/mm/rmap.c index f401732b20e8..26006445c8b5 100644 --- a/mm/rmap.c +++ b/mm/rmap.c @@ -1520,8 +1520,7 @@ static bool try_to_unmap_one(struct page *page, struct vm_area_struct *vma, if (PageHWPoison(page) && !(flags & TTU_IGNORE_HWPOISON)) { pteval = swp_entry_to_pte(make_hwpoison_entry(subpage)); if (PageHuge(page)) { - int nr = 1 << compound_order(page); - hugetlb_count_sub(nr, mm); + hugetlb_count_sub(compound_nr(page), mm); set_huge_swap_pte_at(mm, address, pvmw.pte, pteval, vma_mmu_pagesize(vma)); |