Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp3131383pxb; Mon, 6 Sep 2021 13:10:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwEuL+yED0IvD1UzR5u/yHOTY3erxwSfZ/XJFxW+FWEQ/rU1zu4HLP1O4sDm/UX5mu7RKQK X-Received: by 2002:a92:c5d2:: with SMTP id s18mr228221ilt.31.1630959010284; Mon, 06 Sep 2021 13:10:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630959010; cv=none; d=google.com; s=arc-20160816; b=LwXvHEwGOFgFCbqjypCpQy5UbDYv5mzCTNrwymf/aSxJ6cR9W4kLRykK/BMLeEY0Oi fs6R8wu5FjTPnUIqQXS+zF/pyVlNNNXTiEhyPLIRdaSlUoPSSsNxjTDAkmf6hrnkBntH iN+TKNn9RiT3Bdoxwl8DBtTMqxLbnQQEb0GH3BwQEfB3fbW0gZw80WkQvE66ALD8I7MR 6NwNAg+4jtky6IqYpr+AzTgOr1U7JHllPDRBasRwYwK+6Qj0J9rI1whNU1BMeds+8UCQ 0tK8oPvzhjPVPHbKixQqKWkTZRaI73wD4D/yAkb/dB/zsE3KjNUSnDL9c/tUVYTizCZP zmWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=Lm4jdiDuWbqAv4O7YJ6wZ0vVIEpUpOQJ86d4UA/6SjA=; b=wZIkBvTJ/8xIT+HVoEcMZRIKo9euhlw8cNo3kLqdnw4IeHa1SUbtdhKikTmaVx60cB pTcybZnBmjUPfP2X5LwZn2jj+TRLe3cIDSGFip7AG7ggq3gqiPNsop1cy8piXaU6cYeF 7uLgc22vRzOqUWVjT8QeGK+FCtYqGqPjOWKYD9DrHt+UnR7rZuByzUex/zcl9qsyq5o4 2tCn4xoTpYRzIP8yG0/lU64RQi43nqTm2UoAkWHnPkUM2quRmbHEUFlAGTTq7wn2FocK KthgpHLBKsyRNROB188Mn8ChqG/I9b/fk+VuhxyEwHKMH2tfvkiVEAw+lNHzl9rfJW/w 5A/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=I5fTuvgn; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e28si7432430iov.1.2021.09.06.13.09.58; Mon, 06 Sep 2021 13:10:10 -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; dkim=pass header.i=@google.com header.s=20210112 header.b=I5fTuvgn; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235677AbhIFUGj (ORCPT + 99 others); Mon, 6 Sep 2021 16:06:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52308 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231206AbhIFUGi (ORCPT ); Mon, 6 Sep 2021 16:06:38 -0400 Received: from mail-yb1-xb2e.google.com (mail-yb1-xb2e.google.com [IPv6:2607:f8b0:4864:20::b2e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A8D5BC061757 for ; Mon, 6 Sep 2021 13:05:33 -0700 (PDT) Received: by mail-yb1-xb2e.google.com with SMTP id z5so15493140ybj.2 for ; Mon, 06 Sep 2021 13:05:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Lm4jdiDuWbqAv4O7YJ6wZ0vVIEpUpOQJ86d4UA/6SjA=; b=I5fTuvgnT9HxQ8xV0WPigXQzCZJUNgH1XdAnBxrfTTXtABBsN58Equ7pN+lofptQr5 v8AJZEUyQ5CEVJ1PuLnXmMsIggU6WfCOxXtAskYJS3GsrojX31Qqk/lQu3VEDJXYq6Gi F3LhosFyS3VlcpzONHNaDcLIchdgiL5v4NA35UZSDxOFigjbi3/k2ZSVwDtxBAdMLeEh PiApND73vDcx4gkZyX2ovCBhM57vfLg6OLSOS0lritofSJz4hrdw/sM8mUdEhTGvv1aw U7mhhYqzmX6t+hCI8DkX+hR+3KQpqsrlj3AtMfivn9VVLvlapxzhUfpCVoN9HAmKa7Ej E3Bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Lm4jdiDuWbqAv4O7YJ6wZ0vVIEpUpOQJ86d4UA/6SjA=; b=LF/AkYlLwQBZl7Ugz9kJHHHgligetCrPhgtk3M8z8+nyZZa/LrBS+7I+pHwQnS+BDJ 6Y4Hn2KfHMq1Qx+7i97KWEgjYTbTI6Jb0MQymfM7Wu9P5krYjYxuMQjKhYx26chyawp5 sIXAWMyhCD3aXv7YAkWx3/Tfs+4ZkRhICAyZ/Uy7SkcCxOEXPEAJQeeuaq7zgtJ0H0By 3ttcpCAJqD7yhBwdiNCwaQmGMuAZTj38fV0926b59y3YfBVutF9QoFksu8dgdMSWT/Be bqtMeJxJ/HjzlYHxiM3kb6n/P3mtP+7MRL72iNX+WrLlyT7X0gJgeCqTksUdh+H9u4X1 eplA== X-Gm-Message-State: AOAM532OqTsOBFWw8+5Fqx2Iw4sEs9qrxSQuC95rxiM32NIefmgmr36V vwXPR5hGhoZUag5csjkgM1K6Pc9+wU2Sl5nR2G3ECw== X-Received: by 2002:a25:3046:: with SMTP id w67mr18083671ybw.134.1630958732615; Mon, 06 Sep 2021 13:05:32 -0700 (PDT) MIME-Version: 1.0 References: <20210830044425.2686755-1-mizhang@google.com> <20210830044425.2686755-3-mizhang@google.com> In-Reply-To: From: Mingwei Zhang Date: Mon, 6 Sep 2021 13:05:21 -0700 Message-ID: Subject: Re: [PATCH v3 2/2] selftests: KVM: use dirty logging to check if page stats work correctly To: Sean Christopherson Cc: Ben Gardon , Paolo Bonzini , kvm , LKML , David Matlack , Jing Zhang , Peter Xu Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 31, 2021 at 9:58 AM Sean Christopherson wrote: > > On Mon, Aug 30, 2021, Ben Gardon wrote: > > On Sun, Aug 29, 2021 at 9:44 PM Mingwei Zhang wrote: > > > diff --git a/tools/testing/selftests/kvm/lib/test_util.c b/tools/testing/selftests/kvm/lib/test_util.c > > > index af1031fed97f..07eb6b5c125e 100644 > > > --- a/tools/testing/selftests/kvm/lib/test_util.c > > > +++ b/tools/testing/selftests/kvm/lib/test_util.c > > > @@ -15,6 +15,13 @@ > > > #include "linux/kernel.h" > > > > > > #include "test_util.h" > > > +#include "processor.h" > > > + > > > +static const char * const pagestat_filepaths[] = { > > > + "/sys/kernel/debug/kvm/pages_4k", > > > + "/sys/kernel/debug/kvm/pages_2m", > > > + "/sys/kernel/debug/kvm/pages_1g", > > > +}; > > > > I think these should only be defined for x86_64 too. Is this the right > > file for these definitions or is there an arch specific file they > > should go in? > > The stats also need to be pulled from the selftest's VM, not from the overall KVM > stats, otherwise the test will fail if there are any other active VMs on the host, > e.g. I like to run to selftests and kvm-unit-tests in parallel. That is correct. But since this selftest is not the 'default' selftest that people normally run, can we make an assumption on running these tests at this moment? I am planning to submit this test and improve it in the next series by using Jing's fd based KVM stats interface to eliminate the assumption of the existence of a single running VM. Right now, this interface still needs some work, so I am taking a shortcut that directly uses the whole-system metricfs based interface. But I can choose to do that and submit the fd-based API together with this series. What do you suggest?