public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* questions on calc_delta_mine() in sched.c
@ 2008-05-01 20:45 Joel Schopp
  2008-05-02 12:14 ` Peter Zijlstra
  0 siblings, 1 reply; 7+ messages in thread
From: Joel Schopp @ 2008-05-01 20:45 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: Linux Kernel Mailing List

Ingo,

I have a few questions regarding  this code in kernel/sched.c

static unsigned long
calc_delta_mine(unsigned long delta_exec, unsigned long weight,
         struct load_weight *lw)
{
     u64 tmp;

     if (unlikely(!lw->inv_weight))
         lw->inv_weight = (WMULT_CONST-lw->weight/2) / (lw->weight+1);


Q1) This code is hit often in scenarios I run, is this really unlikely for 
others?
Q2) The rest of the code in sched.c seems to make inv_weight == 
WMULT_CONST/weight and I was wondering if you could explain why this 
instance is different.
Q3) That division is pretty expensive, could we sacrifice some accuracy and 
do a precompute table?  Do you have another idea how we could get rid of 
the divide?

-Joel Schopp


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-05-02 20:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-01 20:45 questions on calc_delta_mine() in sched.c Joel Schopp
2008-05-02 12:14 ` Peter Zijlstra
2008-05-02 12:30   ` Peter Zijlstra
2008-05-02 13:10     ` Peter Zijlstra
2008-05-02 18:46       ` Joel Schopp
2008-05-02 18:55         ` Peter Zijlstra
2008-05-02 20:30   ` Joel Schopp

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox