Re: [PATCH v13 0/5] UFFD write-tracking migration/snapshots

2021-02-24 Thread Andrey Gruzdev
On 24.02.2021 20:01, David Hildenbrand wrote: On 24.02.21 17:56, Andrey Gruzdev wrote: On 22.02.2021 21:11, David Hildenbrand wrote: On 22.02.21 18:54, Peter Xu wrote: On Mon, Feb 22, 2021 at 06:33:27PM +0100, David Hildenbrand wrote: On 22.02.21 18:29, Peter Xu wrote: On Sat, Feb 20, 2021

Re: [PATCH v13 0/5] UFFD write-tracking migration/snapshots

2021-02-24 Thread David Hildenbrand
On 24.02.21 17:56, Andrey Gruzdev wrote: On 22.02.2021 21:11, David Hildenbrand wrote: On 22.02.21 18:54, Peter Xu wrote: On Mon, Feb 22, 2021 at 06:33:27PM +0100, David Hildenbrand wrote: On 22.02.21 18:29, Peter Xu wrote: On Sat, Feb 20, 2021 at 02:59:42AM -0500, David Hildenbrand wrote:

Re: [PATCH v13 0/5] UFFD write-tracking migration/snapshots

2021-02-24 Thread Andrey Gruzdev
On 19.02.2021 23:50, Peter Xu wrote: Andrey, On Fri, Feb 19, 2021 at 09:57:37AM +0300, Andrey Gruzdev wrote: For the discards that happen before snapshot is started, I need to dig into Linux and QEMU virtio-baloon code more to get clear with it. Yes it's very tricky on how the error could

Re: [PATCH v13 0/5] UFFD write-tracking migration/snapshots

2021-02-24 Thread Andrey Gruzdev
On 24.02.2021 19:54, David Hildenbrand wrote: Anyhow I'm quite sure that adding global MISSING handler for snapshotting is too heavy and not really needed. UFFDIO_ZEROCOPY installs a zero pfn and that should be all of it.  There'll definitely be overhead, but it may not be that huge as

Re: [PATCH v13 0/5] UFFD write-tracking migration/snapshots

2021-02-24 Thread Andrey Gruzdev
On 22.02.2021 21:11, David Hildenbrand wrote: On 22.02.21 18:54, Peter Xu wrote: On Mon, Feb 22, 2021 at 06:33:27PM +0100, David Hildenbrand wrote: On 22.02.21 18:29, Peter Xu wrote: On Sat, Feb 20, 2021 at 02:59:42AM -0500, David Hildenbrand wrote: Live snapshotting ends up reading all guest

Re: [PATCH v13 0/5] UFFD write-tracking migration/snapshots

2021-02-24 Thread David Hildenbrand
Anyhow I'm quite sure that adding global MISSING handler for snapshotting is too heavy and not really needed. UFFDIO_ZEROCOPY installs a zero pfn and that should be all of it. There'll definitely be overhead, but it may not be that huge as imagined. Live snapshot is great in that we have

Re: [PATCH v13 0/5] UFFD write-tracking migration/snapshots

2021-02-22 Thread David Hildenbrand
On 22.02.21 18:54, Peter Xu wrote: On Mon, Feb 22, 2021 at 06:33:27PM +0100, David Hildenbrand wrote: On 22.02.21 18:29, Peter Xu wrote: On Sat, Feb 20, 2021 at 02:59:42AM -0500, David Hildenbrand wrote: Live snapshotting ends up reading all guest memory (dirty bitmap starts with all 1s),

Re: [PATCH v13 0/5] UFFD write-tracking migration/snapshots

2021-02-22 Thread Peter Xu
On Mon, Feb 22, 2021 at 06:33:27PM +0100, David Hildenbrand wrote: > On 22.02.21 18:29, Peter Xu wrote: > > On Sat, Feb 20, 2021 at 02:59:42AM -0500, David Hildenbrand wrote: > > > Live snapshotting ends up reading all guest memory (dirty bitmap starts > > > with all 1s), which is not what we

Re: [PATCH v13 0/5] UFFD write-tracking migration/snapshots

2021-02-22 Thread Peter Xu
On Sat, Feb 20, 2021 at 02:59:42AM -0500, David Hildenbrand wrote: > Live snapshotting ends up reading all guest memory (dirty bitmap starts with > all 1s), which is not what we want for virtio-mem - we don’t want to read and > migrate memory that has been discarded and has no stable content. >

Re: [PATCH v13 0/5] UFFD write-tracking migration/snapshots

2021-02-22 Thread David Hildenbrand
On 22.02.21 18:29, Peter Xu wrote: On Sat, Feb 20, 2021 at 02:59:42AM -0500, David Hildenbrand wrote: Live snapshotting ends up reading all guest memory (dirty bitmap starts with all 1s), which is not what we want for virtio-mem - we don’t want to read and migrate memory that has been

Re: [PATCH v13 0/5] UFFD write-tracking migration/snapshots

2021-02-20 Thread David Hildenbrand
> Am 19.02.2021 um 23:47 schrieb Peter Xu : > > On Fri, Feb 19, 2021 at 10:20:42PM +0100, David Hildenbrand wrote: >>> A shiver just went down my spine. Please don‘t just for the sake of >>> creating a snapshot. >>> >>> (Just imagine you don‘t have a shared zeropage...) >> >> ... and I just

Re: [PATCH v13 0/5] UFFD write-tracking migration/snapshots

2021-02-19 Thread Peter Xu
On Fri, Feb 19, 2021 at 10:20:42PM +0100, David Hildenbrand wrote: > > A shiver just went down my spine. Please don‘t just for the sake of > > creating a snapshot. > > > > (Just imagine you don‘t have a shared zeropage...) > > ... and I just remembered we read all memory either way. Gah. > > I

Re: [PATCH v13 0/5] UFFD write-tracking migration/snapshots

2021-02-19 Thread David Hildenbrand
> Am 19.02.2021 um 22:14 schrieb David Hildenbrand : > >  >>> Am 19.02.2021 um 22:10 schrieb Peter Xu : >>> >>> On Fri, Feb 19, 2021 at 03:50:52PM -0500, Peter Xu wrote: >>> Andrey, >>> On Fri, Feb 19, 2021 at 09:57:37AM +0300, Andrey Gruzdev wrote: For the discards that happen

Re: [PATCH v13 0/5] UFFD write-tracking migration/snapshots

2021-02-19 Thread David Hildenbrand
> Am 19.02.2021 um 22:10 schrieb Peter Xu : > > On Fri, Feb 19, 2021 at 03:50:52PM -0500, Peter Xu wrote: >> Andrey, >> >>> On Fri, Feb 19, 2021 at 09:57:37AM +0300, Andrey Gruzdev wrote: >>> For the discards that happen before snapshot is started, I need to dig into >>> Linux and QEMU

Re: [PATCH v13 0/5] UFFD write-tracking migration/snapshots

2021-02-19 Thread Peter Xu
On Fri, Feb 19, 2021 at 03:50:52PM -0500, Peter Xu wrote: > Andrey, > > On Fri, Feb 19, 2021 at 09:57:37AM +0300, Andrey Gruzdev wrote: > > For the discards that happen before snapshot is started, I need to dig into > > Linux and QEMU virtio-baloon > > code more to get clear with it. > > Yes

Re: [PATCH v13 0/5] UFFD write-tracking migration/snapshots

2021-02-19 Thread Peter Xu
Andrey, On Fri, Feb 19, 2021 at 09:57:37AM +0300, Andrey Gruzdev wrote: > For the discards that happen before snapshot is started, I need to dig into > Linux and QEMU virtio-baloon > code more to get clear with it. Yes it's very tricky on how the error could trigger. Let's think of below

Re: [PATCH v13 0/5] UFFD write-tracking migration/snapshots

2021-02-18 Thread David Hildenbrand
On 19.02.21 07:57, Andrey Gruzdev wrote: On 17.02.2021 02:35, Peter Xu wrote: Hi, Andrey, On Sat, Feb 13, 2021 at 12:34:07PM +0300, Andrey Gruzdev wrote: On 12.02.2021 19:11, Peter Xu wrote: On Fri, Feb 12, 2021 at 09:52:52AM +0100, David Hildenbrand wrote: On 12.02.21 04:06, Peter Xu

Re: [PATCH v13 0/5] UFFD write-tracking migration/snapshots

2021-02-18 Thread Andrey Gruzdev
On 17.02.2021 02:35, Peter Xu wrote: Hi, Andrey, On Sat, Feb 13, 2021 at 12:34:07PM +0300, Andrey Gruzdev wrote: On 12.02.2021 19:11, Peter Xu wrote: On Fri, Feb 12, 2021 at 09:52:52AM +0100, David Hildenbrand wrote: On 12.02.21 04:06, Peter Xu wrote: On Thu, Feb 11, 2021 at 10:09:58PM

Re: [PATCH v13 0/5] UFFD write-tracking migration/snapshots

2021-02-17 Thread David Hildenbrand
On 17.02.21 00:35, Peter Xu wrote: Hi, Andrey, On Sat, Feb 13, 2021 at 12:34:07PM +0300, Andrey Gruzdev wrote: On 12.02.2021 19:11, Peter Xu wrote: On Fri, Feb 12, 2021 at 09:52:52AM +0100, David Hildenbrand wrote: On 12.02.21 04:06, Peter Xu wrote: On Thu, Feb 11, 2021 at 10:09:58PM +0100,

Re: [PATCH v13 0/5] UFFD write-tracking migration/snapshots

2021-02-16 Thread Peter Xu
Hi, Andrey, On Sat, Feb 13, 2021 at 12:34:07PM +0300, Andrey Gruzdev wrote: > On 12.02.2021 19:11, Peter Xu wrote: > > On Fri, Feb 12, 2021 at 09:52:52AM +0100, David Hildenbrand wrote: > > > On 12.02.21 04:06, Peter Xu wrote: > > > > On Thu, Feb 11, 2021 at 10:09:58PM +0100, David Hildenbrand

Re: [PATCH v13 0/5] UFFD write-tracking migration/snapshots

2021-02-13 Thread David Hildenbrand
> Am 13.02.2021 um 10:34 schrieb Andrey Gruzdev : > >  >> On 12.02.2021 19:11, Peter Xu wrote: On Fri, Feb 12, 2021 at 09:52:52AM +0100, David Hildenbrand wrote: > On 12.02.21 04:06, Peter Xu wrote: >> On Thu, Feb 11, 2021 at 10:09:58PM +0100, David Hildenbrand wrote: >> The

Re: [PATCH v13 0/5] UFFD write-tracking migration/snapshots

2021-02-13 Thread Andrey Gruzdev
On 12.02.2021 19:11, Peter Xu wrote: On Fri, Feb 12, 2021 at 09:52:52AM +0100, David Hildenbrand wrote: On 12.02.21 04:06, Peter Xu wrote: On Thu, Feb 11, 2021 at 10:09:58PM +0100, David Hildenbrand wrote: The issue is when the discard happened before starting the snapshot. Write-protection

Re: [PATCH v13 0/5] UFFD write-tracking migration/snapshots

2021-02-12 Thread Peter Xu
On Fri, Feb 12, 2021 at 09:52:52AM +0100, David Hildenbrand wrote: > On 12.02.21 04:06, Peter Xu wrote: > > On Thu, Feb 11, 2021 at 10:09:58PM +0100, David Hildenbrand wrote: > > > The issue is when the discard happened before starting the snapshot. > > > Write-protection won‘t work and the

Re: [PATCH v13 0/5] UFFD write-tracking migration/snapshots

2021-02-12 Thread David Hildenbrand
On 12.02.21 04:06, Peter Xu wrote: On Thu, Feb 11, 2021 at 10:09:58PM +0100, David Hildenbrand wrote: The issue is when the discard happened before starting the snapshot. Write-protection won‘t work and the zeroed content won‘t be retained in the snapshot. I see what you mean now, and iiuc

Re: [PATCH v13 0/5] UFFD write-tracking migration/snapshots

2021-02-11 Thread Peter Xu
On Thu, Feb 11, 2021 at 10:09:58PM +0100, David Hildenbrand wrote: > The issue is when the discard happened before starting the snapshot. > Write-protection won‘t work and the zeroed content won‘t be retained in the > snapshot. I see what you mean now, and iiuc it will only be a problem if

Re: [PATCH v13 0/5] UFFD write-tracking migration/snapshots

2021-02-11 Thread David Hildenbrand
> Am 11.02.2021 um 22:05 schrieb Peter Xu : > > On Thu, Feb 11, 2021 at 09:44:07PM +0100, David Hildenbrand wrote: >> Let‘s take a look at init-on-free. >> >> The guest zeroes a page and puts it onto a buddy freelist. Free page >> reporting code takes it off that list and reports it to the

Re: [PATCH v13 0/5] UFFD write-tracking migration/snapshots

2021-02-11 Thread Peter Xu
On Thu, Feb 11, 2021 at 09:44:07PM +0100, David Hildenbrand wrote: > Let‘s take a look at init-on-free. > > The guest zeroes a page and puts it onto a buddy freelist. Free page > reporting code takes it off that list and reports it to the hypervisor. The > hypervisor discards the physical page

Re: [PATCH v13 0/5] UFFD write-tracking migration/snapshots

2021-02-11 Thread David Hildenbrand
> Am 11.02.2021 um 21:31 schrieb Peter Xu : > > On Thu, Feb 11, 2021 at 08:01:29PM +0100, David Hildenbrand wrote: >>> On 11.02.21 19:28, Andrey Gruzdev wrote: >>> On 11.02.2021 20:32, Peter Xu wrote: On Thu, Feb 11, 2021 at 07:19:47PM +0300, Andrey Gruzdev wrote: > On 09.02.2021

Re: [PATCH v13 0/5] UFFD write-tracking migration/snapshots

2021-02-11 Thread Peter Xu
On Thu, Feb 11, 2021 at 08:01:29PM +0100, David Hildenbrand wrote: > On 11.02.21 19:28, Andrey Gruzdev wrote: > > On 11.02.2021 20:32, Peter Xu wrote: > > > On Thu, Feb 11, 2021 at 07:19:47PM +0300, Andrey Gruzdev wrote: > > > > On 09.02.2021 22:06, David Hildenbrand wrote: > > > > > > > Hi, > > >

Re: [PATCH v13 0/5] UFFD write-tracking migration/snapshots

2021-02-11 Thread David Hildenbrand
On 09.02.21 19:38, Andrey Gruzdev wrote: On 09.02.2021 15:37, David Hildenbrand wrote: On 21.01.21 16:24, andrey.gruzdev--- via wrote: This patch series is a kind of 'rethinking' of Denis Plotnikov's ideas he's implemented in his series '[PATCH v0 0/4] migration: add background snapshot'.

Re: [PATCH v13 0/5] UFFD write-tracking migration/snapshots

2021-02-11 Thread David Hildenbrand
On 11.02.21 19:28, Andrey Gruzdev wrote: On 11.02.2021 20:32, Peter Xu wrote: On Thu, Feb 11, 2021 at 07:19:47PM +0300, Andrey Gruzdev wrote: On 09.02.2021 22:06, David Hildenbrand wrote: Hi, just stumbled over this, quick question: I recently played with UFFD_WP and notices that write

Re: [PATCH v13 0/5] UFFD write-tracking migration/snapshots

2021-02-11 Thread Andrey Gruzdev
On 11.02.2021 20:32, Peter Xu wrote: On Thu, Feb 11, 2021 at 07:19:47PM +0300, Andrey Gruzdev wrote: On 09.02.2021 22:06, David Hildenbrand wrote: Hi, just stumbled over this, quick question: I recently played with UFFD_WP and notices that write protection is only effective on pages/ranges

Re: [PATCH v13 0/5] UFFD write-tracking migration/snapshots

2021-02-11 Thread Andrey Gruzdev
On 11.02.2021 20:18, Peter Xu wrote: On Thu, Feb 11, 2021 at 12:21:51PM +0300, Andrey Gruzdev wrote: On 09.02.2021 23:31, Peter Xu wrote: On Tue, Feb 09, 2021 at 03:09:28PM -0500, Peter Xu wrote: Hi, David, Andrey, On Tue, Feb 09, 2021 at 08:06:58PM +0100, David Hildenbrand wrote: Hi, just

Re: [PATCH v13 0/5] UFFD write-tracking migration/snapshots

2021-02-11 Thread Peter Xu
On Thu, Feb 11, 2021 at 07:19:47PM +0300, Andrey Gruzdev wrote: > On 09.02.2021 22:06, David Hildenbrand wrote: > > > > Hi, > > > > > > > > just stumbled over this, quick question: > > > > > > > > I recently played with UFFD_WP and notices that write protection is > > > > only effective on

Re: [PATCH v13 0/5] UFFD write-tracking migration/snapshots

2021-02-11 Thread Peter Xu
On Thu, Feb 11, 2021 at 12:21:51PM +0300, Andrey Gruzdev wrote: > On 09.02.2021 23:31, Peter Xu wrote: > > On Tue, Feb 09, 2021 at 03:09:28PM -0500, Peter Xu wrote: > > > Hi, David, Andrey, > > > > > > On Tue, Feb 09, 2021 at 08:06:58PM +0100, David Hildenbrand wrote: > > > > > > Hi, > > > > > >

Re: [PATCH v13 0/5] UFFD write-tracking migration/snapshots

2021-02-11 Thread Andrey Gruzdev
On 09.02.2021 22:06, David Hildenbrand wrote: Hi, just stumbled over this, quick question: I recently played with UFFD_WP and notices that write protection is only effective on pages/ranges that have already pages populated (IOW: !pte_none() in the kernel). In case memory was never populated

Re: [PATCH v13 0/5] UFFD write-tracking migration/snapshots

2021-02-11 Thread Andrey Gruzdev
On 09.02.2021 23:31, Peter Xu wrote: On Tue, Feb 09, 2021 at 03:09:28PM -0500, Peter Xu wrote: Hi, David, Andrey, On Tue, Feb 09, 2021 at 08:06:58PM +0100, David Hildenbrand wrote: Hi, just stumbled over this, quick question: I recently played with UFFD_WP and notices that write protection

Re: [PATCH v13 0/5] UFFD write-tracking migration/snapshots

2021-02-09 Thread Peter Xu
On Tue, Feb 09, 2021 at 03:09:28PM -0500, Peter Xu wrote: > Hi, David, Andrey, > > On Tue, Feb 09, 2021 at 08:06:58PM +0100, David Hildenbrand wrote: > > > > Hi, > > > > > > > > just stumbled over this, quick question: > > > > > > > > I recently played with UFFD_WP and notices that write

Re: [PATCH v13 0/5] UFFD write-tracking migration/snapshots

2021-02-09 Thread Peter Xu
Hi, David, Andrey, On Tue, Feb 09, 2021 at 08:06:58PM +0100, David Hildenbrand wrote: > > > Hi, > > > > > > just stumbled over this, quick question: > > > > > > I recently played with UFFD_WP and notices that write protection is > > > only effective on pages/ranges that have already pages

Re: [PATCH v13 0/5] UFFD write-tracking migration/snapshots

2021-02-09 Thread David Hildenbrand
Hi, just stumbled over this, quick question: I recently played with UFFD_WP and notices that write protection is only effective on pages/ranges that have already pages populated (IOW: !pte_none() in the kernel). In case memory was never populated (or was discarded using e.g.,

Re: [PATCH v13 0/5] UFFD write-tracking migration/snapshots

2021-02-09 Thread Andrey Gruzdev
On 09.02.2021 15:37, David Hildenbrand wrote: On 21.01.21 16:24, andrey.gruzdev--- via wrote: This patch series is a kind of 'rethinking' of Denis Plotnikov's ideas he's implemented in his series '[PATCH v0 0/4] migration: add background snapshot'. Currently the only way to make (external)

Re: [PATCH v13 0/5] UFFD write-tracking migration/snapshots

2021-02-09 Thread David Hildenbrand
On 21.01.21 16:24, andrey.gruzdev--- via wrote: This patch series is a kind of 'rethinking' of Denis Plotnikov's ideas he's implemented in his series '[PATCH v0 0/4] migration: add background snapshot'. Currently the only way to make (external) live VM snapshot is using existing dirty page

[PATCH v13 0/5] UFFD write-tracking migration/snapshots

2021-01-21 Thread andrey . gruzdev--- via
This patch series is a kind of 'rethinking' of Denis Plotnikov's ideas he's implemented in his series '[PATCH v0 0/4] migration: add background snapshot'. Currently the only way to make (external) live VM snapshot is using existing dirty page logging migration mechanism. The main problem is that