Re: [PATCH 1/2] accel: kvm: Fix memory waste under mismatch page size

2020-12-16 Thread Keqian Zhu
On 2020/12/17 4:48, Peter Xu wrote: > On Wed, Dec 16, 2020 at 04:21:17PM +0800, Keqian Zhu wrote: >> One more thing, we should consider whether @start and @size is psize aligned >> (my second >> patch). Do you agree to add assert on them directly? > > Yes I think the 2nd patch is okay, but ple

Re: [PATCH 1/2] accel: kvm: Fix memory waste under mismatch page size

2020-12-16 Thread Peter Xu
On Wed, Dec 16, 2020 at 04:21:17PM +0800, Keqian Zhu wrote: > One more thing, we should consider whether @start and @size is psize aligned > (my second > patch). Do you agree to add assert on them directly? Yes I think the 2nd patch is okay, but please address Drew's comments. Returning -EINVAL

Re: [PATCH 1/2] accel: kvm: Fix memory waste under mismatch page size

2020-12-16 Thread Keqian Zhu
Hi Peter, On 2020/12/16 1:57, Peter Xu wrote: > On Tue, Dec 15, 2020 at 03:19:47PM +0800, Keqian Zhu wrote: >> When handle dirty log, we face qemu_real_host_page_size and >> TARGET_PAGE_SIZE. The first one is the granule of KVM dirty >> bitmap, and the second one is the granule of QEMU dirty bitma

Re: [PATCH 1/2] accel: kvm: Fix memory waste under mismatch page size

2020-12-16 Thread Keqian Zhu
Hi drew, On 2020/12/15 19:20, Andrew Jones wrote: > On Tue, Dec 15, 2020 at 03:19:47PM +0800, Keqian Zhu wrote: >> When handle dirty log, we face qemu_real_host_page_size and >> TARGET_PAGE_SIZE. The first one is the granule of KVM dirty >> bitmap, and the second one is the granule of QEMU dirty b

Re: [PATCH 1/2] accel: kvm: Fix memory waste under mismatch page size

2020-12-15 Thread Peter Xu
On Tue, Dec 15, 2020 at 03:19:47PM +0800, Keqian Zhu wrote: > When handle dirty log, we face qemu_real_host_page_size and > TARGET_PAGE_SIZE. The first one is the granule of KVM dirty > bitmap, and the second one is the granule of QEMU dirty bitmap. > > Generally speaking, qemu_real_host_page_size

Re: [PATCH 1/2] accel: kvm: Fix memory waste under mismatch page size

2020-12-15 Thread Andrew Jones
On Tue, Dec 15, 2020 at 03:19:47PM +0800, Keqian Zhu wrote: > When handle dirty log, we face qemu_real_host_page_size and > TARGET_PAGE_SIZE. The first one is the granule of KVM dirty > bitmap, and the second one is the granule of QEMU dirty bitmap. > > Generally speaking, qemu_real_host_page_size

[PATCH 1/2] accel: kvm: Fix memory waste under mismatch page size

2020-12-14 Thread Keqian Zhu
When handle dirty log, we face qemu_real_host_page_size and TARGET_PAGE_SIZE. The first one is the granule of KVM dirty bitmap, and the second one is the granule of QEMU dirty bitmap. Generally speaking, qemu_real_host_page_size >= TARGET_PAGE_SIZE, so misuse TARGET_PAGE_SIZE to init kvmslot dirty