[CRIU] [PATCH] zdtm: It's need to sleep between clock_gettime()
in uptime_grow
Pavel Emelyanov
xemul at parallels.com
Tue Jul 31 06:06:23 EDT 2012
On 07/31/2012 01:43 PM, Victor konyashkin wrote:
> ping
Applied
> On Mon, 2012-07-16 at 12:56 +0400, Andrey Vagin wrote:
>> Acked-by: Andrey Vagin <avagin at openvz.org>
>>
>> On Jun 28, 2012 4:04 PM, "vkonyashkin" <vkonyashkin at parallels.com>
>> wrote:
>> Kernel can't suspend container by design if calls
>> clock_gettime()
>> in a loop, so we need to sleep between clock_gettime().
>>
>> Signed-off-by: Victor Konyashkin <vkonyashkin at parallels.com>
>> ---
>> test/zdtm/live/static/uptime_grow.c | 11 ++++++++++-
>> 1 files changed, 10 insertions(+), 1 deletions(-)
>>
>> diff --git a/test/zdtm/live/static/uptime_grow.c
>> b/test/zdtm/live/static/uptime_grow.c
>> index 1f3dba3..670c062 100644
>> --- a/test/zdtm/live/static/uptime_grow.c
>> +++ b/test/zdtm/live/static/uptime_grow.c
>> @@ -13,8 +13,11 @@ const char *test_author = "Evgeny Antysev
>> <eantyshev at parallels.com>";
>>
>> int main(int argc, char **argv)
>> {
>> - struct timespec tm_old, tm;
>> + struct timespec tm_old, tm, ts;
>> double diff_nsec;
>> + ts.tv_sec = 0;
>> + ts.tv_nsec = 1000000;
>> +
>> test_init(argc, argv);
>>
>> if (clock_gettime(CLOCK_MONOTONIC, &tm_old)) {
>> @@ -36,6 +39,12 @@ int main(int argc, char **argv)
>> exit(1);
>> }
>> tm_old = tm;
>> + /*
>> + Kernel can't suspend container by design if
>> calls
>> + clock_gettime() in a loop, so we need to sleep
>> + between clock_gettime().
>> + */
>> + nanosleep(&ts, NULL);
>> }
>> pass();
>> return 0;
>> --
>> 1.5.2.2
>>
>> _______________________________________________
>> CRIU mailing list
>> CRIU at openvz.org
>> https://openvz.org/mailman/listinfo/criu
>
More information about the CRIU
mailing list