Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 25 Mar 2012 23:34:15 -0700 (PDT)
From:      Sushanth Rai <sushanth_rai@yahoo.com>
To:        Konstantin Belousov <kostikbel@gmail.com>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Improving gcore
Message-ID:  <1332743655.97165.YahooMailClassic@web180010.mail.gq1.yahoo.com>
In-Reply-To: <20120324080129.GT2358@deviant.kiev.zoral.com.ua>

next in thread | previous in thread | raw e-mail | index | archive | help


--- 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





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1332743655.97165.YahooMailClassic>