From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0EA4BC433B4 for ; Mon, 19 Apr 2021 06:40:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D36DF60FDB for ; Mon, 19 Apr 2021 06:40:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235360AbhDSGki (ORCPT ); Mon, 19 Apr 2021 02:40:38 -0400 Received: from szxga01-in.huawei.com ([45.249.212.187]:5136 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230038AbhDSGki (ORCPT ); Mon, 19 Apr 2021 02:40:38 -0400 Received: from DGGEML402-HUB.china.huawei.com (unknown [172.30.72.56]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4FNxvl0GktzYXdt; Mon, 19 Apr 2021 14:37:55 +0800 (CST) Received: from dggpemm500023.china.huawei.com (7.185.36.83) by DGGEML402-HUB.china.huawei.com (10.3.17.38) with Microsoft SMTP Server (TLS) id 14.3.498.0; Mon, 19 Apr 2021 14:40:04 +0800 Received: from [10.174.187.128] (10.174.187.128) by dggpemm500023.china.huawei.com (7.185.36.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2176.2; Mon, 19 Apr 2021 14:40:03 +0800 Subject: Re: [PATCH v6 03/10] KVM: selftests: Use flag CLOCK_MONOTONIC_RAW for timing To: Paolo Bonzini CC: Vitaly Kuznetsov , Andrew Jones , Ben Gardon , Sean Christopherson , Peter Xu , , , kvm , , References: <20210330080856.14940-1-wangyanan55@huawei.com> <20210330080856.14940-4-wangyanan55@huawei.com> <1f892f30-1a72-1bcb-462f-b3d6f2bababb@redhat.com> From: "wangyanan (Y)" Message-ID: <82def592-e36c-25c3-c8c5-84c9be83e926@huawei.com> Date: Mon, 19 Apr 2021 14:40:03 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 MIME-Version: 1.0 In-Reply-To: <1f892f30-1a72-1bcb-462f-b3d6f2bababb@redhat.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Originating-IP: [10.174.187.128] X-ClientProxiedBy: dggeme719-chm.china.huawei.com (10.1.199.115) To dggpemm500023.china.huawei.com (7.185.36.83) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org Hi Paolo, On 2021/4/17 21:23, Paolo Bonzini wrote: > On 30/03/21 10:08, Yanan Wang wrote: >> In addition to function of CLOCK_MONOTONIC, flag CLOCK_MONOTONIC_RAW can >> also shield possiable impact of NTP, which can provide more robustness. >> >> Suggested-by: Vitaly Kuznetsov >> Signed-off-by: Yanan Wang >> Reviewed-by: Ben Gardon >> Reviewed-by: Andrew Jones > > I'm not sure about this one, is the effect visible? > In practice, difference between results got with CLOCK_MONOTONIC and CLOCK_MONOTONIC_RAW actually is too little to be visible. But if just in theory, CLOCK_MONOTONIC_RAW can ensure time results of the compared tests are based on the same local oscillator frequency, which is not subject to possible NTP frequency adjustment. Change in this patch seems like a bit of optimization. But either of these two flags is good to me. If this patch is not convincing enough to be accepted, I will post a patch later in fix use of CLOCK_MONOTONIC_RAW in kvm_page_table_test.c just to be consistent with other kvm tests, please queue. :) Thanks, Yanan