From owner-freebsd-current Tue Jul 10 23:45: 0 2001 Delivered-To: freebsd-current@freebsd.org Received: from sneakerz.org (sneakerz.org [216.33.66.254]) by hub.freebsd.org (Postfix) with ESMTP id B460237B401; Tue, 10 Jul 2001 23:44:56 -0700 (PDT) (envelope-from bright@sneakerz.org) Received: by sneakerz.org (Postfix, from userid 1092) id 03FF75D01F; Wed, 11 Jul 2001 01:44:55 -0500 (CDT) Date: Wed, 11 Jul 2001 01:44:55 -0500 From: Alfred Perlstein To: Seigo Tanimura Cc: jake@FreeBSD.org, jhb@FreeBSD.org, current@FreeBSD.org Subject: Re: Lock of struct filedesc, file, pgrp, session and sigio Message-ID: <20010711014455.H1894@sneakerz.org> References: <20010531130155.A58258@dragon.nuxi.com> <200106011228.f51CSvD46848@rina.r.dl.itc.u-tokyo.ac.jp> <20010602125223.J31257@dragon.nuxi.com> <200106040748.f547mUD53783@rina.r.dl.itc.u-tokyo.ac.jp> <200106181004.f5IA4VD63112@rina.r.dl.itc.u-tokyo.ac.jp> <200107020812.f628CfK44241@rina.r.dl.itc.u-tokyo.ac.jp> <20010707164249.C88962@sneakerz.org> <20010709032044.B1894@sneakerz.org> <200107110144.f6B1iL080250@silver.carrots.uucp.r.dl.itc.u-tokyo.ac.jp> <200107110607.f6B64ht61439@rina.r.dl.itc.u-tokyo.ac.jp> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2i In-Reply-To: <200107110607.f6B64ht61439@rina.r.dl.itc.u-tokyo.ac.jp>; from tanimura@r.dl.itc.u-tokyo.ac.jp on Wed, Jul 11, 2001 at 03:04:43PM +0900 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 * Seigo Tanimura [010711 01:39] wrote: > On Wed, 11 Jul 2001 10:44:21 +0900, > Seigo Tanimura 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. > > Seigo> We can cache ktrace information into struct proc and mark the > Seigo> existence of cache in p_traceflag. Then we send the information to > Seigo> ktrace upon returning from trapsignal() or CURSIG(), or in sigexit(). > > The problem has turned out to be even worse. > > msleep() and cv_*wait*() might receive a mutex held by curproc. As we > cannot release the mutex to sleep in ktrwrite() during msleep() or > cv_*wait*(), it is also necessary to cache information sent to > ktrcsw(). > > Is it not feasible to examine the existence of cached ktrcsw() > information upon every single call of msleep() and cv_*wait*() in > order to flush the cached information. Instead of that, we should > watch for release of mutexes. When a process no longer holds any > mutexes except for Giant, it is safe to flush cached information to > ktrace. Yes, it's pretty gross. :( -- -Alfred Perlstein [alfred@freebsd.org] Ok, who wrote this damn function called '??'? And why do my programs keep crashing in it? To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message