9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Anthony Martin <ality@pbrane.org>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] another kernel implementation question
Date: Thu, 27 Jan 2011 06:48:15 -0800	[thread overview]
Message-ID: <20110127144814.GA8510@dinah> (raw)
In-Reply-To: <a6fcfa688d9518e20813d26a3fe06fb6@quintile.net>

Steve Simon <steve@quintile.net> once said:
> The difference comes from the fact that sleep is deep inside its
> stack/errlab hierarchy when it receives a note. This causes it
> to jump to the notify function (still in the users context),
> the notify function then calls back into the kernel (noted()).
>
> this is where it gets weird, as on entry to the kernel syscall() zeros
> up->nerrlab and so throws away the processes error history. Then if noted()
> wants to continue the user process I would expect sleep to get resumed
> and to recurr out of its stack and hit several poperror()s and end up with
> a negative nerrlab!
>
> so how does it work in the ntoe case?

I think it goes something like this.

syssleep
  --> tsleep
    --> sleep
	    when awakened, checks notepending and calls
		error with Eintr ("interrupted"), then jumps
		back to the error-branch of waserror in syscall
		--> syscall
		    sets errstr, calls notify, etc.

alarmkproc
  --> postnote
      sets notepending and wakes the sleeping proc

I'm quite tired, so I may have missed a step.

  Anthony



      reply	other threads:[~2011-01-27 14:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-27 10:54 Steve Simon
2011-01-27 11:35 ` Anthony Martin
2011-01-27 13:29   ` Steve Simon
2011-01-27 14:48     ` Anthony Martin [this message]

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=20110127144814.GA8510@dinah \
    --to=ality@pbrane.org \
    --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).