valid dup lock logic for witness
From: John-Mark Gurney (gurney_j_at_resnet.uoregon.edu)
Date: 08/07/04
- Previous message: Jilles Tjoelker: "_PATH_DEFPATH, _PATH_STDPATH, etc."
- Next in thread: John Baldwin: "Re: valid dup lock logic for witness"
- Reply: John Baldwin: "Re: valid dup lock logic for witness"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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"
- text/plain attachment: subr_witness.diff
- Previous message: Jilles Tjoelker: "_PATH_DEFPATH, _PATH_STDPATH, etc."
- Next in thread: John Baldwin: "Re: valid dup lock logic for witness"
- Reply: John Baldwin: "Re: valid dup lock logic for witness"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|