On Wed, May 28, 2008 at 11:31 AM, Shyamal Shukla
<shyamalshukla@xxxxxxxxx> wrote:
How does scheduling of multiple threads in a thread group happen? I remember
reading that each process has a single mm_struct. I assumed that all threads
would share the same mm_struct and that scheduling will be based on these
mm_structs.
nope, scheduling is generally based on priority and sleep time. In
2.4, there is a consideration to pick thread of the same thread group
over normal process but AFAIK in 2.6 CFS scheduler, it is no longer
taken as consideration.
However, to prevent inverted priority and to provide fast scheduling
between threads in same group, IIRC there is formula in CFS so that in
certain way, these threads get higher "score", assuming their dynamic
priority is the same.
IIRC, child threads get 80% or 90% of their parent's dynamic priority.
I think this is after interactivity credits are totaled. They also
share a small percentage of their parents penalty for using their
entire quantum.