diff options
author | attilio <attilio@FreeBSD.org> | 2012-11-03 23:03:14 +0000 |
---|---|---|
committer | attilio <attilio@FreeBSD.org> | 2012-11-03 23:03:14 +0000 |
commit | f3501b109e4c598688ec381ebd73e59c45bfa3b0 (patch) | |
tree | 6411bccb7372a8d587dd213ecf9a07e5207ee325 /sys/sparc64 | |
parent | 3f3e3a0702399e665a93253ca4b4b31c1754f09b (diff) | |
download | FreeBSD-src-f3501b109e4c598688ec381ebd73e59c45bfa3b0.zip FreeBSD-src-f3501b109e4c598688ec381ebd73e59c45bfa3b0.tar.gz |
Rework the known rwlock to benefit about staying on their own
cache line in order to avoid manual frobbing but using
struct rwlock_padalign.
Reviewed by: alc, jimharris
Diffstat (limited to 'sys/sparc64')
-rw-r--r-- | sys/sparc64/include/pmap.h | 8 | ||||
-rw-r--r-- | sys/sparc64/sparc64/pmap.c | 7 |
2 files changed, 2 insertions, 13 deletions
diff --git a/sys/sparc64/include/pmap.h b/sys/sparc64/include/pmap.h index cf2b2af..6e2575d 100644 --- a/sys/sparc64/include/pmap.h +++ b/sys/sparc64/include/pmap.h @@ -68,11 +68,6 @@ 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)) @@ -108,8 +103,7 @@ void pmap_set_kctx(void); extern struct pmap kernel_pmap_store; #define kernel_pmap (&kernel_pmap_store) -extern struct tte_list_lock tte_list_global; -#define tte_list_global_lock tte_list_global.lock +extern struct rwlock_padalign 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 0e1c8f9..d20d69f 100644 --- a/sys/sparc64/sparc64/pmap.c +++ b/sys/sparc64/sparc64/pmap.c @@ -129,12 +129,7 @@ vm_offset_t vm_max_kernel_address; */ struct pmap kernel_pmap_store; -/* - * 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 tte_list_lock tte_list_global __aligned(CACHE_LINE_SIZE); +struct rwlock_padalign tte_list_global_lock; /* * Allocate physical memory for use in pmap_bootstrap. |