valid dup lock logic for witness

From: John-Mark Gurney (gurney_j_at_resnet.uoregon.edu)
Date: 08/07/04

  • Next message: Conrad J. Sabatier: "Re: install_and_reboot target for kernel's..."
    Date: Fri, 6 Aug 2004 15:43:16 -0700
    To: freebsd-arch@freebsd.org
    
    
    

    I have been working on kqueue, and to support kq in kq, I need to obtain
    two kq locks (both of the same type) at the same time. Normally this can
    cause a deadlock, but using a proper lock ordering strategy, it can be
    avoided. In the kq case, I chose to aquire a kq global lock before
    acquiring multiple kq locks. (In the proc case, jhb said you aquire
    the child's before the parents.)

    Mutexs have the flag MTX_DUPOK that notify witness that duplicate locks
    are ok, but this can hide other problems (and in fact would have in my
    testing).

    I have created a patch that lets you inform witness the a duplicate lock
    is valid as long as you hold another lock. The only run time change is
    that when a duplicate lock is found, it will run through another table
    to verify it's ok before printing out the back trace.

    Anyone have objections to this?

    -- 
      John-Mark Gurney				Voice: +1 415 225 5579
         "All that I will do, has been done, All that I have, has not."
    
    
    

    _______________________________________________
    freebsd-arch@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-arch
    To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org"



  • Next message: Conrad J. Sabatier: "Re: install_and_reboot target for kernel's..."

    Relevant Pages

    • Re: valid dup lock logic for witness
      ... I chose to aquire a kq global lock before ... >> I have created a patch that lets you inform witness the a duplicate lock ... For proc locks child processes are locked before parents. ...
      (freebsd-arch)
    • Re: Vector (was Re: Change character in string)
      ... already has it's first fork when .equalsis invoked ... so it's too late for grabbing the napkin now. ... each method would have to aquire Collections.synchronizedCollection's ... central lock - and that has a hidden price tag that may really hurt. ...
      (comp.lang.java.programmer)
    • Re: Semaphores and .NET
      ... > mutex and shared file to hold the count or mem mapped file, ... To aquire a lock on the semaphore, you need to obtain syncLock (which is ... available, you block at the Monitor.Waitcall, INSIDE the lock statement. ...
      (microsoft.public.dotnet.languages.csharp)
    • Re: Another locking question.
      ... if the other threads are of equal priority they appear to aquire the lock in ... teh order they requested it (I haven't see this *documented* anywhere so I ... If Thread 3 has a higher priority than Thread 2 it will acquire the lock ...
      (microsoft.public.dotnet.framework)
    • Re: [PATCH] LIB: remove unmatched write_lock() in gen_pool_destroy
      ... significant code change. ... Its dumb to aquire the lock you're gonna free anyway. ... Maybe some BUG_ONthat sez nobody better be holding this lock? ...
      (Linux-Kernel)