linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Jan Kara <jack@suse.cz>, Wu Fengguang <fengguang.wu@intel.com>,
	LKML <linux-kernel@vger.kernel.org>,
	linux-mm@kvack.org
Subject: Re: [PATCH 1/2] lib: Proportions with flexible period
Date: Fri, 18 May 2012 16:33:15 +0200	[thread overview]
Message-ID: <20120518143315.GB6875@quack.suse.cz> (raw)
In-Reply-To: <1337290512.4281.91.camel@twins>

On Thu 17-05-12 23:35:12, Peter Zijlstra wrote:
> On Tue, 2012-05-15 at 17:43 +0200, Jan Kara wrote:
> > +               if (numerator > ((long long)denominator) * max_frac / 100)
> 
> Does that even compile on 32bit archs?
> 
> Operator precedence is *,/ left-to-right, so that's:
> 
>   long long t1 = (long long)denom * max_frac
>   long long t2 = t1 / 100;
> 
> Which is a 64bit signed division.
> 
> There's a reason I used that max_prop_frac thing you removed, it avoids
> having to do the division at all and allows a mult and shift instead.
  Yeah, I misunderstood it's purpose when I read the code originally. I'll
put it back to avoid the division since this is a hot path.

									Honza
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

  reply	other threads:[~2012-05-18 14:33 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-15 15:43 [PATCH 0/2 v3] Flexible proportions Jan Kara
2012-05-15 15:43 ` [PATCH 1/2] lib: Proportions with flexible period Jan Kara
2012-05-17 21:35   ` Peter Zijlstra
2012-05-18 14:33     ` Jan Kara [this message]
2012-05-17 21:56   ` Peter Zijlstra
2012-05-18 14:42     ` Jan Kara
2012-05-18 10:43   ` Peter Zijlstra
2012-05-18 14:45     ` Jan Kara
2012-05-15 15:43 ` [PATCH 2/2] block: Convert BDI proportion calculations to flexible proportions Jan Kara
2012-05-17 22:04   ` Peter Zijlstra
2012-05-18 14:24     ` Jan Kara
2012-05-18 14:34       ` Peter Zijlstra
  -- strict thread matches above, loose matches on Subject: below --
2012-05-24 16:59 [PATCH 0/2 v4] Flexible proportions Jan Kara
2012-05-24 16:59 ` [PATCH 1/2] lib: Proportions with flexible period Jan Kara

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=20120518143315.GB6875@quack.suse.cz \
    --to=jack@suse.cz \
    --cc=fengguang.wu@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=peterz@infradead.org \
    /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;
as well as URLs for NNTP newsgroup(s).