public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Colin Vidal <colin@cvidal.org>
To: linux-kernel@vger.kernel.org
Cc: mingo@redhat.com, peterz@infradead.org
Subject: Re: sched: current instead rq->current
Date: Wed, 17 Aug 2016 21:39:41 +0200	[thread overview]
Message-ID: <1471462781.2204.5.camel@cvidal.org> (raw)
In-Reply-To: <1471289435.8946.28.camel@cvidal.org>

On Mon, 2016-08-15 at 21:30 +0200, Colin Vidal wrote:
> Hello,
> 
> At the beginning of __schedule (kernel/sched/core.c), the current
> task
> is get with rq->curr. I try to to understand why not directly using
> current instead?
> 
> Since a runqueue is specific to a CPU, it dosen't make sense to get
> the
> the current task of another CPU's runqueue. Yes?
> 
> I try the following of Linus's master branch
> 
> -       int cpu;
>  
> -       cpu = smp_processor_id();
> -       rq = cpu_rq(cpu);
> -       prev = rq->curr;
> +       rq = cpu_rq(smp_processor_id());
> +       prev = current;
> 
> and it seems to work (only tested on x86-64), but... To simple?
> 
> Thanks!
> 
> Colin

I realize that I have forgotten to add scheduler subsystem in CC... So
I do it now. Sorry for double post.

Thanks

Colin

  reply	other threads:[~2016-08-17 19:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-15 19:30 sched: current instead rq->current Colin Vidal
2016-08-17 19:39 ` Colin Vidal [this message]
2016-08-18 11:28   ` Peter Zijlstra

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=1471462781.2204.5.camel@cvidal.org \
    --to=colin@cvidal.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.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