diff options
author | marius <marius@FreeBSD.org> | 2012-08-05 22:03:13 +0000 |
---|---|---|
committer | marius <marius@FreeBSD.org> | 2012-08-05 22:03:13 +0000 |
commit | 4c012f63e6340a8f25a71fd86d158c40dbf50130 (patch) | |
tree | 35ccd19cde0566b53f214d23fe3aa3d1b8421c93 /sys/sparc64 | |
parent | d26d8ba30eaee1da4f99bbbd979e7ec9c80b7820 (diff) | |
download | FreeBSD-src-4c012f63e6340a8f25a71fd86d158c40dbf50130.zip FreeBSD-src-4c012f63e6340a8f25a71fd86d158c40dbf50130.tar.gz |
Merge r236494 from x86:
Isolate the global TTE list lock from data and other locks to prevent false
sharing within the cache.
MFC after: 3 days
Diffstat (limited to 'sys/sparc64')
-rw-r--r-- | sys/sparc64/include/pmap.h | 8 | ||||
-rw-r--r-- | sys/sparc64/sparc64/pmap.c | 8 |
2 files changed, 12 insertions, 4 deletions
diff --git a/sys/sparc64/include/pmap.h b/sys/sparc64/include/pmap.h index 2ab3901..cf2b2af 100644 --- a/sys/sparc64/include/pmap.h +++ b/sys/sparc64/include/pmap.h @@ -68,6 +68,11 @@ struct pmap { struct pmap_statistics pm_stats; }; +struct tte_list_lock { + struct rwlock lock; + char padding[CACHE_LINE_SIZE - sizeof(struct rwlock)]; +}; + #define PMAP_LOCK(pmap) mtx_lock(&(pmap)->pm_mtx) #define PMAP_LOCK_ASSERT(pmap, type) \ mtx_assert(&(pmap)->pm_mtx, (type)) @@ -103,7 +108,8 @@ void pmap_set_kctx(void); extern struct pmap kernel_pmap_store; #define kernel_pmap (&kernel_pmap_store) -extern struct rwlock tte_list_global_lock; +extern struct tte_list_lock tte_list_global; +#define tte_list_global_lock tte_list_global.lock extern vm_paddr_t phys_avail[]; extern vm_offset_t virtual_avail; extern vm_offset_t virtual_end; diff --git a/sys/sparc64/sparc64/pmap.c b/sys/sparc64/sparc64/pmap.c index 6d9e43d..ac48768 100644 --- a/sys/sparc64/sparc64/pmap.c +++ b/sys/sparc64/sparc64/pmap.c @@ -135,9 +135,11 @@ vm_offset_t vm_max_kernel_address; struct pmap kernel_pmap_store; /* - * Global tte list lock + * Isolate the global TTE list lock from data and other locks to prevent + * false sharing within the cache (see also the declaration of struct + * tte_list_lock). */ -struct rwlock tte_list_global_lock; +struct tte_list_lock tte_list_global __aligned(CACHE_LINE_SIZE); /* * Allocate physical memory for use in pmap_bootstrap. @@ -672,7 +674,7 @@ pmap_bootstrap(u_int cpu_impl) pm->pm_context[i] = TLB_CTX_KERNEL; CPU_FILL(&pm->pm_active); - /* + /* * Initialize the global tte list lock, which is more commonly * known as the pmap pv global lock. */ |