public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Alan <alan@lxorguk.ukuu.org.uk>
To: Nick Piggin <npiggin@suse.de>
Cc: Andrew Morton <akpm@osdl.org>, Ingo Molnar <mingo@elte.hu>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [patch] sched: avoid div in rebalance_tick
Date: Fri, 12 Jan 2007 09:59:40 +0000	[thread overview]
Message-ID: <20070112095940.0795a998@localhost.localdomain> (raw)
In-Reply-To: <20070112060213.GB28611@wotan.suse.de>

On Fri, 12 Jan 2007 07:02:13 +0100
Nick Piggin <npiggin@suse.de> wrote:

> Just noticed this while looking at a bug.
> Avoid an expensive integer divide 3 times per CPU per tick.

Integer divide is cheap on some modern processors, and multibit shift
isn't on all embedded ones.

How about putting back scale = 1 and using

scale += scale;

instead of the shift and getting what ought to be even better results


  reply	other threads:[~2007-01-12  9:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-12  6:02 [patch] sched: avoid div in rebalance_tick Nick Piggin
2007-01-12  9:59 ` Alan [this message]
2007-01-12 10:27   ` Nick Piggin
2007-01-13  6:46   ` Nick Piggin

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=20070112095940.0795a998@localhost.localdomain \
    --to=alan@lxorguk.ukuu.org.uk \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=npiggin@suse.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