Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 14 Jul 2001 16:00:49 -0700 (PDT)
From:      John Baldwin <jhb@FreeBSD.org>
To:        Seigo Tanimura <tanimura@r.dl.itc.u-tokyo.ac.jp>
Cc:        current@FreeBSD.org, jake@FreeBSD.org, Alfred Perlstein <bright@sneakerz.org>
Subject:   Re: Lock of struct filedesc, file, pgrp, session and sigio
Message-ID:  <XFMail.010714160049.jhb@FreeBSD.org>
In-Reply-To: <200107110144.f6B1iL080250@silver.carrots.uucp.r.dl.itc.u-tokyo.ac.jp>

next in thread | previous in thread | raw e-mail | index | archive | help

On 11-Jul-01 Seigo Tanimura wrote:
> On Mon, 9 Jul 2001 03:20:44 -0500,
>   Alfred Perlstein <bright@sneakerz.org> said:
> 
> Alfred> I'm also quite sure that you can't call the ktrace functions with
> Alfred> any mutexes held so the code is doing to need some help, basically
> Alfred> the trick in trapsig() and postsig() is to generate the ktrace
> Alfred> IO after the locks have been dropped, this means somehow caching
> Alfred> the info sent to ktrace where it's currently called, and calling
> Alfred> it later with the cached info after the locks are dropped.
> 
> We can cache ktrace information into struct proc and mark the
> existence of cache in p_traceflag. Then we send the information to
> ktrace upon returning from trapsignal() or CURSIG(), or in sigexit(). 

Jake is working on porting the BSD/OS ktrace code, which uses a ring buffer of
events that get handed off to a worker background thread that does the actual
I/O.  This way, ktrace won't sleep and you won't have these problems.  I
wouldn't expend lots of effort attempting to fix the current ktrace.

> Another problem I noticed is bogus unlock and lock around call of
> machine-and-maybe-executable-format-dependent sendsig(), found in
> sys/*/*/machdep.c. Instead of locking curproc in sendsig() once again,
> we should call sendsig() with curproc locked, and release the lock
> only in sendsig().

That is probably fine.

-- 

John Baldwin <jhb@FreeBSD.org> -- http://www.FreeBSD.org/~jhb/
PGP Key: http://www.baldwin.cx/~john/pgpkey.asc
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.010714160049.jhb>