Change in vdsm[master]: rwlock: Add simpler RWLock

alitke at redhat.com alitke at redhat.com
Mon Jan 18 14:31:26 UTC 2016


Adam Litke has posted comments on this change.

Change subject: rwlock: Add simpler RWLock
......................................................................


Patch Set 23:

(4 comments)

https://gerrit.ovirt.org/#/c/42908/23//COMMIT_MSG
Commit Message:

Line 23: supporting timed acquire.
Line 24: 
Line 25: This implementation has less overhead, as seen in the fairness tests
Line 26: with many writers and readers (tested on Lenovo T430s).
Line 27: 
You could mention that larger numbers mean more throughput.
Line 28: storage.misc.RWLock
Line 29: -------------------
Line 30: 
Line 31: writers: 1 readers: 2


Line 60: reads   avg=323.72 med=324 min=323 max=325
Line 61: 
Line 62: writers: 4 readers: 128
Line 63: writes  avg=82.00 med=82 min=82 max=82
Line 64: reads   avg=83.23 med=83 min=82 max=89
I think the read throughput could be dramatically increased without degrading the write throughput much if you searched the waiters for multiple readers to grant at the same time.
Line 65: 
Line 66: To run this test, use:
Line 67: 
Line 68:     ./run_tests_local.sh --enable-stress-tests rwlock_test.py:RWLockStressTests


https://gerrit.ovirt.org/#/c/42908/23/lib/vdsm/rwlock.py
File lib/vdsm/rwlock.py:

Line 1: #
Line 2: # Copyright 2015 Red Hat, Inc.
2016
Line 3: #
Line 4: # This program is free software; you can redistribute it and/or modify
Line 5: # it under the terms of the GNU General Public License as published by
Line 6: # the Free Software Foundation; either version 2 of the License, or


Line 61:         with lock.shared:
Line 62:             do stuff that require a shared lock..
Line 63: 
Line 64:     When a thread is holding a read lock, other threads requesting a read lock
Line 65:     can acquire the lock. Other threads requesting a write lock will be blocked
When a reader is granted the lock, do we want to search the waiters for other readers in order to grant them similtaneous access?  I guess this could cause a fairness issue though.
Line 66:     until all the readers release their lock.
Line 67: 
Line 68:     If a reader try to acquire a read lock while other threads are waiting
Line 69:     (e.g. a writer), the reader is blocked until the waiting writer will get


-- 
To view, visit https://gerrit.ovirt.org/42908
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I2466c137c89598772fb46347eb02195916883cac
Gerrit-PatchSet: 23
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Adam Litke <alitke at redhat.com>
Gerrit-Reviewer: Ala Hino <ahino at redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Dima Kuznetsov <dmitrykuzn at gmail.com>
Gerrit-Reviewer: Federico Simoncelli <fsimonce at redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Freddy Rolland <frolland at redhat.com>
Gerrit-Reviewer: Ido Barkan <ibarkan at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list