From: Ingo Molnar <mingo@elte.hu>
To: Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
Cc: mingo@redhat.com, hpa@zytor.com, linux-kernel@vger.kernel.org,
tglx@linutronix.de, linux-tip-commits@vger.kernel.org
Subject: Re: [tip:sched/urgent] sched: Hide runqueues from direct refer at source code level
Date: Mon, 22 Jun 2009 17:35:22 +0200 [thread overview]
Message-ID: <20090622153522.GB18466@elte.hu> (raw)
In-Reply-To: <20090618.191448.886429908004553840.mitake@dcl.info.waseda.ac.jp>
* Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp> wrote:
> From: Ingo Molnar <mingo@elte.hu>
> Subject: Re: [tip:sched/urgent] sched: Hide runqueues from direct refer at source code level
> Date: Wed, 17 Jun 2009 18:31:11 +0200
>
> > ition: inline
> > Subject: Re: [tip:sched/urgent] sched: Hide runqueues from direct refer at source code level
> > From: Ingo Molnar <mingo@elte.hu>
> > To: mingo@redhat.com, hpa@zytor.com, linux-kernel@vger.kernel.org,
> > mitake@dcl.info.waseda.ac.jp, tglx@linutronix.de
> > Cc: linux-tip-commits@vger.kernel.org
> > Date: Wed, 17 Jun 2009 18:31:11 +0200
> > User-Agent: Mutt/1.5.18 (2008-05-17)
> > Received-SPF: neutral (mx2.mail.elte.hu: 157.181.1.14 is neither permitted nor denied by domain of elte.hu) client-ip=157.181.1.14; envelope-from=mingo@elte.hu; helo=elvis.elte.hu;
> > X-Mew: tab/spc characters on Subject: are simplified.
> >
> >
> > * tip-bot for Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp> wrote:
> >
> > > --- a/kernel/sched.c
> > > +++ b/kernel/sched.c
> > > @@ -6630,7 +6630,7 @@ EXPORT_SYMBOL(yield);
> > > */
> > > void __sched io_schedule(void)
> > > {
> > > - struct rq *rq = &__raw_get_cpu_var(runqueues);
> > > + struct rq *rq = this_rq();
> > >
> > > delayacct_blkio_start();
> > > atomic_inc(&rq->nr_iowait);
> > > @@ -6642,7 +6642,7 @@ EXPORT_SYMBOL(io_schedule);
> > >
> > > long __sched io_schedule_timeout(long timeout)
> > > {
> > > - struct rq *rq = &__raw_get_cpu_var(runqueues);
> > > + struct rq *rq = this_rq();
> > > long ret;
> >
> > I removed these two changes. Did you notice the __raw prefix?
> >
> > Ingo
> >
>
> Thanks for your fix, I didn't notice...
> I wrote a patch to fix these two points.
>
> After applying this patch,
> all direct reference to runqueues is in macros. How is this?
>
> Signed-off-by: Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
>
> diff --git a/kernel/sched.c b/kernel/sched.c
> index 8ec9d13..e2ca8c1 100644
> --- a/kernel/sched.c
> +++ b/kernel/sched.c
> @@ -692,6 +692,7 @@ static inline int cpu_of(struct rq *rq)
> #define this_rq() (&__get_cpu_var(runqueues))
> #define task_rq(p) cpu_rq(task_cpu(p))
> #define cpu_curr(cpu) (cpu_rq(cpu)->curr)
> +#define raw_rq() (&__raw_get_cpu_var(runqueues))
>
> inline void update_rq_clock(struct rq *rq)
> {
> @@ -6625,7 +6626,7 @@ EXPORT_SYMBOL(yield);
> */
> void __sched io_schedule(void)
> {
> - struct rq *rq = &__raw_get_cpu_var(runqueues);
> + struct rq *rq = raw_rq();
>
> delayacct_blkio_start();
> atomic_inc(&rq->nr_iowait);
> @@ -6637,7 +6638,7 @@ EXPORT_SYMBOL(io_schedule);
>
> long __sched io_schedule_timeout(long timeout)
> {
> - struct rq *rq = &__raw_get_cpu_var(runqueues);
> + struct rq *rq = raw_rq();
> long ret;
>
> delayacct_blkio_start();
Looks good - mind submitting a separate patch with a changelog, etc?
Ingo
next prev parent reply other threads:[~2009-06-22 15:35 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-17 13:20 [PATCH] Hiding " Hitoshi Mitake
2009-06-17 15:03 ` [tip:sched/urgent] sched: Hide " tip-bot for Hitoshi Mitake
2009-06-17 16:31 ` Ingo Molnar
2009-06-18 10:14 ` Hitoshi Mitake
2009-06-22 15:35 ` Ingo Molnar [this message]
2009-06-23 4:29 ` Hitoshi Mitake
2009-06-29 3:59 ` Hitoshi Mitake
2009-06-29 4:11 ` Ingo Molnar
2009-06-29 5:44 ` [PATCH] sched: Hide runqueues from direct refer at source code level for __raw_get_cpu_var() Hitoshi Mitake
2009-06-29 7:24 ` [tip:sched/core] sched: Hide runqueues from direct reference " tip-bot for Hitoshi Mitake
2009-06-17 16:33 ` [tip:sched/urgent] sched: Hide runqueues from direct refer at source code level tip-bot for Hitoshi Mitake
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=20090622153522.GB18466@elte.hu \
--to=mingo@elte.hu \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=mitake@dcl.info.waseda.ac.jp \
--cc=tglx@linutronix.de \
/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
all inboxes | Powered by JetHome®