[prev in list] [next in list] [prev in thread] [next in thread] 

List:       9fans
Subject:    Re: [9fans] another kernel implementation question
From:       Anthony Martin <ality () pbrane ! org>
Date:       2011-01-27 14:48:15
Message-ID: 20110127144814.GA8510 () dinah
[Download RAW message or body]

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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic