From: Peter Zijlstra <peterz@infradead.org>
To: Rakib Mullick <rakib.mullick@gmail.com>
Cc: LKML <linux-kernel@vger.kernel.org>, Ingo Molnar <mingo@elte.hu>
Subject: Re: [PATCH] sched: Move level 'again' after get_cpu() in sched_exec.
Date: Tue, 12 Jan 2010 11:50:38 +0100 [thread overview]
Message-ID: <1263293438.4244.141.camel@laptop> (raw)
In-Reply-To: <b9df5fa11001120242p46fa3d07rc005cf314bf0fd32@mail.gmail.com>
On Tue, 2010-01-12 at 16:42 +0600, Rakib Mullick wrote:
> sched: move level again after get_cpu().
>
> We can get this_cpu by calling get_cpu() once and it remains
> same. We don't need to call it again.
Yes we do... get_cpu() needs to be paired with put_cpu() and they
disable/enable preemption.
Since there's an unconditional put_cpu() before the goto again, we need
to do the get_cpu().
Plenty of kernel debug options would have informed you of this if you'd
tried running it.
> Signed-off-by: Rakib Mullick <rakib.mullick@gmail.com>
> ---
>
> --- linus/kernel/sched.c 2010-01-06 20:11:10.000000000 +0600
> +++ rakib/kernel/sched.c 2010-01-12 16:01:54.000000000 +0600
> @@ -3143,8 +3143,8 @@ void sched_exec(void)
> unsigned long flags;
> struct rq *rq;
>
> -again:
> this_cpu = get_cpu();
> +again:
> dest_cpu = select_task_rq(p, SD_BALANCE_EXEC, 0);
> if (dest_cpu == this_cpu) {
> put_cpu();
prev parent reply other threads:[~2010-01-12 10:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-12 10:42 [PATCH] sched: Move level 'again' after get_cpu() in sched_exec Rakib Mullick
2010-01-12 10:50 ` Peter Zijlstra [this message]
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=1263293438.4244.141.camel@laptop \
--to=peterz@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=rakib.mullick@gmail.com \
/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