diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2017-01-12 19:07:54 +0100 |
---|---|---|
committer | Stefan Hajnoczi <stefanha@redhat.com> | 2017-01-16 13:25:18 +0000 |
commit | fbcc3e5004f01653b2885965c59cade25e286c18 (patch) | |
tree | ccdd40452c6ddce192c33a68832726fde7ee51f9 /docs | |
parent | d7c99a1282ca2de1c344b8aa91be5364e9c6aa8f (diff) | |
download | qemu-fbcc3e5004f01653b2885965c59cade25e286c18.zip qemu-fbcc3e5004f01653b2885965c59cade25e286c18.tar.gz qemu-fbcc3e5004f01653b2885965c59cade25e286c18.tar.bz2 |
qemu-thread: optimize QemuLockCnt with futexes on Linux
This is complex, but I think it is reasonably documented in the source.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 20170112180800.21085-5-pbonzini@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'docs')
-rw-r--r-- | docs/lockcnt.txt | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/docs/lockcnt.txt b/docs/lockcnt.txt index 25a8091..2a79b32 100644 --- a/docs/lockcnt.txt +++ b/docs/lockcnt.txt @@ -142,12 +142,11 @@ can also be more efficient in two ways: - it avoids taking the lock for many operations (for example incrementing the counter while it is non-zero); -- on some platforms, one could implement QemuLockCnt to hold the - lock and the mutex in a single word, making it no more expensive +- on some platforms, one can implement QemuLockCnt to hold the lock + and the mutex in a single word, making the fast path no more expensive than simply managing a counter using atomic operations (see - docs/atomics.txt). This is not implemented yet, but can be - very helpful if concurrent access to the data structure is - expected to be rare. + docs/atomics.txt). This can be very helpful if concurrent access to + the data structure is expected to be rare. Using the same mutex for frees and writes can still incur some small |