diff options
Diffstat (limited to 'tools/vm/page-types.c')
-rw-r--r-- | tools/vm/page-types.c | 32 |
1 files changed, 12 insertions, 20 deletions
diff --git a/tools/vm/page-types.c b/tools/vm/page-types.c index d5e9d6d..71c9c25 100644 --- a/tools/vm/page-types.c +++ b/tools/vm/page-types.c @@ -59,14 +59,12 @@ #define PM_PSHIFT_BITS 6 #define PM_PSHIFT_OFFSET (PM_STATUS_OFFSET - PM_PSHIFT_BITS) #define PM_PSHIFT_MASK (((1LL << PM_PSHIFT_BITS) - 1) << PM_PSHIFT_OFFSET) -#define __PM_PSHIFT(x) (((uint64_t) (x) << PM_PSHIFT_OFFSET) & PM_PSHIFT_MASK) +#define PM_PSHIFT(x) (((u64) (x) << PM_PSHIFT_OFFSET) & PM_PSHIFT_MASK) #define PM_PFRAME_MASK ((1LL << PM_PSHIFT_OFFSET) - 1) #define PM_PFRAME(x) ((x) & PM_PFRAME_MASK) -#define __PM_SOFT_DIRTY (1LL) #define PM_PRESENT PM_STATUS(4LL) #define PM_SWAP PM_STATUS(2LL) -#define PM_SOFT_DIRTY __PM_PSHIFT(__PM_SOFT_DIRTY) /* @@ -85,7 +83,6 @@ #define KPF_OWNER_PRIVATE 37 #define KPF_ARCH 38 #define KPF_UNCACHED 39 -#define KPF_SOFTDIRTY 40 /* [48-] take some arbitrary free slots for expanding overloaded flags * not part of kernel API @@ -135,7 +132,6 @@ static const char * const page_flag_names[] = { [KPF_OWNER_PRIVATE] = "O:owner_private", [KPF_ARCH] = "h:arch", [KPF_UNCACHED] = "c:uncached", - [KPF_SOFTDIRTY] = "f:softdirty", [KPF_READAHEAD] = "I:readahead", [KPF_SLOB_FREE] = "P:slob_free", @@ -421,7 +417,7 @@ static int bit_mask_ok(uint64_t flags) return 1; } -static uint64_t expand_overloaded_flags(uint64_t flags, uint64_t pme) +static uint64_t expand_overloaded_flags(uint64_t flags) { /* SLOB/SLUB overload several page flags */ if (flags & BIT(SLAB)) { @@ -437,9 +433,6 @@ static uint64_t expand_overloaded_flags(uint64_t flags, uint64_t pme) if ((flags & (BIT(RECLAIM) | BIT(WRITEBACK))) == BIT(RECLAIM)) flags ^= BIT(RECLAIM) | BIT(READAHEAD); - if (pme & PM_SOFT_DIRTY) - flags |= BIT(SOFTDIRTY); - return flags; } @@ -455,11 +448,11 @@ static uint64_t well_known_flags(uint64_t flags) return flags; } -static uint64_t kpageflags_flags(uint64_t flags, uint64_t pme) +static uint64_t kpageflags_flags(uint64_t flags) { - if (opt_raw) - flags = expand_overloaded_flags(flags, pme); - else + flags = expand_overloaded_flags(flags); + + if (!opt_raw) flags = well_known_flags(flags); return flags; @@ -552,9 +545,9 @@ static size_t hash_slot(uint64_t flags) } static void add_page(unsigned long voffset, - unsigned long offset, uint64_t flags, uint64_t pme) + unsigned long offset, uint64_t flags) { - flags = kpageflags_flags(flags, pme); + flags = kpageflags_flags(flags); if (!bit_mask_ok(flags)) return; @@ -576,8 +569,7 @@ static void add_page(unsigned long voffset, #define KPAGEFLAGS_BATCH (64 << 10) /* 64k pages */ static void walk_pfn(unsigned long voffset, unsigned long index, - unsigned long count, - uint64_t pme) + unsigned long count) { uint64_t buf[KPAGEFLAGS_BATCH]; unsigned long batch; @@ -591,7 +583,7 @@ static void walk_pfn(unsigned long voffset, break; for (i = 0; i < pages; i++) - add_page(voffset + i, index + i, buf[i], pme); + add_page(voffset + i, index + i, buf[i]); index += pages; count -= pages; @@ -616,7 +608,7 @@ static void walk_vma(unsigned long index, unsigned long count) for (i = 0; i < pages; i++) { pfn = pagemap_pfn(buf[i]); if (pfn) - walk_pfn(index + i, pfn, 1, buf[i]); + walk_pfn(index + i, pfn, 1); } index += pages; @@ -667,7 +659,7 @@ static void walk_addr_ranges(void) for (i = 0; i < nr_addr_ranges; i++) if (!opt_pid) - walk_pfn(0, opt_offset[i], opt_size[i], 0); + walk_pfn(0, opt_offset[i], opt_size[i]); else walk_task(opt_offset[i], opt_size[i]); |