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=-11.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 D5CB7C47080 for ; Tue, 1 Jun 2021 23:20:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B9C1B613AD for ; Tue, 1 Jun 2021 23:20:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235162AbhFAXVq (ORCPT ); Tue, 1 Jun 2021 19:21:46 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:53094 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234766AbhFAXVq (ORCPT ); Tue, 1 Jun 2021 19:21:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622589603; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=GxsHHoTk80ra37uWURN30H/nOhBanmqVqpOS4/rL0zo=; b=XKBG0sOf6zzLafEIBxUwucanlGXWUuriDvh6+jFbKitIX9zTtdkdemvl3breRE2vGLQ+Cd jFFWpmHhhKvTTIY2lkd2QQn2BKarNt3SeQbNp8DIfrYKzxB3+1pdtBS/ldWflqS9JZ+fj3 RWvr5lz7ct+mwUrAHXotzI8BmT9L90c= Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-39-qwMogrWGOhqgrRd9CZPPLQ-1; Tue, 01 Jun 2021 19:20:02 -0400 X-MC-Unique: qwMogrWGOhqgrRd9CZPPLQ-1 Received: by mail-qt1-f200.google.com with SMTP id a12-20020ac8108c0000b029023c90fba3dcso338583qtj.7 for ; Tue, 01 Jun 2021 16:20:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=GxsHHoTk80ra37uWURN30H/nOhBanmqVqpOS4/rL0zo=; b=dm88qa0S9lcspZ8YKPBFSH76WXcbbbMQg1bg8vsclRSxlvwE9tnDqdp0fkRDQXOJsE ZivtHPMY9RhpdUbuHHi5rzpowIcXwrQpn9QQ6vQ8hryekI4t8l4jKX7symuMaOAFa4gZ +a0kqbd8HGq4cZIBNeb3wXgx8VK/R0kv7wraHExjsM6clyrHFZFDdkS48nPgCGrK+Lz+ 7tYrLINtVZnmFkBvCHpTxZUXvudaQ/UcMifPK0QGOugJKyKg3Uzo/PD1jy5TDcunL7UY 4IeGMKivPRUUQv19EraMRBRKzI/7MLPnZw6jaQQ6T2nkETyuUfDbtHn4LQVmqMoxDFF6 FDww== X-Gm-Message-State: AOAM5305OwLDIBaWKcFu5MtRH4/3tjuV+mtPOr9wwla3Wq9EwPfkHa/F iE3Adtj5wrvyeknkST0AcIi5nWpRzMEVuEb78AQyeZhIDUv0Cj9nuk4pgY+9tUHAjn2Z+rpgYjH VnKfTxULYD4Zu X-Received: by 2002:a37:6f05:: with SMTP id k5mr18097458qkc.313.1622589602140; Tue, 01 Jun 2021 16:20:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx85uMM/8lal6FIJBvU/Vwx7SFNkcGoQadjr8btCxPa6PjVNzBqxzT6QDoAgGUEfi/DQRYuSA== X-Received: by 2002:a37:6f05:: with SMTP id k5mr18097442qkc.313.1622589601924; Tue, 01 Jun 2021 16:20:01 -0700 (PDT) Received: from t490s (bras-base-toroon474qw-grc-61-184-147-118-108.dsl.bell.ca. [184.147.118.108]) by smtp.gmail.com with ESMTPSA id a23sm12138420qkl.6.2021.06.01.16.20.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Jun 2021 16:20:01 -0700 (PDT) Date: Tue, 1 Jun 2021 19:20:00 -0400 From: Peter Xu To: huangy81@chinatelecom.cn Cc: qemu-devel@nongnu.org, Paolo Bonzini , kvm@vger.kernel.org, Juan Quintela , "Dr. David Alan Gilbert" Subject: Re: [PATCH v1 2/6] KVM: introduce dirty_pages into CPUState Message-ID: References: <78cc154863754a93d88070d1fae9fed6a1ec5f01.1622479161.git.huangy81@chinatelecom.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <78cc154863754a93d88070d1fae9fed6a1ec5f01.1622479161.git.huangy81@chinatelecom.cn> Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Tue, Jun 01, 2021 at 01:04:06AM +0800, huangy81@chinatelecom.cn wrote: > diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h > index 044f668a6e..973c193501 100644 > --- a/include/hw/core/cpu.h > +++ b/include/hw/core/cpu.h > @@ -375,6 +375,8 @@ struct CPUState { > struct kvm_run *kvm_run; > struct kvm_dirty_gfn *kvm_dirty_gfns; > uint32_t kvm_fetch_index; > + uint64_t dirty_pages; > + bool stat_dirty_pages; Shall we make this bool a global one? As I don't think we'll be able to only enable it on a subset of cpus? -- Peter Xu 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=-8.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=ham 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 8A658C47080 for ; Tue, 1 Jun 2021 23:25:06 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 48AF461001 for ; Tue, 1 Jun 2021 23:25:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 48AF461001 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:46820 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1loDkv-0005Lf-FR for qemu-devel@archiver.kernel.org; Tue, 01 Jun 2021 19:25:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53840) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1loDg8-0004RO-1H for qemu-devel@nongnu.org; Tue, 01 Jun 2021 19:20:08 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:42020) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1loDg5-0006LN-7H for qemu-devel@nongnu.org; Tue, 01 Jun 2021 19:20:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622589603; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=GxsHHoTk80ra37uWURN30H/nOhBanmqVqpOS4/rL0zo=; b=XKBG0sOf6zzLafEIBxUwucanlGXWUuriDvh6+jFbKitIX9zTtdkdemvl3breRE2vGLQ+Cd jFFWpmHhhKvTTIY2lkd2QQn2BKarNt3SeQbNp8DIfrYKzxB3+1pdtBS/ldWflqS9JZ+fj3 RWvr5lz7ct+mwUrAHXotzI8BmT9L90c= Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-282-YN0aEhRNOBm07lubtZhEYg-1; Tue, 01 Jun 2021 19:20:02 -0400 X-MC-Unique: YN0aEhRNOBm07lubtZhEYg-1 Received: by mail-qt1-f198.google.com with SMTP id b19-20020ac84f130000b02901d543c52248so352581qte.1 for ; Tue, 01 Jun 2021 16:20:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=GxsHHoTk80ra37uWURN30H/nOhBanmqVqpOS4/rL0zo=; b=k5wZmgWraC6B1hVC8HIdpAH7CM4EqvI0rs/2FokHpJc/jHVByqfKvuVLDFRxObnelb En5c5m7N33dGeJy3t1rFi2ZtEh2SIuQ+ptL2MmJy4AtnTh4rCqxzejLPoiM5iKdg/jpP KiIeK/mizErnSW9lBoKuzigfX/MJfpmMg0QQvHOQ0A/Sy+9SfOkrk45yx7VyUtm6dSpr X+WP+Zr8P33RsYlfZf5HHzPJ57Fpn6OvlPKCNu4yUScqaNF3pxAdsDbUKLBqokvVDeKR Zl2PqGW+n+ABfPpNiMRGn7YJqT1NKUOvrpgXFCy8fZuO2Ov8790tBaxug1v/Zics3Z6m 4Dcg== X-Gm-Message-State: AOAM530MPu/znWFRw7UO2Tf4tMI7B/Z+UDsp1XS+fjLMuPuXR13JPK9L Zdf3lNM3owaVKxOF3tYZ+IILr3NPTg7a5tULvvdUhG60efnaNZm8Yc2ZyQ/bQ17TIiFvDWV7p6v kOGYQ/HrvoMAJ/PY= X-Received: by 2002:a37:6f05:: with SMTP id k5mr18097456qkc.313.1622589602140; Tue, 01 Jun 2021 16:20:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx85uMM/8lal6FIJBvU/Vwx7SFNkcGoQadjr8btCxPa6PjVNzBqxzT6QDoAgGUEfi/DQRYuSA== X-Received: by 2002:a37:6f05:: with SMTP id k5mr18097442qkc.313.1622589601924; Tue, 01 Jun 2021 16:20:01 -0700 (PDT) Received: from t490s (bras-base-toroon474qw-grc-61-184-147-118-108.dsl.bell.ca. [184.147.118.108]) by smtp.gmail.com with ESMTPSA id a23sm12138420qkl.6.2021.06.01.16.20.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Jun 2021 16:20:01 -0700 (PDT) Date: Tue, 1 Jun 2021 19:20:00 -0400 From: Peter Xu To: huangy81@chinatelecom.cn Subject: Re: [PATCH v1 2/6] KVM: introduce dirty_pages into CPUState Message-ID: References: <78cc154863754a93d88070d1fae9fed6a1ec5f01.1622479161.git.huangy81@chinatelecom.cn> MIME-Version: 1.0 In-Reply-To: <78cc154863754a93d88070d1fae9fed6a1ec5f01.1622479161.git.huangy81@chinatelecom.cn> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=peterx@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Received-SPF: pass client-ip=170.10.133.124; envelope-from=peterx@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.371, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , "Dr. David Alan Gilbert" , qemu-devel@nongnu.org, kvm@vger.kernel.org, Juan Quintela Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On Tue, Jun 01, 2021 at 01:04:06AM +0800, huangy81@chinatelecom.cn wrote: > diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h > index 044f668a6e..973c193501 100644 > --- a/include/hw/core/cpu.h > +++ b/include/hw/core/cpu.h > @@ -375,6 +375,8 @@ struct CPUState { > struct kvm_run *kvm_run; > struct kvm_dirty_gfn *kvm_dirty_gfns; > uint32_t kvm_fetch_index; > + uint64_t dirty_pages; > + bool stat_dirty_pages; Shall we make this bool a global one? As I don't think we'll be able to only enable it on a subset of cpus? -- Peter Xu