Improving gcore
Sushanth Rai
sushanth_rai at yahoo.com
Mon Mar 26 06:34:23 UTC 2012
--- On Sat, 3/24/12, Konstantin Belousov <kostikbel at 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
More information about the freebsd-hackers
mailing list