Dazuko - Patches: patch #6165, Rewriting of locking to disable...
You are not allowed to post comments on this tracker with your current authentication level.
patch #6165: Rewriting of locking to disable system crashes on SMP systems
Submitter: | Timo Metsala <timo_metsala> | ||
Submitted: | Fri 24 Aug 2007 01:00:34 PM UTC | ||
Assigned to: | None | Open/Closed: | Open |
Fri 24 Aug 2007 08:28:24 PM UTC, comment #2: |
Timo Metsala <timo_metsala> |
Fri 24 Aug 2007 01:59:03 PM UTC, comment #1: I am curious about the SMP crashes. There have been extensive tests on SMP machines and no known problems exist.
|
John Ogness <ogman> |
Fri 24 Aug 2007 01:00:34 PM UTC, original submission:
Hello,
|
Timo Metsala <timo_metsala> |
Depends on the following items: None found
Items that depend on this one: None found
Follow 3 latest changes.
Date | Changed by | Updated Field | Previous Value | => | Replaced by |
---|---|---|---|---|---|
2011-03-19 | ogman | Assigned to | ogman | None | |
2007-08-24 | ogman | Assigned to | None | ogman | |
2007-08-24 | timo_metsala | Attached File | - | Added dazuko-patch-smp.diff, #13784 |
Powered by Savane 3.13-758e.
Corresponding source code
I'm now talking about Linux only, I haven't actually used dazuko on FreeBSD but from the code it didn't look so bad.
The slot-specific locks were implemented as semaphores, which cause at locking time the process to be scheduled away if the lock has already been taken. Further, the algorithm for searching the correct slot to my understanding included locking of all the slots starting from the beginning, so for others than the first slot, it was almost guaranteed to get additional context switches, especially on an SMP machine.
I replaced those slot-specific semaphores with a slotlist specific rw-lock. It allows multiple slots to be accessed simultaneously (they only need read access) unless we have a daemon registering or unregistering (which requires write access). In fact, the performance on SMP systems improved after the change.
In addition there were some race conditions in the original code, which the rewrite in my opinion eliminated. I made these changes already some time ago and I can't now remember those race conditions by heart, but I can get back to you about them later. The same applies for the actual crashes.