Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F162284113
D20903.id60074.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
5 KB
Referenced Files
None
Subscribers
None
D20903.id60074.diff
View Options
Index: sys/conf/options.powerpc
===================================================================
--- sys/conf/options.powerpc
+++ sys/conf/options.powerpc
@@ -19,6 +19,7 @@
GFB_NO_FONT_LOADING opt_gfb.h
GFB_NO_MODE_CHANGE opt_gfb.h
+MOEA64_STATS opt_pmap.h
MPC85XX opt_platform.h
POWERMAC opt_platform.h
PS3 opt_platform.h
Index: sys/powerpc/aim/mmu_oea64.h
===================================================================
--- sys/powerpc/aim/mmu_oea64.h
+++ sys/powerpc/aim/mmu_oea64.h
@@ -72,8 +72,13 @@
* Statistics
*/
+#ifdef MOEA64_STATS
extern u_int moea64_pte_valid;
extern u_int moea64_pte_overflow;
+#define STAT_MOEA64(x) x
+#else
+#define STAT_MOEA64(x) ((void)0)
+#endif
/*
* State variables
Index: sys/powerpc/aim/mmu_oea64.c
===================================================================
--- sys/powerpc/aim/mmu_oea64.c
+++ sys/powerpc/aim/mmu_oea64.c
@@ -46,6 +46,7 @@
*/
#include "opt_kstack_pages.h"
+#include "opt_pmap.h"
#include <sys/param.h>
#include <sys/kernel.h>
@@ -200,6 +201,7 @@
static boolean_t moea64_initialized = FALSE;
+#ifdef MOEA64_STATS
/*
* Statistics.
*/
@@ -218,6 +220,7 @@
&moea64_pvo_enter_calls, 0, "");
SYSCTL_INT(_machdep, OID_AUTO, moea64_pvo_remove_calls, CTLFLAG_RD,
&moea64_pvo_remove_calls, 0, "");
+#endif
vm_offset_t moea64_scratchpage_va[2];
struct pvo_entry *moea64_scratchpage_pvo[2];
@@ -1434,7 +1437,7 @@
/* If not in page table, reinsert it */
if (MOEA64_PTE_SYNCH(mmu, oldpvo) < 0) {
- moea64_pte_overflow--;
+ STAT_MOEA64(moea64_pte_overflow--);
MOEA64_PTE_INSERT(mmu, oldpvo);
}
@@ -2524,7 +2527,7 @@
PMAP_LOCK_ASSERT(pvo->pvo_pmap, MA_OWNED);
- moea64_pvo_enter_calls++;
+ STAT_MOEA64(moea64_pvo_enter_calls++);
/*
* Add to pmap list
@@ -2559,7 +2562,7 @@
panic("moea64_pvo_enter: overflow");
}
- moea64_pvo_entries++;
+ STAT_MOEA64(moea64_pvo_entries++);
if (pvo->pvo_pmap == kernel_pmap)
isync();
@@ -2658,8 +2661,8 @@
}
}
- moea64_pvo_entries--;
- moea64_pvo_remove_calls++;
+ STAT_MOEA64(moea64_pvo_entries--);
+ STAT_MOEA64(moea64_pvo_remove_calls++);
}
static void
Index: sys/powerpc/aim/moea64_native.c
===================================================================
--- sys/powerpc/aim/moea64_native.c
+++ sys/powerpc/aim/moea64_native.c
@@ -88,6 +88,8 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
+#include "opt_pmap.h"
+
/*
* Native 64-bit page table operations for running without a hypervisor.
*/
@@ -332,7 +334,7 @@
if ((be64toh(pt->pte_hi & LPTE_AVPN_MASK)) !=
(properpt.pte_hi & LPTE_AVPN_MASK)) {
/* Evicted */
- moea64_pte_overflow--;
+ STAT_MOEA64(moea64_pte_overflow--);
rw_runlock(&moea64_eviction_lock);
return (-1);
}
@@ -352,7 +354,7 @@
rw_runlock(&moea64_eviction_lock);
/* Keep statistics */
- moea64_pte_valid--;
+ STAT_MOEA64(moea64_pte_valid--);
return (ptelo & (LPTE_CHG | LPTE_REF));
}
@@ -656,8 +658,8 @@
(ADDR_API_SHFT64 - ADDR_PIDX_SHFT);
PTESYNC();
TLBIE(va);
- moea64_pte_valid--;
- moea64_pte_overflow++;
+ STAT_MOEA64(moea64_pte_valid--);
+ STAT_MOEA64(moea64_pte_overflow++);
}
/*
@@ -670,7 +672,7 @@
PTESYNC();
/* Keep statistics */
- moea64_pte_valid++;
+ STAT_MOEA64(moea64_pte_valid++);
return (k);
}
Index: sys/powerpc/ps3/mmu_ps3.c
===================================================================
--- sys/powerpc/ps3/mmu_ps3.c
+++ sys/powerpc/ps3/mmu_ps3.c
@@ -28,6 +28,8 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
+#include "opt_pmap.h"
+
#include <sys/param.h>
#include <sys/kernel.h>
#include <sys/ktr.h>
@@ -224,14 +226,14 @@
mtx_lock(&mps3_table_lock);
refchg = mps3_pte_synch_locked(pvo);
if (refchg < 0) {
- moea64_pte_overflow--;
+ STAT_MOEA64(moea64_pte_overflow--);
mtx_unlock(&mps3_table_lock);
return (-1);
}
/* XXX: race on RC bits between unset and sync. Anything to do? */
lv1_write_htab_entry(mps3_vas_id, pvo->pvo_pte.slot, 0, 0);
mtx_unlock(&mps3_table_lock);
- moea64_pte_valid--;
+ STAT_MOEA64(moea64_pte_valid--);
return (refchg & (LPTE_REF | LPTE_CHG));
}
@@ -272,13 +274,13 @@
pvo->pvo_vaddr |= PVO_HID;
pvo->pvo_pte.slot = index;
- moea64_pte_valid++;
+ STAT_MOEA64(moea64_pte_valid++);
if (evicted.pte_hi) {
KASSERT((evicted.pte_hi & (LPTE_WIRED | LPTE_LOCKED)) == 0,
("Evicted a wired PTE"));
- moea64_pte_valid--;
- moea64_pte_overflow++;
+ STAT_MOEA64(moea64_pte_valid--);
+ STAT_MOEA64(moea64_pte_overflow++);
}
return (0);
Index: sys/powerpc/pseries/mmu_phyp.c
===================================================================
--- sys/powerpc/pseries/mmu_phyp.c
+++ sys/powerpc/pseries/mmu_phyp.c
@@ -28,6 +28,8 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
+#include "opt_pmap.h"
+
#include <sys/param.h>
#include <sys/kernel.h>
#include <sys/ktr.h>
@@ -364,7 +366,7 @@
("Error removing page: %d", err));
if (err == H_NOT_FOUND) {
- moea64_pte_overflow--;
+ STAT_MOEA64(moea64_pte_overflow--);
return (-1);
}
@@ -485,7 +487,7 @@
result = phyp_pft_hcall(H_REMOVE, H_AVPN, index,
evicted.pte_hi & LPTE_AVPN_MASK, 0, &junk, &lastptelo,
&junk);
- moea64_pte_overflow++;
+ STAT_MOEA64(moea64_pte_overflow++);
KASSERT(result == H_SUCCESS || result == H_NOT_FOUND,
("Error evicting page: %d", (int)result));
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Jul 12, 4:48 PM (3 h, 16 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35003761
Default Alt Text
D20903.id60074.diff (5 KB)
Attached To
Mode
D20903: powerpc/pmap64: Make moea64 statistics optional
Attached
Detach File
Event Timeline
Log In to Comment