aboutsummaryrefslogtreecommitdiff
path: root/drivers/scsi/mpt2sas/mpi/mpi2_raid.h
diff options
context:
space:
mode:
authorYuanhan Liu <[email protected]>2013-02-01 18:59:16 +0800
committerIngo Molnar <[email protected]>2013-02-19 08:43:39 +0100
commit41ef8f826692c8f65882bec0a8211bd4d1d2d19a (patch)
treea59199669e2ffb6f1fffaaee9a98b50fd82d1d96 /drivers/scsi/mpt2sas/mpi/mpi2_raid.h
parentfe2b05f7ca9f906be61dced5489f63b8b4d7c770 (diff)
rwsem-spinlock: Implement writer lock-stealing for better scalability
We (Linux Kernel Performance project) found a regression introduced by commit: 5a505085f043 mm/rmap: Convert the struct anon_vma::mutex to an rwsem which converted all anon_vma::mutex locks rwsem write locks. The semantics are the same, but the behavioral difference is quite huge in some cases. After investigating it we found the root cause: mutexes support lock stealing while rwsems don't. Here is the link for the detailed regression report: https://lkml.org/lkml/2013/1/29/84 Ingo suggested adding write lock stealing to rwsems: "I think we should allow lock-steal between rwsem writers - that will not hurt fairness as most rwsem fairness concerns relate to reader vs. writer fairness" And here is the rwsem-spinlock version. With this patch, we got a double performance increase in one test box with following aim7 workfile: FILESIZE: 1M POOLSIZE: 10M 10 fork_test /usr/bin/time output w/o patch /usr/bin/time_output with patch -- Percent of CPU this job got: 369% Percent of CPU this job got: 537% Voluntary context switches: 640595016 Voluntary context switches: 157915561 We got a 45% increase in CPU usage and saved about 3/4 voluntary context switches. Reported-by: LKP project <[email protected]> Suggested-by: Ingo Molnar <[email protected]> Signed-off-by: Yuanhan Liu <[email protected]> Cc: Alex Shi <[email protected]> Cc: David Howells <[email protected]> Cc: Michel Lespinasse <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Andrew Morton <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Anton Blanchard <[email protected]> Cc: Arjan van de Ven <[email protected]> Cc: [email protected] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
Diffstat (limited to 'drivers/scsi/mpt2sas/mpi/mpi2_raid.h')
0 files changed, 0 insertions, 0 deletions