From owner-freebsd-arch Thu Mar 7 17:24:54 2002 Delivered-To: freebsd-arch@freebsd.org Received: from albatross.prod.itd.earthlink.net (albatross.mail.pas.earthlink.net [207.217.120.120]) by hub.freebsd.org (Postfix) with ESMTP id A107D37B416 for ; Thu, 7 Mar 2002 17:24:48 -0800 (PST) Received: from pool0078.cvx21-bradley.dialup.earthlink.net ([209.179.192.78] helo=mindspring.com) by albatross.prod.itd.earthlink.net with esmtp (Exim 3.33 #1) id 16j97b-00032l-00; Thu, 07 Mar 2002 17:24:36 -0800 Message-ID: <3C8812C0.DE9060FB@mindspring.com> Date: Thu, 07 Mar 2002 17:24:16 -0800 From: Terry Lambert X-Mailer: Mozilla 4.7 [en]C-CCK-MCD {Sony} (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Jeff Roberson Cc: bright@mu.org, julian@elischer.org, arch@freebsd.org Subject: Re: Contemplating THIS change to signals. (fwd) References: <20020307195241.M64788-100000@mail.chesapeake.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Jeff Roberson wrote: > > Both Poul-Henning Kamp and Nate Williams bring up the important > > point of potentially long running syscalls, there are two > > ways you might consider fixing this: > > > > 1) add an additional flag to msleep to allow suspension during sleep. > > 2) restart the syscall at the userland boundry. > > Wouldn't it be reasonable to ignore the stop until we return to the user? > This way we could continue to honor all other signals inside msleep, which > seems to be very desirable. We should just postpone the STOP until we > actually return to the user. > > Am I missing something? A long running system call is supposedly signallable; in the STOP case, this implies that it pauses operation ubtil a CONT or a subsequent interrupt. As Julian has noted, "STOP" is a special case. Doing it your way, you would continue to send data on a "sendfile" operation; doing it the old way, the operation is suspended. In theory, according to the most recent postings by Julian, Julian's change will not modify the behaviour. But instead will cause the run-up to the user boundary, instead of in the middle of wherever the signal was delivered. For things like STOP, this means that it will run up to the user boundary. I'm not sure this is right, if there is a subsequent CONT; for an interrupt, Julian is correct that there is no visible difference in running it up to the user boundary, vs. doing a wakeup as a result, and later scheduling the runnning up to the user boundary; see my prior posting, and Nate's prior posting. Julian's point is that this will make things easier for the KSE work. THis is because it can use a KSE context to do the run up to the user boundary, rather than having to be a special case, where the processor continues the next time the process is scheduled (in this case the KSE), to do the runnning up then. The benefit to doing this for the KSE case should be obvious: it decouples the scheduling from the KSE itself having to run to completion (or at least the user boundary). This means that the priority for the signal delivery can be arbitrated by the user threads scheduler, which gives it more control than it would have otherwise, and saves some masking and unmasking. I'm personally really leery of changes in this area, since I expect at some time that there will be desire to support POSIX queued signals as part of the RT POSIX extensions (a recent discussion about signal delivery in aio completion events indicates that this may be an immediate need for an application being ported from Linux). I'm also a little bit leery, since by the same argument that Julian is using, signals can be delivered to user space in the KSE case, to be dispatched by the user threads scheduler. THis gets rid of all the masking and unmasking, and the associated protection domain crossing that happens currently in the user space threads library (in fact, you could do this in the current user space threads library by establishing a handler for all signals that's sole purpose was to reflect the signals into a user space signal dispatcher; this would make the user space threads significantly lighter weight, even without the KSE changes). -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message