diff options
author | Andrew Turner <andrew@FreeBSD.org> | 2016-08-22 12:17:40 +0000 |
---|---|---|
committer | Andrew Turner <andrew@FreeBSD.org> | 2016-08-22 12:17:40 +0000 |
commit | aed6b9701b9e77a1b636a0b91c7750280baf4a42 (patch) | |
tree | fa49ab4273450f4ef6f87e84eafd0c63c6c662e9 /sys/arm64 | |
parent | 109dddc015477e4c865b5449dfb3082464e54495 (diff) | |
download | src-aed6b9701b9e77a1b636a0b91c7750280baf4a42.tar.gz src-aed6b9701b9e77a1b636a0b91c7750280baf4a42.zip |
Add sysctls to report on superpages statistics. While here add extra
logging to these paths.
Obtained from: ABT Systems Ltd
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Notes
Notes:
svn path=/head/; revision=304599
Diffstat (limited to 'sys/arm64')
-rw-r--r-- | sys/arm64/arm64/pmap.c | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c index b06c77a499bb..590b9d1851c8 100644 --- a/sys/arm64/arm64/pmap.c +++ b/sys/arm64/arm64/pmap.c @@ -874,6 +874,21 @@ pmap_init(void) rw_init(&pv_list_locks[i], "pmap pv list"); } +static SYSCTL_NODE(_vm_pmap, OID_AUTO, l2, CTLFLAG_RD, 0, + "2MB page mapping counters"); + +static u_long pmap_l2_demotions; +SYSCTL_ULONG(_vm_pmap_l2, OID_AUTO, demotions, CTLFLAG_RD, + &pmap_l2_demotions, 0, "2MB page demotions"); + +static u_long pmap_l2_p_failures; +SYSCTL_ULONG(_vm_pmap_l2, OID_AUTO, p_failures, CTLFLAG_RD, + &pmap_l2_p_failures, 0, "2MB page promotion failures"); + +static u_long pmap_l2_promotions; +SYSCTL_ULONG(_vm_pmap_l2, OID_AUTO, promotions, CTLFLAG_RD, + &pmap_l2_promotions, 0, "2MB page promotions"); + /* * Invalidate a single TLB entry. */ @@ -2309,14 +2324,22 @@ pmap_promote_l2(pmap_t pmap, pd_entry_t *l2, vm_offset_t va, return; /* Check the alingment is valid */ - if (((newl2 & ~ATTR_MASK) & L2_OFFSET) != 0) + if (((newl2 & ~ATTR_MASK) & L2_OFFSET) != 0) { + atomic_add_long(&pmap_l2_p_failures, 1); + CTR2(KTR_PMAP, "pmap_promote_l2: failure for va %#lx" + " in pmap %p", va, pmap); return; + } pa = newl2 + L2_SIZE - PAGE_SIZE; for (l3 = firstl3 + NL3PG - 1; l3 > firstl3; l3--) { oldl3 = pmap_load(l3); - if (oldl3 != pa) + if (oldl3 != pa) { + atomic_add_long(&pmap_l2_p_failures, 1); + CTR2(KTR_PMAP, "pmap_promote_l2: failure for va %#lx" + " in pmap %p", va, pmap); return; + } pa -= PAGE_SIZE; } @@ -2324,6 +2347,8 @@ pmap_promote_l2(pmap_t pmap, pd_entry_t *l2, vm_offset_t va, newl2 |= L2_BLOCK; pmap_update_entry(pmap, l2, newl2, sva, L2_SIZE); + + atomic_add_long(&pmap_l2_promotions, 1); } /* @@ -3745,6 +3770,10 @@ pmap_demote_l2_locked(pmap_t pmap, pt_entry_t *l2, vm_offset_t va, pmap_update_entry(pmap, l2, l3phys | L2_TABLE, va, PAGE_SIZE); + atomic_add_long(&pmap_l2_demotions, 1); + CTR3(KTR_PMAP, "pmap_demote_l2: success for va %#lx" + " in pmap %p %lx", va, pmap, l3[0]); + if (tmpl2 != 0) { pmap_kremove(tmpl2); kva_free(tmpl2, PAGE_SIZE); |