[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090912054747.730d4abe@infradead.org>
Date: Sat, 12 Sep 2009 05:47:47 +0200
From: Arjan van de Ven <arjan@...radead.org>
To: Jesper Juhl <jj@...osbits.net>
Cc: Ingo Molnar <mingo@...e.hu>,
Linus Torvalds <torvalds@...ux-foundation.org>,
linux-kernel@...r.kernel.org, "H. Peter Anvin" <hpa@...or.com>,
Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [GIT PULL] x86/fpu for v2.6.32
On Fri, 11 Sep 2009 23:30:42 +0200 (CEST)
Jesper Juhl <jj@...osbits.net> wrote:
>
> Hi Ingo,
>
> First of all, I want to say that I have no real objections to the
> patch what-so-ever. The following is merely to satisfy my own
> personal curiosity - and I'm sure you have better things to do than
> satisfy my curiosity, so if you want to ignore me; feel free :-)
>
> On Fri, 11 Sep 2009, Ingo Molnar wrote:
>
> [...]
> > + bool preload_fpu;
> >
> > /* never put a printk in __switch_to... printk() calls
> > wake_up*() indirectly */
> > - __unlazy_fpu(prev_p);
> > + /*
> > + * If the task has used fpu the last 5 timeslices, just do
> > a full
> > + * restore of the math state immediately to avoid the
> > trap; the
> > + * chances of needing FPU soon are obviously high now
> > + */
> > + preload_fpu = tsk_used_math(next_p) && next_p->fpu_counter
> > > 5;
> > + __unlazy_fpu(prev_p);
> >
> [...]
> > + * If the task has used fpu the last 5 timeslices, just do
> > a full
> > + * restore of the math state immediately to avoid the
> > trap; the
> > + * chances of needing FPU soon are obviously high now
> > + */
> > + preload_fpu = tsk_used_math(next_p) && next_p->fpu_counter
> > > 5;
>
> I'm wondering about two things:
>
(btw this is not new code)
> 1) Where did that magic constant "5" come from?
from me running a bunch of experiments noticing that tasks that do 5
do on average many more. Could it be 4? Perhaps.
> Is there some fundamental thing about CPU's, cache layout,
> scheduling, benchmarks or something else that I just don't know that
> makes 5 the magic "right number"? Why not 2, 3, 9 or 42?
At some point *a* number must be taken. That is currently 5.
Show us that any other number is better and we'll switch ;-)
--
Arjan van de Ven Intel Open Source Technology Centre
For development, discussion and tips for power savings,
visit http://www.lesswatts.org
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists