From: Nick Piggin <nickpiggin@yahoo.com.au>
To: benh@kernel.crashing.org
Cc: paulmck@linux.vnet.ibm.com, linux-kernel@vger.kernel.org,
tony@bakeyournoodle.com, paulus@samba.org, dino@in.ibm.com,
tytso@us.ibm.com, dvhltc@us.ibm.com, niv@us.ibm.com,
antonb@us.ibm.com, rostedt@goodmis.org
Subject: Re: [PATCH, RFC] improved hacks to allow -rt to run kernbench on POWER
Date: Sat, 10 Nov 2007 12:18:47 +1100 [thread overview]
Message-ID: <200711101218.47903.nickpiggin@yahoo.com.au> (raw)
In-Reply-To: <1194641524.21340.14.camel@pasglop>
On Saturday 10 November 2007 07:52, Benjamin Herrenschmidt wrote:
> > diff -urpNa -X dontdiff linux-2.6.23.1-rt4/arch/powerpc/kernel/process.c
> > linux-2.6.23.1-rt4-fix/arch/powerpc/kernel/process.c ---
> > linux-2.6.23.1-rt4/arch/powerpc/kernel/process.c 2007-10-12
> > 09:43:44.000000000 -0700 +++
> > linux-2.6.23.1-rt4-fix/arch/powerpc/kernel/process.c 2007-11-08
> > 20:33:59.000000000 -0800 @@ -245,6 +245,8 @@ struct task_struct
> > *__switch_to(struct t
> > struct thread_struct *new_thread, *old_thread;
> > unsigned long flags;
> > struct task_struct *last;
> > + struct ppc64_tlb_batch *batch;
> > + int hadbatch;
> >
> > #ifdef CONFIG_SMP
> > /* avoid complexity of lazy save/restore of fpu
> > @@ -325,6 +327,16 @@ struct task_struct *__switch_to(struct t
> > }
> > #endif
> >
> > + batch = &get_cpu_var(ppc64_tlb_batch);
> > + if (batch->active) {
> > + hadbatch = 1;
> > + if (batch->index) {
> > + __flush_tlb_pending(batch);
> > + }
> > + batch->active = 0;
> > + }
> > + put_cpu_var(ppc64_tlb_batch);
> > +
> > local_irq_save(flags);
> >
> > account_system_vtime(current);
> > @@ -335,6 +347,12 @@ struct task_struct *__switch_to(struct t
> >
> > local_irq_restore(flags);
> >
> > + if (hadbatch) {
> > + batch = &get_cpu_var(ppc64_tlb_batch);
> > + batch->active = 1;
> > + put_cpu_var(ppc64_tlb_batch);
> > + }
> > +
> > return last;
> > }
>
> I doubt we can schedule within __switch_to() (can somebody confirm
> this ?), in which case, you can just use __get_cpu_var() and avoid
> the put, thus saving a handful of cycles in the code above.
Preempt is always turned off over switch_to() call.
prev parent reply other threads:[~2007-11-10 3:57 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-09 18:10 [PATCH, RFC] improved hacks to allow -rt to run kernbench on POWER Paul E. McKenney
2007-11-09 20:52 ` Benjamin Herrenschmidt
2007-11-09 22:07 ` Paul E. McKenney
2007-11-11 3:59 ` Benjamin Herrenschmidt
2007-11-11 14:45 ` Steven Rostedt
2007-11-11 20:48 ` Benjamin Herrenschmidt
2007-11-12 17:05 ` Paul E. McKenney
2007-11-12 19:15 ` Paul E. McKenney
2007-11-12 21:12 ` Benjamin Herrenschmidt
2007-11-13 9:10 ` Peter Zijlstra
2007-11-13 9:43 ` Benjamin Herrenschmidt
2007-11-13 10:05 ` Peter Zijlstra
2007-11-13 10:59 ` Peter Zijlstra
2007-11-13 11:09 ` Benjamin Herrenschmidt
2007-11-10 1:18 ` Nick Piggin [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=200711101218.47903.nickpiggin@yahoo.com.au \
--to=nickpiggin@yahoo.com.au \
--cc=antonb@us.ibm.com \
--cc=benh@kernel.crashing.org \
--cc=dino@in.ibm.com \
--cc=dvhltc@us.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=niv@us.ibm.com \
--cc=paulmck@linux.vnet.ibm.com \
--cc=paulus@samba.org \
--cc=rostedt@goodmis.org \
--cc=tony@bakeyournoodle.com \
--cc=tytso@us.ibm.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