qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] oslib-posix: Fix compiler warning


From: Stefan Weil
Subject: Re: [Qemu-devel] [PATCH] oslib-posix: Fix compiler warning
Date: Tue, 10 Oct 2017 18:48:32 +0200
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0

Am 10.10.2017 um 16:43 schrieb Richard Henderson:
> On 10/09/2017 10:39 PM, Stefan Weil wrote:
>> Am 09.10.2017 um 23:58 schrieb Richard Henderson:
>>> On 10/07/2017 08:55 AM, Stefan Weil wrote:
>>>> +        char *addr = memset_args->addr;
>>>> +        uint64_t numpages = memset_args->numpages;
>>>> +        uint64_t hpagesize = memset_args->hpagesize;
>>>> +        unsigned i;
>>> Match numpages properly while you're at it?
>>>
>>>
>>> r~
>> Do you mean using uint64_t for the loop variable i?
> Yes.
>
>> Sure. I only hesitated to do that because it is so huge.
>> A 64 bit loop variable looks strange, and the loop would
>> take some time if it really uses that range. :-)
> Why would we use a 64-bit variable for numpages if we don't expect such a
> value?  What I see, from spot review only, is an apparent bug -- the iterator
> type does not match the bound type.

If we really expect more than 2^32 pages, touching all those pages
will need a significant time even on fast machines.

It looks like that function is called in its own thread.
Can we be sure that there is no more than one thread of that kind,
or do we need more code to disallow a 2nd thread?
I don't think that touching the pages twice at the
same time makes sense.

What about using size_t instead of uint64_t? Parts of the code already
use size_t, and it makes a difference for QEMU running on 32 bit hosts.

Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]