From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: xen-devel <xen-devel@lists.xenproject.org>, Keir Fraser <keir@xen.org>
Subject: Re: [PATCH URGENT] common/vsprintf: Fix signed->unsigned error, causing glacial performance.
Date: Tue, 12 Nov 2013 17:04:34 +0000 [thread overview]
Message-ID: <52825FA2.8030405@citrix.com> (raw)
In-Reply-To: <5282640502000078001028D1@nat28.tlf.novell.com>
On 12/11/13 16:23, Jan Beulich wrote:
>>>> On 12.11.13 at 17:10, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
>> The original patch for
>>
>> c/s 67a3542c5bc356e6452d8305991617c875f87de4
>> "common/vsprintf: Refactor string() out of vsnprintf()"
>>
>> specifically used signed integers, identical to the code copied out of
>> vsprintf.
>>
>> When committed, these had changed to unsigned integers, which causes a
>> functional change. This causes glacial boot performance and an excessive
>> quantity of spaces printed to the serial console, as we loop to the upper
>> bound of a 32bit integer.
>>
>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> Considering that I had changed those on the fly while committing,
> I committed this one without waiting for an ack. But ...
>
>> --- a/xen/common/vsprintf.c
>> +++ b/xen/common/vsprintf.c
>> @@ -239,7 +239,7 @@ static char *number(
>> static char *string(char *str, char *end, const char *s,
>> int field_width, int precision, int flags)
>> {
>> - unsigned int i, len = strnlen(s, precision);
>> + int i, len = strnlen(s, precision);
> ... this just looks _so_ wrong (and whenever I'll come across
> this again, I'll just be tempted again to adjust it)!
>
> Jan
>
I agree in general, and do err on the side of unsigned whenever
possible. In this case, I went with exactly what was present before.
~Andrew
next prev parent reply other threads:[~2013-11-12 17:04 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-12 16:10 [PATCH URGENT] common/vsprintf: Fix signed->unsigned error, causing glacial performance Andrew Cooper
2013-11-12 16:23 ` Jan Beulich
2013-11-12 17:04 ` Andrew Cooper [this message]
2013-11-13 7:33 ` Jan Beulich
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=52825FA2.8030405@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=JBeulich@suse.com \
--cc=keir@xen.org \
--cc=xen-devel@lists.xenproject.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.