qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
	"Andrew Jones" <drjones@redhat.com>,
	"Eduardo Habkost" <ehabkost@redhat.com>,
	"Keqian Zhu" <zhukeqian1@huawei.com>,
	jiangkunkun@huawei.com,
	"Alex Williamson" <alex.williamson@redhat.com>,
	"Peter Xu" <peterx@redhat.com>,
	qemu-devel@nongnu.org, "Kirti Wankhede" <kwankhede@nvidia.com>,
	qemu-arm@nongnu.org, "Stefan Hajnoczi" <stefanha@redhat.com>,
	wanghaibin.wang@huawei.com, "Zenghui Yu" <yuzenghui@huawei.com>,
	"Igor Mammedov" <imammedo@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@redhat.com>
Subject: Re: [PATCH] vfio/migrate: Move switch of dirty tracking into vfio_memory_listener
Date: Fri, 29 Jan 2021 08:49:53 +0100	[thread overview]
Message-ID: <d6825e67-3533-ab81-abdb-16c2ab71cfe7@redhat.com> (raw)
In-Reply-To: <20210128200223.GJ2951@work-vm>

On 28/01/21 21:02, Dr. David Alan Gilbert wrote:
> * Paolo Bonzini (pbonzini@redhat.com) wrote:
>> On 11/01/21 08:34, Keqian Zhu wrote:
>>> +static void vfio_listener_log_start(MemoryListener *listener,
>>> +                                    MemoryRegionSection *section,
>>> +                                    int old, int new)
>>> +{
>>> +    VFIOContainer *container = container_of(listener, VFIOContainer, listener);
>>> +
>>> +    vfio_set_dirty_page_tracking(container, true);
>>> +}
>>
>> This would enable dirty page tracking also just for having a framebuffer
>> (DIRTY_MEMORY_VGA).  Technically it would be correct, but it would also be
>> more heavyweight than expected.
> 
> Wouldn't that only happen on emulated video devices?

Yes, but still it's not impossible to have both an emulated VGA and an 
assigned GPU or vGPU.

>> In order to only cover live migration, you can use the log_global_start and
>> log_global_stop callbacks instead.
>>
>> If you want to use log_start and log_stop, you need to add respectively
>>
>>      if (old != 0) {
>>          return;
>>      }
>>
>> and
>>
>>      if (new != 0) {
>>          return;
>>      }
> 
> Why 0, wouldn't you be checking for DIRTY_LOG_MIGRATION somewhere?

Actually thinking more about it log_start/log_stop are just wrong, 
because they would be called many times, for each MemoryRegionSection.

Paolo



  reply	other threads:[~2021-01-29  7:52 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-11  7:34 [PATCH] vfio/migrate: Move switch of dirty tracking into vfio_memory_listener Keqian Zhu
2021-01-26 22:29 ` Alex Williamson
2021-01-27 12:46 ` Paolo Bonzini
2021-01-28 20:02   ` Dr. David Alan Gilbert
2021-01-29  7:49     ` Paolo Bonzini [this message]
2021-01-29 10:17       ` Keqian Zhu
2021-01-29 16:47       ` Alex Williamson
2021-01-27 21:03 ` Kirti Wankhede
2021-01-28 15:24   ` Keqian Zhu
2021-01-30  6:30   ` Keqian Zhu
2021-03-01  2:04     ` Keqian Zhu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d6825e67-3533-ab81-abdb-16c2ab71cfe7@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=alex.williamson@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=drjones@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=jiangkunkun@huawei.com \
    --cc=kwankhede@nvidia.com \
    --cc=peter.maydell@linaro.org \
    --cc=peterx@redhat.com \
    --cc=philmd@redhat.com \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=wanghaibin.wang@huawei.com \
    --cc=yuzenghui@huawei.com \
    --cc=zhukeqian1@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).