9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Nathaniel W Filardo <nwf@cs.jhu.edu>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] Quick question on stopping a process that waits for IO
Date: Fri,  7 Nov 2008 01:03:54 -0500	[thread overview]
Message-ID: <20081107060353.GE4367@masters10.cs.jhu.edu> (raw)
In-Reply-To: <8505E0AF-3C30-4CCE-ADA7-CD822CC89335@sun.com>

[-- Attachment #1: Type: text/plain, Size: 1854 bytes --]

On Thu, Nov 06, 2008 at 09:18:47PM -0800, Roman Shaposhnik wrote:
> On Nov 5, 2008, at 9:40 PM, Nathaniel W Filardo wrote:
>> Would this suffice?
>
> It sounds like exactly the kind of thing I was talking about.

OK.  To reiterate what I said earlier, these kinds of "soonstop"-ed
processes may still make some amount of progress in the kernel before
becoming stopped, but they will indeed stop at their next scheduling
opportunity, and ideally well before (when they go to return to userland).

One could imagine a parallel "soonnote" which considered the note delivered
even if the process was asleep in I/O.  This might be the more appropriate
thing for sending kill requests from the shell?  Having not looked at the
shell, this might be a bad idea; I'm not sure.

>> Did I miss something obvious?
>
> And this would be a million dollar question here. I don't
> think you did (although Eric constantly warns us of
> dragons), but on the other hand I have very little
> experience with the kernel itself.

I hope somebody comments on the fencing that is or isn't needed here.  Since
we have parts of the kernel peeking witout locks at ->procctl, I worry about
races, and wonder how, or if, the current design avoids them.

( Incidentally, if you're curious about in-kernel development and want to
look at a strange system, it is exactly the species of dragons we have
encountered here -- where the kernel has hijacked a userland thread to do
driver operations, and is potentially sleeping with driver resources held or
in local store -- that drove the design of the Coyotos kernel to being a
strictly transactional system.  AFAIR there it is always possible to tell a
thread to kill itself after its current transaction or, if asleep or in
commit phase, to force it out of stall queues and then kill it. )

--nwf;

[-- Attachment #2: Type: application/pgp-signature, Size: 204 bytes --]

  reply	other threads:[~2008-11-07  6:03 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-03  5:55 Roman Shaposhnik
2008-11-04  0:51 ` Roman V. Shaposhnik
2008-11-04 12:34   ` erik quanstrom
2008-11-07  5:51     ` Roman Shaposhnik
2008-11-04  1:01 ` ron minnich
2008-11-05  2:00   ` Roman V. Shaposhnik
2008-11-05  4:00     ` erik quanstrom
2008-11-05  4:47       ` Roman Shaposhnik
2008-11-05  4:01     ` erik quanstrom
2008-11-05  4:22       ` Roman Shaposhnik
2008-11-05 12:55         ` erik quanstrom
2008-11-07  5:48           ` Roman Shaposhnik
2008-11-06  5:40 ` Nathaniel W Filardo
2008-11-07  5:18   ` Roman Shaposhnik
2008-11-07  6:03     ` Nathaniel W Filardo [this message]
2008-11-07 11:57 erik quanstrom
2008-11-07 12:17 erik quanstrom
     [not found] <507c066f8ade431cfb2d23a36aa82837@quanstro.net>
2008-11-07 18:57 ` Roman V. Shaposhnik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20081107060353.GE4367@masters10.cs.jhu.edu \
    --to=nwf@cs.jhu.edu \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).