[RFC for qemu v4 0/2] virtio-balloon: Add option cont-pages to set VIRTIO_BALLOON_F_CONT_PAGES

2020-07-15 Thread Hui Zhu
two benefits: 1. Increase the speed of balloon inflate and deflate. 2. Decrease the splitted THPs number in the host. [1] https://github.com/teawater/linux/tree/balloon_conts [2] https://github.com/teawater/qemu/tree/balloon_conts [3] https://lkml.org/lkml/2020/5/13/1211 Hui Zhu (2

[RFC for qemu v4 2/2] virtio_balloon: Add dcvq to deflate continuous pages

2020-07-15 Thread Hui Zhu
This commit adds a vq dcvq to deflate continuous pages. When VIRTIO_BALLOON_F_CONT_PAGES is set, try to get continuous pages from icvq and use madvise MADV_WILLNEED with the pages. Signed-off-by: Hui Zhu --- hw/virtio/virtio-balloon.c | 14 +- include/hw/virtio/virtio

[RFC for Linux v4 1/2] virtio_balloon: Add VIRTIO_BALLOON_F_CONT_PAGES and inflate_cont_vq

2020-07-15 Thread Hui Zhu
This commit adds a new flag VIRTIO_BALLOON_F_CONT_PAGES to virtio_balloon. Add it adds a vq inflate_cont_vq to inflate continuous pages. When VIRTIO_BALLOON_F_CONT_PAGES is set, try to allocate continuous pages and report them use inflate_cont_vq. Signed-off-by: Hui Zhu --- drivers/virtio

[RFC for Linux v4 2/2] virtio_balloon: Add deflate_cont_vq to deflate continuous pages

2020-07-15 Thread Hui Zhu
: Hui Zhu --- drivers/virtio/virtio_balloon.c| 73 include/linux/balloon_compaction.h | 3 ++ mm/balloon_compaction.c| 76 ++ 3 files changed, 144 insertions(+), 8 deletions(-) diff --git a/drivers/virtio

[RFC for qemu v4 1/2] virtio_balloon: Add cont-pages and icvq

2020-07-15 Thread Hui Zhu
the pages. Signed-off-by: Hui Zhu --- hw/virtio/virtio-balloon.c | 80 - include/hw/virtio/virtio-balloon.h | 2 +- include/standard-headers/linux/virtio_balloon.h | 1 + 3 files changed, 55 insertions(+), 28 deletions(-) diff --git a

[RFC for Linux v4 0/2] virtio_balloon: Add VIRTIO_BALLOON_F_CONT_PAGES to report continuous pages

2020-07-15 Thread Hui Zhu
kml/2020/5/12/324 [4] https://github.com/teawater/linux/tree/balloon_conts [5] https://github.com/teawater/qemu/tree/balloon_conts [6] https://lkml.org/lkml/2020/5/13/1211 Hui Zhu (2): virtio_balloon: Add VIRTIO_BALLOON_F_CONT_PAGES and inflate_cont_vq virtio_balloon: Add deflate_cont_vq to

[RFC v3 for QEMU] virtio-balloon: Add option cont-pages to set VIRTIO_BALLOON_VQ_INFLATE_CONT

2020-05-12 Thread Hui Zhu
get continuous pages PFN that its order is current_pages_order from VQ ivq use use madvise MADV_DONTNEED release the page. This will handle the THP split issue. Signed-off-by: Hui Zhu --- hw/virtio/virtio-balloon.c | 77 + include/hw/virtio/virtio

[RFC v3 for Linux] virtio_balloon: Add VIRTIO_BALLOON_VQ_INFLATE_CONT to handle THP split issue

2020-05-12 Thread Hui Zhu
age. [1] https://lkml.org/lkml/2020/3/12/144 [2] https://lore.kernel.org/linux-mm/1584893097-12317-1-git-send-email-teawa...@gmail.com/ Signed-off-by: Hui Zhu --- drivers/virtio/virtio_balloon.c | 98 +++-- include/linux/balloon_compaction.h | 9 +++- incl

[PATCH for QEMU v2] virtio-balloon: Add option cont-pages to set VIRTIO_BALLOON_VQ_INFLATE_CONT

2020-03-22 Thread Hui Zhu
continuous pages PFN from VQ icvq use use madvise MADV_DONTNEED release the THP page. This will handle the THP split issue. Signed-off-by: Hui Zhu --- hw/virtio/virtio-balloon.c | 32 + include/hw/virtio/virtio-balloon.h | 4 +++- include

[PATCH for Linux v2] virtio_balloon: Add VIRTIO_BALLOON_VQ_INFLATE_CONT to handle THP split issue

2020-03-22 Thread Hui Zhu
kml/2020/3/12/144 Signed-off-by: Hui Zhu --- drivers/virtio/virtio_balloon.c | 78 ++--- include/linux/balloon_compaction.h | 9 - include/uapi/linux/virtio_balloon.h | 3 ++ mm/balloon_compaction.c | 40 +++ 4 files chan

[PATCH] virtio_balloon: Add option mprotect to handle guest kernel cheat issue

2020-03-12 Thread Hui Zhu
8b 46 08 83 c3 01 48 8d 50 f8 48 8d 46 08 49 35 This shows that the access is refused and QEMU stops. [1] https://github.com/teawater/linux/tree/write_balloon Signed-off-by: Hui Zhu --- exec.c | 33 +++-- hw/virtio/virtio-balloo

[RFC for QEMU] virtio-balloon: Add option thp-order to set VIRTIO_BALLOON_F_THP_ORDER

2020-03-12 Thread Hui Zhu
. Signed-off-by: Hui Zhu --- hw/virtio/virtio-balloon.c | 67 - include/standard-headers/linux/virtio_balloon.h | 4 ++ 2 files changed, 47 insertions(+), 24 deletions(-) diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c index a4729f7

[RFC for Linux] virtio_balloon: Add VIRTIO_BALLOON_F_THP_ORDER to handle THP spilt issue

2020-03-12 Thread Hui Zhu
balloon: actual=624 cat /proc/meminfo | grep AnonHugePages: AnonHugePages:583680 kB The THP number decreases 384M. This shows that VIRTIO_BALLOON_F_THP_ORDER can help handle the THP split issue. Signed-off-by: Hui Zhu --- drivers/virtio/virtio_balloon.c

[Qemu-devel] qustion about x86 sse insn "lddqu"

2009-12-02 Thread Hui Zhu
Hi, In qemu 0.11.0, it handle lddqu as: case 0x3f0: /* lddqu */ if (mod == 3) goto illegal_op; gen_lea_modrm(s, modrm, ®_addr, &offset_addr); gen_sto_env_A0(s->mem_index, offsetof(CPUX86State,xmm_regs[reg])); break; It st the