Re: [PATCH] kvm: Take into account the unaligned section size when preparing bitmap

2020-12-14 Thread Zenghui Yu
Hi Keqian, Peter, On 2020/12/15 15:23, zhukeqian wrote: On 2020/12/14 23:36, Peter Xu wrote: On Mon, Dec 14, 2020 at 10:14:11AM +0800, zhukeqian wrote: [...] Though indeed I must confess I don't know how it worked in general when host page size != target page size, at least for migration.

Re: [PATCH] kvm: Take into account the unaligned section size when preparing bitmap

2020-12-14 Thread zhukeqian
On 2020/12/14 23:36, Peter Xu wrote: > On Mon, Dec 14, 2020 at 10:14:11AM +0800, zhukeqian wrote: > > [...] > > Though indeed I must confess I don't know how it worked in general when > host > page size != target page size, at least for migration. For example, I > believe >>>

Re: [PATCH] kvm: Take into account the unaligned section size when preparing bitmap

2020-12-14 Thread Peter Xu
On Mon, Dec 14, 2020 at 10:14:11AM +0800, zhukeqian wrote: [...] > >>> Though indeed I must confess I don't know how it worked in general when > >>> host > >>> page size != target page size, at least for migration. For example, I > >>> believe > >>> kvm dirty logging is host page size based, t

Re: [PATCH] kvm: Take into account the unaligned section size when preparing bitmap

2020-12-13 Thread zhukeqian
On 2020/12/11 23:25, Peter Xu wrote: > On Fri, Dec 11, 2020 at 09:13:10AM +0800, zhukeqian wrote: >> >> On 2020/12/10 22:50, Peter Xu wrote: >>> On Thu, Dec 10, 2020 at 10:53:23AM +0800, zhukeqian wrote: On 2020/12/10 10:08, Peter Xu wrote: > Keqian, > > On Thu, Dec 10

Re: [PATCH] kvm: Take into account the unaligned section size when preparing bitmap

2020-12-11 Thread Peter Xu
On Fri, Dec 11, 2020 at 09:13:10AM +0800, zhukeqian wrote: > > On 2020/12/10 22:50, Peter Xu wrote: > > On Thu, Dec 10, 2020 at 10:53:23AM +0800, zhukeqian wrote: > >> > >> > >> On 2020/12/10 10:08, Peter Xu wrote: > >>> Keqian, > >>> > >>> On Thu, Dec 10, 2020 at 09:46:06AM +0800, zhukeqian wrote

Re: [PATCH] kvm: Take into account the unaligned section size when preparing bitmap

2020-12-10 Thread zhukeqian
On 2020/12/10 22:50, Peter Xu wrote: > On Thu, Dec 10, 2020 at 10:53:23AM +0800, zhukeqian wrote: >> >> >> On 2020/12/10 10:08, Peter Xu wrote: >>> Keqian, >>> >>> On Thu, Dec 10, 2020 at 09:46:06AM +0800, zhukeqian wrote: Hi, I see that if start or size is not PAGE aligned, it als

Re: [PATCH] kvm: Take into account the unaligned section size when preparing bitmap

2020-12-10 Thread Peter Xu
On Thu, Dec 10, 2020 at 10:53:23AM +0800, zhukeqian wrote: > > > On 2020/12/10 10:08, Peter Xu wrote: > > Keqian, > > > > On Thu, Dec 10, 2020 at 09:46:06AM +0800, zhukeqian wrote: > >> Hi, > >> > >> I see that if start or size is not PAGE aligned, it also clears areas > >> which beyond caller's

Re: [PATCH] kvm: Take into account the unaligned section size when preparing bitmap

2020-12-09 Thread Zenghui Yu
On 2020/12/10 5:09, Peter Xu wrote: On Wed, Dec 09, 2020 at 10:33:41AM +0800, Zenghui Yu wrote: Hi Peter, Thanks for having a look at it. On 2020/12/8 23:16, Peter Xu wrote: Hi, Zenghui, On Tue, Dec 08, 2020 at 07:40:13PM +0800, Zenghui Yu wrote: The kernel KVM_CLEAR_DIRTY_LOG interface has

Re: [PATCH] kvm: Take into account the unaligned section size when preparing bitmap

2020-12-09 Thread Zenghui Yu
On 2020/12/10 10:53, zhukeqian wrote: On 2020/12/10 10:08, Peter Xu wrote: Keqian, On Thu, Dec 10, 2020 at 09:46:06AM +0800, zhukeqian wrote: Hi, I see that if start or size is not PAGE aligned, it also clears areas which beyond caller's expectation, so do we also need to consider this? A

Re: [PATCH] kvm: Take into account the unaligned section size when preparing bitmap

2020-12-09 Thread zhukeqian
On 2020/12/10 10:08, Peter Xu wrote: > Keqian, > > On Thu, Dec 10, 2020 at 09:46:06AM +0800, zhukeqian wrote: >> Hi, >> >> I see that if start or size is not PAGE aligned, it also clears areas >> which beyond caller's expectation, so do we also need to consider this? > > Could you elaborate? >

Re: [PATCH] kvm: Take into account the unaligned section size when preparing bitmap

2020-12-09 Thread Peter Xu
Keqian, On Thu, Dec 10, 2020 at 09:46:06AM +0800, zhukeqian wrote: > Hi, > > I see that if start or size is not PAGE aligned, it also clears areas > which beyond caller's expectation, so do we also need to consider this? Could you elaborate? If start_delta != 0, kvm_log_clear_one_slot() should

Re: [PATCH] kvm: Take into account the unaligned section size when preparing bitmap

2020-12-09 Thread zhukeqian
Hi, I see that if start or size is not PAGE aligned, it also clears areas which beyond caller's expectation, so do we also need to consider this? Thanks, Keqian On 2020/12/9 10:33, Zenghui Yu wrote: > Hi Peter, > > Thanks for having a look at it. > > On 2020/12/8 23:16, Peter Xu wrote: >> Hi,

Re: [PATCH] kvm: Take into account the unaligned section size when preparing bitmap

2020-12-09 Thread Peter Xu
On Wed, Dec 09, 2020 at 10:33:41AM +0800, Zenghui Yu wrote: > Hi Peter, > > Thanks for having a look at it. > > On 2020/12/8 23:16, Peter Xu wrote: > > Hi, Zenghui, > > > > On Tue, Dec 08, 2020 at 07:40:13PM +0800, Zenghui Yu wrote: > > > The kernel KVM_CLEAR_DIRTY_LOG interface has align requir

Re: [PATCH] kvm: Take into account the unaligned section size when preparing bitmap

2020-12-08 Thread Zenghui Yu
Hi Peter, Thanks for having a look at it. On 2020/12/8 23:16, Peter Xu wrote: Hi, Zenghui, On Tue, Dec 08, 2020 at 07:40:13PM +0800, Zenghui Yu wrote: The kernel KVM_CLEAR_DIRTY_LOG interface has align requirement on both the start and the size of the given range of pages. We have been carefu

Re: [PATCH] kvm: Take into account the unaligned section size when preparing bitmap

2020-12-08 Thread Peter Xu
Hi, Zenghui, On Tue, Dec 08, 2020 at 07:40:13PM +0800, Zenghui Yu wrote: > The kernel KVM_CLEAR_DIRTY_LOG interface has align requirement on both the > start and the size of the given range of pages. We have been careful to > handle the unaligned cases when performing CLEAR on one slot. But it see

[PATCH] kvm: Take into account the unaligned section size when preparing bitmap

2020-12-08 Thread Zenghui Yu
The kernel KVM_CLEAR_DIRTY_LOG interface has align requirement on both the start and the size of the given range of pages. We have been careful to handle the unaligned cases when performing CLEAR on one slot. But it seems that we forget to take the unaligned *size* case into account when preparing