public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: fabio de francesco <fabio@metanix.org>
To: LKML <linux-kernel@vger.kernel.org>
Subject: Re: linux/kernel/sched.c: context_switch().
Date: Wed, 8 Sep 2010 15:23:40 +0200	[thread overview]
Message-ID: <201009081523.41718.fabio@metanix.org> (raw)
In-Reply-To: <AANLkTik7sSbiPBM8Sdo2R3=NwLN4oJr3Q7MSNp+Y4jo3@mail.gmail.com>

On Wednesday 08 September 2010 15:10:49 you wrote:
> Long day? Do you mean likely(!mm) actually means unlikely(0)?

No, no. I am sorry for my poor English. I mean:"likely(!mm)" is like 
"likely(0)".
 
> On 8 September 2010 20:08, fabio de francesco <fabio@metanix.org> wrote:
> > 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
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-kernel"
> > in the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> > Please read the FAQ at  http://www.tux.org/lkml/

  reply	other threads:[~2010-09-08 13:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
     [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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201009081523.41718.fabio@metanix.org \
    --to=fabio@metanix.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox