diff options
author | nwhitehorn <nwhitehorn@FreeBSD.org> | 2012-04-22 19:00:51 +0000 |
---|---|---|
committer | nwhitehorn <nwhitehorn@FreeBSD.org> | 2012-04-22 19:00:51 +0000 |
commit | 086dac3dc0518572e2b498bf25768f4457eba105 (patch) | |
tree | a78231dc3f74d60d8fe3c540394a1a87f9a210d0 /sys/powerpc/aim | |
parent | 0e093d4003dfd64e9a626b7e6addc1ed61586b31 (diff) | |
download | FreeBSD-src-086dac3dc0518572e2b498bf25768f4457eba105.zip FreeBSD-src-086dac3dc0518572e2b498bf25768f4457eba105.tar.gz |
Use lwsync to provide memory barriers on systems that support it instead
of sync (lwsync is an alternate encoding of sync on systems that do not
support it, providing graceful fallback). This provides more than an order
of magnitude reduction in the time required to acquire or release a mutex.
MFC after: 2 months
Diffstat (limited to 'sys/powerpc/aim')
-rw-r--r-- | sys/powerpc/aim/slb.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/powerpc/aim/slb.c b/sys/powerpc/aim/slb.c index 7f4b2ef..162c7fb 100644 --- a/sys/powerpc/aim/slb.c +++ b/sys/powerpc/aim/slb.c @@ -139,7 +139,7 @@ make_new_leaf(uint64_t esid, uint64_t slbv, struct slbtnode *parent) * that a lockless searcher always sees a valid path through * the tree. */ - powerpc_sync(); + mb(); idx = esid2idx(esid, parent->ua_level); parent->u.ua_child[idx] = child; @@ -187,7 +187,7 @@ make_intermediate(uint64_t esid, struct slbtnode *parent) idx = esid2idx(child->ua_base, inter->ua_level); inter->u.ua_child[idx] = child; setbit(&inter->ua_alloc, idx); - powerpc_sync(); + mb(); /* Set up parent to point to intermediate node ... */ idx = esid2idx(inter->ua_base, parent->ua_level); |