patchDazuko - 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: 

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.

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.

This patch replaces the localized slot-locks with a single big giant lock over all the slots and the cache. Particularly on SMP machines this would be quite painful for performance.

Although throwing a giant lock around the slots may have solved your problem, I would prefer to first investigate where the problem is? Were you able to reproduce the crashes? Did you use any sort of special trick to reproduce it? Do you have any kernel OOPS that may help isolate problems?

This patch also adds a timeout for the daemons. It is pretty clever how it was implemented. I will definitely use that (although I prefer to make it a module parameter rather than hardcoding 60 seconds).

John Ogness <ogman>
Group administrator
Fri 24 Aug 2007 01:00:34 PM UTC, original submission:  

Hello,

we experienced some system crashes on SMP systems with dazuko, and did some rewriting to the locking code. With these patches, we haven't seen a single crash.


Timo Metsala <timo_metsala>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by ogman (Posted a comment)
  • -email is unavailable- added by timo_metsala (Submitted the item)
  •  

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2011-03-19 ogman Assigned toogman None
    2007-08-24 ogman Assigned toNone ogman
    2007-08-24 timo_metsala Attached File- Added dazuko-patch-smp.diff, #13784

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code