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

List:       freebsd-hackers
Subject:    Re: Improving gcore
From:       Sushanth Rai <sushanth_rai () yahoo ! com>
Date:       2012-03-26 6:34:15
Message-ID: 1332743655.97165.YahooMailClassic () web180010 ! mail ! gq1 ! yahoo ! com
[Download RAW message or body]



--- On Sat, 3/24/12, Konstantin Belousov <kostikbel@gmail.com> wrote:


> No, I mentioned exactly this in paragraph you replied to.
> To actually start executing from runq, thread needs to
> transition
> from kernel to userspace (in other words, thread appears on
> runq
> due to interrupt, thus entering kernel space). On the
> kernel->user
> transition, the thread will be suspended in AST handler.
> 
> So, if pending AST catched usermode thread on runq, no
> single usermode
> instruction is executed by the thread before suspension.
> 

Got it. Basically if the usermode thread's time slice is up, AST handler (triggered \
due timer interrupt) would switch-out the thread when it sees TDF_NEERESCHED flag. \
When thread starts running again, userret() called from AST handler would check for \
suspension.

I guess it was much ado about nothing. At least I got understand the code little \
better. Much thanks for that.

Sushanth


_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"


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

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