public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* linux/kernel/sched.c: context_switch().
@ 2010-09-08 13:08 fabio de francesco
  2010-09-08 13:10 ` chxanders
       [not found] ` <201009081518.21569.fabio@metanix.org>
  0 siblings, 2 replies; 5+ messages in thread
From: fabio de francesco @ 2010-09-08 13:08 UTC (permalink / raw)
  To: LKML

There must be something I am missing in sched.c at context_switch() function 
definition. 

There I can read the following code:

static inline void
context_switch(struct rq *rq, struct task_struct *prev,
               struct task_struct *next)
{
	...
	struct mm_struct *mm;
	mm = next->mm;
	if (likely(!mm)) {
                next->active_mm = oldmm;
                atomic_inc(&oldmm->mm_count);
                enter_lazy_tlb(oldmm, next);
        } else
                switch_mm(oldmm, mm, next);
	...
}

May someone please explain why the mm pointer is likely supposed to be NULL?

Thanks in advance.

fabio

^ permalink raw reply	[flat|nested] 5+ messages in thread
* linux/kernel/sched.c: context_switch().
@ 2010-09-08 12:33 fabio de francesco
  0 siblings, 0 replies; 5+ messages in thread
From: fabio de francesco @ 2010-09-08 12:33 UTC (permalink / raw)
  To: LKML

There must be something I am missing in sched.c at context_switch() function 
definition. 

There I can read the following code:

static inline void
context_switch(struct rq *rq, struct task_struct *prev,
               struct task_struct *next)
{
	...
	struct mm_struct *mm;
	mm = next->mm;
	if (likely(!mm)) {
                next->active_mm = oldmm;
                atomic_inc(&oldmm->mm_count);
                enter_lazy_tlb(oldmm, next);
        } else
                switch_mm(oldmm, mm, next);
	...
}

May someone please explain why the mm pointer is likely supposed to be NULL?

Thanks in advance.

fabio

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-09-08 13:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-08 13:08 linux/kernel/sched.c: context_switch() fabio de francesco
2010-09-08 13:10 ` chxanders
2010-09-08 13:23   ` fabio de francesco
     [not found] ` <201009081518.21569.fabio@metanix.org>
     [not found]   ` <AANLkTi=mNJhoODzZqLpTC8QqqnwLgWxVXEJzXviF64mV@mail.gmail.com>
2010-09-08 13:54     ` fabio de francesco
  -- strict thread matches above, loose matches on Subject: below --
2010-09-08 12:33 fabio de francesco

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox