From owner-freebsd-current Sat Jul 14 16: 0:57 2001 Delivered-To: freebsd-current@freebsd.org Received: from mail12.speakeasy.net (mail12.speakeasy.net [216.254.0.212]) by hub.freebsd.org (Postfix) with SMTP id 1A33637B401 for ; Sat, 14 Jul 2001 16:00:46 -0700 (PDT) (envelope-from jhb@FreeBSD.org) Received: (qmail 43926 invoked from network); 14 Jul 2001 23:00:45 -0000 Received: from unknown (HELO laptop.baldwin.cx) ([64.81.54.73]) (envelope-sender ) by mail12.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 14 Jul 2001 23:00:45 -0000 Message-ID: X-Mailer: XFMail 1.4.0 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <200107110144.f6B1iL080250@silver.carrots.uucp.r.dl.itc.u-tokyo.ac.jp> Date: Sat, 14 Jul 2001 16:00:49 -0700 (PDT) From: John Baldwin To: Seigo Tanimura Subject: Re: Lock of struct filedesc, file, pgrp, session and sigio Cc: current@FreeBSD.org, jake@FreeBSD.org, Alfred Perlstein Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 11-Jul-01 Seigo Tanimura wrote: > On Mon, 9 Jul 2001 03:20:44 -0500, > Alfred Perlstein 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 -- 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