Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2224128pxb; Sun, 18 Apr 2021 23:47:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw1GL9jYJ11oPLtmUVLX8tjSxLuDODu1Ldu2LqKjUcFxykio+f7uoINoHpO9X4dUhegWfm2 X-Received: by 2002:a17:906:48c6:: with SMTP id d6mr7853176ejt.376.1618814838464; Sun, 18 Apr 2021 23:47:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618814838; cv=none; d=google.com; s=arc-20160816; b=Pg/TmarABxQBHeDHHsuT7DC+yq5hgH5CHtwZA38HnmwmIwztq7mndT+RLai/09YSCa RLBPSPvJ207d5JGRDq+6Ti80N/CwNc3wFd4jSHVX5GADMbLqDr1zVp47i7b32oDPYyVf RsO45iF+SJ+PN69pamHB7ei90/xbv1Kyj3Allz6DaMNulgmkhAPCHETGi+7WxJWyr1nT mZsHzqxKyN/czsuakh71cC9ANT9vyYO71d//CMVIx0V9Ves+R+BlyCgynIzb4nSPZzSS gGDU9kOVxCrfqVQjl4d2zAkiNBN9aERMDDoW/K0tWTuhxrjnUupjSDSPu6UBc/mWvd0k 4aeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=9ZfTG6WOOBQGetn0a4Q+tyrZTddBgHXsEWhWgP55nJc=; b=N80JVC9EGBPBBjMrW/aN6LdAscOKxhfIMxuQQ8G2rz5iT9JB+5vm98xhmbsHxVFmlG 4XLKQHZVWg9GWACgEsnh8W03GngbIzt2jYnf3SgEpWQNYr9bKd0+fW+K7zi0avehdTHR PGLkWxOBFUnyyq9A1pLu2tGPe3YCh01mRP1V0pZ7EAWpJQyIm1WWtAAU+zPWgplkANjp RaGp3MWy4R+G5jDPygmyXJNgO/PL+7WVUNDKfiQqXJI4sQ047OE3eaeXzq5lGCgpuCvw xPiCpZqg14ULUPZdYCRVdJCu/unFSDLCffp1SSDc4T5glc3d9k7nbqyM8gnBs5q/I9Ca f5Mg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s7si11224167edd.589.2021.04.18.23.46.55; Sun, 18 Apr 2021 23:47:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237333AbhDSGkj (ORCPT + 99 others); Mon, 19 Apr 2021 02:40:39 -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-kernel@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