[CRIU] [PATCH] zdtm/static/maps06: removed hardcoded page-size

Dmitry Safonov 0x7f454c46 at gmail.com
Wed Jun 6 18:12:51 MSK 2018


2018-06-06 15:52 GMT+01:00 Adrian Reber <areber at redhat.com>:
> On Wed, Jun 06, 2018 at 03:44:32PM +0100, Dmitry Safonov wrote:
>> 2018-06-05 20:58 GMT+01:00 Adrian Reber <adrian at lisas.de>:
>> [..]
>> > @@ -23,21 +23,26 @@ int main(int argc, char ** argv)
>> >         if (fd < 0)
>> >                 return 1;
>> >
>> > -       ftruncate(fd, 4096);
>> > +       ftruncate(fd, ps);
>> > +
>> > +       if (ps == 0x1000)
>> > +               test_size = 10240;
>> > +       else
>> > +               test_size = 512;
>>
>> Is it worth to calculate test_size dynamically based on ps?
>> Like will the test work on both 16k and 64k pages?
>
> Without that the test failed as the result (ps * test_size *4) for mmap()'s
> length overflowed. I have not checked if it works when changing ps or
> test_size to a 64bit value.

No, what I meant is that you've chosen 512 static value.
Will the test work both for 16k and 64k pages?
Or test_size will differ between 16k/64k - then probably
it would be worth to calculate it with a division.

Thanks,
             Dmitry


More information about the CRIU mailing list