mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-06 13:16:22 +00:00
proc: convert smaps_pmd_entry to use a folio
Replace two calls to compound_head() with one. Link: https://lkml.kernel.org/r/20240403171456.1445117-5-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Cc: Christian Brauner <brauner@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
parent
27bb0a70e5
commit
039d26d10d
@ -578,6 +578,7 @@ static void smaps_pmd_entry(pmd_t *pmd, unsigned long addr,
|
||||
struct vm_area_struct *vma = walk->vma;
|
||||
bool locked = !!(vma->vm_flags & VM_LOCKED);
|
||||
struct page *page = NULL;
|
||||
struct folio *folio;
|
||||
bool migration = false;
|
||||
|
||||
if (pmd_present(*pmd)) {
|
||||
@ -592,11 +593,12 @@ static void smaps_pmd_entry(pmd_t *pmd, unsigned long addr,
|
||||
}
|
||||
if (IS_ERR_OR_NULL(page))
|
||||
return;
|
||||
if (PageAnon(page))
|
||||
folio = page_folio(page);
|
||||
if (folio_test_anon(folio))
|
||||
mss->anonymous_thp += HPAGE_PMD_SIZE;
|
||||
else if (PageSwapBacked(page))
|
||||
else if (folio_test_swapbacked(folio))
|
||||
mss->shmem_thp += HPAGE_PMD_SIZE;
|
||||
else if (is_zone_device_page(page))
|
||||
else if (folio_is_zone_device(folio))
|
||||
/* pass */;
|
||||
else
|
||||
mss->file_thp += HPAGE_PMD_SIZE;
|
||||
|
Loading…
Reference in New Issue
Block a user