From: "Jan Beulich" <JBeulich@novell.com>
To: Olaf Hering <olaf@aepfle.de>
Cc: xen-devel@lists.xensource.com, Keir Fraser <keir.xen@gmail.com>,
George Dunlap <george.dunlap@citrix.com>
Subject: Re: [PATCH 1 of 5] xentrace: fix t_info_pages calculation for the default case
Date: Wed, 23 Mar 2011 12:45:51 +0000 [thread overview]
Message-ID: <4D89F98F0200007800037E68@vpn.id2.novell.com> (raw)
In-Reply-To: <20110323112040.GB28535@aepfle.de>
>>> On 23.03.11 at 12:20, Olaf Hering <olaf@aepfle.de> wrote:
> On Wed, Mar 23, Keir Fraser wrote:
>
>> On 23/03/2011 10:12, "Jan Beulich" <JBeulich@novell.com> wrote:
>>
>> >> t_info_pages /= PAGE_SIZE;
>> >> - if ( t_info_pages % PAGE_SIZE )
>> >> + if ( t_info_pages % PAGE_SIZE || t_info_pages == 0 )
>> >
>> > While certainly not having a significant effect, to the unsuspecting
>> > reader this looks like a bug - is it really meant to be a remainder
>> > operation on the *result* of a division (rather than on the original
>> > dividend)? Couldn't you just (ab)use PFN_UP() here?
>>
>> By which you mean to replace the division and subsequent if statement with
>> t_info_pages = PFN_UP(t_info_pages).
>
> I did not know about PFN_UP() until now, using it would work as well.
Note that one caveat with using it here is that you'd first need to
move its definition from include/asm-x86/page.h to somewhere
under include/xen/ - perhaps having a pfn.h like Linux does would
make sense.
Jan
next prev parent reply other threads:[~2011-03-23 12:45 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-22 19:21 [PATCH 0 of 5] xentrace updates Olaf Hering
2011-03-22 19:21 ` [PATCH 1 of 5] xentrace: fix t_info_pages calculation for the default case Olaf Hering
2011-03-23 10:12 ` Jan Beulich
2011-03-23 10:22 ` Keir Fraser
2011-03-23 11:20 ` Olaf Hering
2011-03-23 12:33 ` Keir Fraser
2011-03-23 12:46 ` Olaf Hering
2011-03-23 14:56 ` George Dunlap
2011-03-23 12:45 ` Jan Beulich [this message]
2011-03-23 13:16 ` Olaf Hering
2011-03-23 13:35 ` Keir Fraser
2011-03-22 19:21 ` [PATCH 2 of 5] xentrace: print calculated numbers in calculate_tbuf_size() Olaf Hering
2011-03-22 19:21 ` [PATCH 3 of 5] xentrace: remove gdprintk usage since they are not in guest context Olaf Hering
2011-03-22 19:21 ` [PATCH 4 of 5] xentrace: update comments Olaf Hering
2011-03-22 19:21 ` [PATCH 5 of 5] xentrace: use consistent printk prefix Olaf Hering
2011-03-23 10:14 ` Jan Beulich
2011-03-23 11:18 ` Olaf Hering
2011-03-23 14:47 ` George Dunlap
2011-03-23 16:20 ` Jan Beulich
2011-03-23 17:02 ` George Dunlap
2011-03-23 17:11 ` Olaf Hering
-- strict thread matches above, loose matches on Subject: below --
2011-03-23 17:54 [PATCH 0 of 5] xentrace updates Olaf Hering
2011-03-23 17:54 ` [PATCH 1 of 5] xentrace: fix t_info_pages calculation for the default case Olaf Hering
2011-03-24 12:09 ` Christoph Egger
2011-03-24 12:18 ` Christoph Egger
2011-03-24 12:34 ` Keir Fraser
2011-03-24 15:47 ` George Dunlap
2011-03-24 16:03 ` Olaf Hering
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=4D89F98F0200007800037E68@vpn.id2.novell.com \
--to=jbeulich@novell.com \
--cc=george.dunlap@citrix.com \
--cc=keir.xen@gmail.com \
--cc=olaf@aepfle.de \
--cc=xen-devel@lists.xensource.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;
as well as URLs for NNTP newsgroup(s).