[PATCH v32 2/4] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT

2018-04-09 Thread Wei Wang
sending the starting cmd id, so the guest doesn't need to kick after filling an element to the vq. Host may also requests the guest to stop the reporting in advance by sending the stop cmd id to the guest via the configuration register. Signed-off-by: Wei Wang <wei.w.w...@intel.com> Sign

[PATCH v32 4/4] virtio-balloon: VIRTIO_BALLOON_F_PAGE_POISON

2018-04-09 Thread Wei Wang
The VIRTIO_BALLOON_F_PAGE_POISON feature bit is used to indicate if the guest is using page poisoning. Guest writes to the poison_val config field to tell host about the page poisoning value in use. Signed-off-by: Wei Wang <wei.w.w...@intel.com> Suggested-by: Michael S. Tsirkin <m...@r

[PATCH v32 3/4] mm/page_poison: expose page_poisoning_enabled to kernel modules

2018-04-09 Thread Wei Wang
In some usages, e.g. virtio-balloon, a kernel module needs to know if page poisoning is in use. This patch exposes the page_poisoning_enabled function to kernel modules. Signed-off-by: Wei Wang <wei.w.w...@intel.com> Cc: Andrew Morton <a...@linux-foundation.org> Cc: Micha

Re: [PATCH v31 2/4] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT

2018-04-09 Thread Wei Wang
On 04/09/2018 02:03 PM, Michael S. Tsirkin wrote: On Fri, Apr 06, 2018 at 08:17:23PM +0800, Wei Wang wrote: Negotiation of the VIRTIO_BALLOON_F_FREE_PAGE_HINT feature indicates the support of reporting hints of guest free pages to host via virtio-balloon. Host requests the guest to report free

[PATCH v31 3/4] mm/page_poison: expose page_poisoning_enabled to kernel modules

2018-04-06 Thread Wei Wang
In some usages, e.g. virtio-balloon, a kernel module needs to know if page poisoning is in use. This patch exposes the page_poisoning_enabled function to kernel modules. Signed-off-by: Wei Wang <wei.w.w...@intel.com> Cc: Andrew Morton <a...@linux-foundation.org> Cc: Micha

[PATCH v31 4/4] virtio-balloon: VIRTIO_BALLOON_F_PAGE_POISON

2018-04-06 Thread Wei Wang
The VIRTIO_BALLOON_F_PAGE_POISON feature bit is used to indicate if the guest is using page poisoning. Guest writes to the poison_val config field to tell host about the page poisoning value in use. Signed-off-by: Wei Wang <wei.w.w...@intel.com> Suggested-by: Michael S. Tsirkin <m...@r

[PATCH v31 1/4] mm: support reporting free page blocks

2018-04-06 Thread Wei Wang
ges but are written after the report function returns will be captured by the hypervisor, and they will be added to the next round of memory transfer. Signed-off-by: Wei Wang <wei.w.w...@intel.com> Signed-off-by: Liang Li <liang.z...@intel.com> Cc: Michal Hocko <mho...@kernel.org&

[PATCH v31 2/4] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT

2018-04-06 Thread Wei Wang
sending the starting cmd id, so the guest doesn't need to kick after filling an element to the vq. Host may also requests the guest to stop the reporting in advance by sending the stop cmd id to the guest via the configuration register. Signed-off-by: Wei Wang <wei.w.w...@intel.com> Sign

[PATCH v31 0/4] Virtio-balloon: support free page reporting

2018-04-06 Thread Wei Wang
ss this flag check later; - init_vqs: change to put some variables on stack to have simpler implementation; - add destroy_workqueue(vb->balloon_wq); v21->v22: - add_one_sg: some code and comment re-arrangement - send_cmd_id: handle a cornercase For previous ChangeLog, plea

Re: [PATCH v30 2/4] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT

2018-04-03 Thread Wei Wang
On 04/04/2018 02:47 AM, Michael S. Tsirkin wrote: On Wed, Apr 04, 2018 at 12:10:03AM +0800, Wei Wang wrote: +static int add_one_sg(struct virtqueue *vq, unsigned long pfn, uint32_t len) +{ + struct scatterlist sg; + unsigned int unused; + + sg_init_table(, 1

[PATCH v30 2/4] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT

2018-04-03 Thread Wei Wang
sending the starting cmd id, so the guest doesn't need to kick after filling an element to the vq. Host may also requests the guest to stop the reporting in advance by sending the stop cmd id to the guest via the configuration register. Signed-off-by: Wei Wang <wei.w.w...@intel.com> Sign

[PATCH v30 4/4] virtio-balloon: VIRTIO_BALLOON_F_PAGE_POISON

2018-04-03 Thread Wei Wang
The VIRTIO_BALLOON_F_PAGE_POISON feature bit is used to indicate if the guest is using page poisoning. Guest writes to the poison_val config field to tell host about the page poisoning value in use. Signed-off-by: Wei Wang <wei.w.w...@intel.com> Suggested-by: Michael S. Tsirkin <m...@r

[PATCH v30 3/4] mm/page_poison: expose page_poisoning_enabled to kernel modules

2018-04-03 Thread Wei Wang
In some usages, e.g. virtio-balloon, a kernel module needs to know if page poisoning is in use. This patch exposes the page_poisoning_enabled function to kernel modules. Signed-off-by: Wei Wang <wei.w.w...@intel.com> Cc: Andrew Morton <a...@linux-foundation.org> Cc: Micha

[PATCH v30 0/4] Virtio-balloon: support free page reporting

2018-04-03 Thread Wei Wang
t_vqs: change to put some variables on stack to have simpler implementation; - add destroy_workqueue(vb->balloon_wq); v21->v22: - add_one_sg: some code and comment re-arrangement - send_cmd_id: handle a cornercase For previous ChangeLog, please reference https:/

[PATCH v30 1/4] mm: support reporting free page blocks

2018-04-03 Thread Wei Wang
ges but are written after the report function returns will be captured by the hypervisor, and they will be added to the next round of memory transfer. Signed-off-by: Wei Wang <wei.w.w...@intel.com> Signed-off-by: Liang Li <liang.z...@intel.com> Cc: Michal Hocko <mho...@kernel.org&

Re: [PATCH v29 1/4] mm: support reporting free page blocks

2018-03-27 Thread Wei Wang
On 03/27/2018 05:22 AM, Andrew Morton wrote: On Mon, 26 Mar 2018 10:39:51 +0800 Wei Wang <wei.w.w...@intel.com> wrote: This patch adds support to walk through the free page blocks in the system and report them via a callback function. Some page blocks may leave the free list after zone

[PATCH v29 4/4] virtio-balloon: VIRTIO_BALLOON_F_PAGE_POISON

2018-03-25 Thread Wei Wang
The VIRTIO_BALLOON_F_PAGE_POISON feature bit is used to indicate if the guest is using page poisoning. Guest writes to the poison_val config field to tell host about the page poisoning value in use. Signed-off-by: Wei Wang <wei.w.w...@intel.com> Suggested-by: Michael S. Tsirkin <m...@r

[PATCH v29 3/4] mm/page_poison: expose page_poisoning_enabled to kernel modules

2018-03-25 Thread Wei Wang
In some usages, e.g. virtio-balloon, a kernel module needs to know if page poisoning is in use. This patch exposes the page_poisoning_enabled function to kernel modules. Signed-off-by: Wei Wang <wei.w.w...@intel.com> Cc: Andrew Morton <a...@linux-foundation.org> Cc: Micha

[PATCH v29 2/4] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT

2018-03-25 Thread Wei Wang
sending the starting cmd id, so the guest doesn't need to kick after filling an element to the vq. Host may also requests the guest to stop the reporting in advance by sending the stop cmd id to the guest via the configuration register. Signed-off-by: Wei Wang <wei.w.w...@intel.com> Sign

[PATCH v29 1/4] mm: support reporting free page blocks

2018-03-25 Thread Wei Wang
ges but are written after the report function returns will be captured by the hypervisor, and they will be added to the next round of memory transfer. Signed-off-by: Wei Wang <wei.w.w...@intel.com> Signed-off-by: Liang Li <liang.z...@intel.com> Cc: Michal Hocko <mho...@kernel.org> C

[PATCH v29 0/4] Virtio-balloon: support free page reporting

2018-03-25 Thread Wei Wang
tion; - add destroy_workqueue(vb->balloon_wq); v21->v22: - add_one_sg: some code and comment re-arrangement - send_cmd_id: handle a cornercase For previous ChangeLog, please reference https://lwn.net/Articles/743660/ Wei Wang (4): mm: support reporting free page blocks

Re: [PATCH] mm/page_poison: move PAGE_POISON to page_poison.c

2018-02-25 Thread Wei Wang
On 02/13/2018 06:16 PM, Michal Hocko wrote: On Fri 09-02-18 16:08:14, Wei Wang wrote: The PAGE_POISON macro is used in page_poison.c only, so avoid exporting it. Also remove the "mm/debug-pagealloc.c" related comment, which is obsolete. Why is this an improvement? I thought the w

Re: [PATCH v28 0/4] Virtio-balloon: support free page reporting

2018-02-25 Thread Wei Wang
On 02/09/2018 11:14 AM, Michael S. Tsirkin wrote: On Fri, Feb 09, 2018 at 11:11:39AM +0800, Wei Wang wrote: On 02/09/2018 03:55 AM, Michael S. Tsirkin wrote: On Thu, Feb 08, 2018 at 05:50:16PM +0800, Wei Wang wrote: Details: Set up a Ping-Pong local live migration, where the guest ceaselessy

[PATCH] mm/page_poison: move PAGE_POISON to page_poison.c

2018-02-09 Thread Wei Wang
The PAGE_POISON macro is used in page_poison.c only, so avoid exporting it. Also remove the "mm/debug-pagealloc.c" related comment, which is obsolete. Signed-off-by: Wei Wang <wei.w.w...@intel.com> Cc: Andrew Morton <a...@linux-foundation.org> Cc: Michal Hocko <mho...@

Re: [PATCH v28 0/4] Virtio-balloon: support free page reporting

2018-02-08 Thread Wei Wang
On 02/09/2018 03:55 AM, Michael S. Tsirkin wrote: On Thu, Feb 08, 2018 at 05:50:16PM +0800, Wei Wang wrote: Details: Set up a Ping-Pong local live migration, where the guest ceaselessy migrates between the source and destination. Linux compilation, i.e. make bzImage -j4, is performed during

[PATCH v28 2/4] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT

2018-02-08 Thread Wei Wang
sending the starting cmd id, so the guest doesn't need to kick after filling an element to the vq. Host may also requests the guest to stop the reporting in advance by sending the stop cmd id to the guest via the configuration register. Signed-off-by: Wei Wang <wei.w.w...@intel.com> Sign

[PATCH v28 1/4] mm: support reporting free page blocks

2018-02-08 Thread Wei Wang
ges but are written after the report function returns will be captured by the hypervisor, and they will be added to the next round of memory transfer. Signed-off-by: Wei Wang <wei.w.w...@intel.com> Signed-off-by: Liang Li <liang.z...@intel.com> Cc: Michal Hocko <mho...@kernel.org> C

[PATCH v28 4/4] virtio-balloon: VIRTIO_BALLOON_F_PAGE_POISON

2018-02-08 Thread Wei Wang
The VIRTIO_BALLOON_F_PAGE_POISON feature bit is used to indicate if the guest is using page poisoning. Guest writes to the poison_val config field to tell host about the page poisoning value in use. Signed-off-by: Wei Wang <wei.w.w...@intel.com> Suggested-by: Michael S. Tsirkin <m...@r

[PATCH v28 3/4] mm/page_poison: add a function to expose page poison val to kernel modules

2018-02-08 Thread Wei Wang
Move the PAGE_POISON value to page_poison.c and add a function to enable callers from a kernel module to get the poison value if the page poisoning feature is in use. This also avoids callers directly checking PAGE_POISON regardless of whether the feature is enabled. Signed-off-by: Wei Wang

[PATCH v28 0/4] Virtio-balloon: support free page reporting

2018-02-08 Thread Wei Wang
t;balloon_wq); v21->v22: - add_one_sg: some code and comment re-arrangement - send_cmd_id: handle a cornercase For previous ChangeLog, please reference https://lwn.net/Articles/743660/ Wei Wang (4): mm: support reporting free page blocks virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT mm/p

Re: [PATCH v27 3/4] mm/page_poison: expose page_poisoning_enabled to kernel modules

2018-02-07 Thread Wei Wang
On 02/08/2018 02:34 AM, Michael S. Tsirkin wrote: On Wed, Feb 07, 2018 at 02:54:30PM +0800, Wei Wang wrote: In some usages, e.g. virtio-balloon, a kernel module needs to know if page poisoning is in use. This patch exposes the page_poisoning_enabled function to kernel modules. Signed-off

Re: [PATCH v26 2/2 RESEND] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT

2018-02-06 Thread Wei Wang
On 02/07/2018 12:34 PM, Michael S. Tsirkin wrote: On Wed, Feb 07, 2018 at 11:01:06AM +0800, Wei Wang wrote: Negotiation of the VIRTIO_BALLOON_F_FREE_PAGE_HINT feature indicates the support of reporting hints of guest free pages to host via virtio-balloon. Host requests the guest to report free

[PATCH v27 4/4] virtio-balloon: VIRTIO_BALLOON_F_PAGE_POISON

2018-02-06 Thread Wei Wang
The VIRTIO_BALLOON_F_PAGE_POISON feature bit is used to indicate if the guest is using page poisoning. Guest writes to the poison_val config field to tell host about the page poisoning value in use. Signed-off-by: Wei Wang <wei.w.w...@intel.com> Suggested-by: Michael S. Tsirkin <m...@r

[PATCH v27 3/4] mm/page_poison: expose page_poisoning_enabled to kernel modules

2018-02-06 Thread Wei Wang
In some usages, e.g. virtio-balloon, a kernel module needs to know if page poisoning is in use. This patch exposes the page_poisoning_enabled function to kernel modules. Signed-off-by: Wei Wang <wei.w.w...@intel.com> Cc: Andrew Morton <a...@linux-foundation.org> Cc: Micha

[PATCH v27 2/4] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT

2018-02-06 Thread Wei Wang
sending the starting cmd id, so the guest doesn't need to kick after filling an element to the vq. Host may also requests the guest to stop the reporting in advance by sending the stop cmd id to the guest via the configuration register. Signed-off-by: Wei Wang <wei.w.w...@intel.com> Sign

[PATCH v27 1/4] mm: support reporting free page blocks

2018-02-06 Thread Wei Wang
ges but are written after the report function returns will be captured by the hypervisor, and they will be added to the next round of memory transfer. Signed-off-by: Wei Wang <wei.w.w...@intel.com> Signed-off-by: Liang Li <liang.z...@intel.com> Cc: Michal Hocko <mho...@kernel.org> C

[PATCH v27 0/4] Virtio-balloon: support free page reporting

2018-02-06 Thread Wei Wang
iscuss this flag check later; - init_vqs: change to put some variables on stack to have simpler implementation; - add destroy_workqueue(vb->balloon_wq); v21->v22: - add_one_sg: some code and comment re-arrangement - send_cmd_id: handle a cornercase For previous ChangeLog

[PATCH v26 2/2 RESEND] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT

2018-02-06 Thread Wei Wang
sending the starting cmd id, so the guest doesn't need to kick after filling an element to the vq. Host may also requests the guest to stop the reporting in advance by sending the stop cmd id to the guest via the configuration register. Signed-off-by: Wei Wang <wei.w.w...@intel.com> Sign

Re: [vhost:vhost 20/20] ERROR: "page_poisoning_enabled" [drivers/virtio/virtio_balloon.ko] undefined!

2018-02-06 Thread Wei Wang
On 02/07/2018 09:26 AM, kbuild test robot wrote: tree: https://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git vhost head: 96bcd04462b99e2c80e09f6537770a0ca6b288d0 commit: 96bcd04462b99e2c80e09f6537770a0ca6b288d0 [20/20] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT config:

[PATCH v26 1/2] mm: support reporting free page blocks

2018-02-04 Thread Wei Wang
ges but are written after the report function returns will be captured by the hypervisor, and they will be added to the next round of memory transfer. Signed-off-by: Wei Wang <wei.w.w...@intel.com> Signed-off-by: Liang Li <liang.z...@intel.com> Cc: Michal Hocko <mho...@kernel.org> C

[PATCH v26 2/2] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT

2018-02-04 Thread Wei Wang
sending the starting cmd id, so the guest doesn't need to kick after filling an element to the vq. Host may also requests the guest to stop the reporting in advance by sending the stop cmd id to the guest via the configuration register. Signed-off-by: Wei Wang <wei.w.w...@intel.com> Sign

[PATCH v26 0/2] Virtio-balloon: support free page reporting

2018-02-04 Thread Wei Wang
(vb->balloon_wq); v21->v22: - add_one_sg: some code and comment re-arrangement - send_cmd_id: handle a cornercase For previous ChangeLog, please reference https://lwn.net/Articles/743660/ Wei Wang (2): mm: support reporting free page blocks virtio-balloon

Re: [PATCH v25 0/2] Virtio-balloon: support free page reporting

2018-02-02 Thread Wei Wang
On 02/02/2018 03:15 AM, Michael S. Tsirkin wrote: On Thu, Jan 25, 2018 at 05:14:04PM +0800, Wei Wang wrote: This patch series is separated from the previous "Virtio-balloon Enhancement" series. The new feature, VIRTIO_BALLOON_F_FREE_PAGE_HINT, implemented by this series enables

Re: [virtio-dev] Re: [PATCH v25 2/2] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT

2018-02-01 Thread Wei Wang
On 01/31/2018 07:44 AM, Michael S. Tsirkin wrote: On Fri, Jan 26, 2018 at 11:31:19AM +0800, Wei Wang wrote: On 01/26/2018 10:42 AM, Michael S. Tsirkin wrote: On Fri, Jan 26, 2018 at 09:40:44AM +0800, Wei Wang wrote: On 01/25/2018 09:49 PM, Michael S. Tsirkin wrote: On Thu, Jan 25, 2018 at 05

Re: [virtio-dev] Re: [PATCH v25 2/2] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT

2018-01-25 Thread Wei Wang
On 01/26/2018 10:42 AM, Michael S. Tsirkin wrote: On Fri, Jan 26, 2018 at 09:40:44AM +0800, Wei Wang wrote: On 01/25/2018 09:49 PM, Michael S. Tsirkin wrote: On Thu, Jan 25, 2018 at 05:14:06PM +0800, Wei Wang wrote: The controversy is that the free list is not static once the lock

Re: [PATCH v24 1/2] mm: support reporting free page blocks

2018-01-25 Thread Wei Wang
On 01/25/2018 09:41 PM, Michael S. Tsirkin wrote: On Wed, Jan 24, 2018 at 06:42:41PM +0800, Wei Wang wrote: This patch adds support to walk through the free page blocks in the system and report them via a callback function. Some page blocks may leave the free list after zone->lock is relea

Re: [PATCH v25 1/2 RESEND] mm: support reporting free page blocks

2018-01-25 Thread Wei Wang
On 01/26/2018 06:41 AM, Andrew Morton wrote: On Thu, 25 Jan 2018 17:38:27 +0800 Wei Wang <wei.w.w...@intel.com> wrote: This patch adds support to walk through the free page blocks in the system and report them via a callback function. Some page blocks may leave the free list after zone

Re: [PATCH v24 2/2] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT

2018-01-25 Thread Wei Wang
On 01/25/2018 07:28 PM, Tetsuo Handa wrote: On 2018/01/25 12:32, Wei Wang wrote: On 01/25/2018 01:15 AM, Michael S. Tsirkin wrote: On Wed, Jan 24, 2018 at 06:42:42PM +0800, Wei Wang wrote: + +static void report_free_page_func(struct work_struct *work) +{ +struct virtio_balloon *vb

Re: [virtio-dev] [PATCH v25 1/2 RESEND] mm: support reporting free page blocks

2018-01-25 Thread Wei Wang
Hi Michal, On 01/25/2018 05:38 PM, Wei Wang wrote: This patch adds support to walk through the free page blocks in the system and report them via a callback function. Some page blocks may leave the free list after zone->lock is released, so it is the caller's responsibility to either det

[PATCH v25 1/2 RESEND] mm: support reporting free page blocks

2018-01-25 Thread Wei Wang
ges but are written after the report function returns will be captured by the hypervisor, and they will be added to the next round of memory transfer. Signed-off-by: Wei Wang <wei.w.w...@intel.com> Signed-off-by: Liang Li <liang.z...@intel.com> Cc: Michal Hocko <mho...@kernel.org> C

Re: [PATCH v24 2/2] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT

2018-01-25 Thread Wei Wang
On 01/25/2018 01:15 AM, Michael S. Tsirkin wrote: On Wed, Jan 24, 2018 at 06:42:42PM +0800, Wei Wang wrote: What is this doing? Basically handling the case where vq is broken? It's kind of ugly to tweak feature bits, most code assumes they never change. Please just return an error

[PATCH v25 0/2] Virtio-balloon: support free page reporting

2018-01-25 Thread Wei Wang
implementation; - add destroy_workqueue(vb->balloon_wq); v21->v22: - add_one_sg: some code and comment re-arrangement - send_cmd_id: handle a cornercase For previous ChangeLog, please reference https://lwn.net/Articles/743660/ Wei Wang (2): mm: support reporting free page

[PATCH v25 2/2] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT

2018-01-25 Thread Wei Wang
the reporting in advance by sending the stop cmd id to the guest via the configuration register. Signed-off-by: Wei Wang <wei.w.w...@intel.com> Signed-off-by: Liang Li <liang.z...@intel.com> Cc: Michael S. Tsirkin <m...@redhat.com> Cc: Michal Hocko <mho...@kernel.org

[PATCH v25 1/2] mm: support reporting free page blocks

2018-01-25 Thread Wei Wang
ges but are written after the report function returns will be captured by the hypervisor, and they will be added to the next round of memory transfer. Signed-off-by: Wei Wang <wei.w.w...@intel.com> Signed-off-by: Liang Li <liang.z...@intel.com> Cc: Michal Hocko <mho...@kernel.org> C

Re: [PATCH v24 2/2] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT

2018-01-24 Thread Wei Wang
On 01/25/2018 01:15 AM, Michael S. Tsirkin wrote: On Wed, Jan 24, 2018 at 06:42:42PM +0800, Wei Wang wrote: + +static void report_free_page_func(struct work_struct *work) +{ + struct virtio_balloon *vb; + unsigned long flags; + + vb = container_of(work, struct virtio_balloon

Re: [virtio-dev] Re: [PATCH v22 2/3] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_VQ

2018-01-24 Thread Wei Wang
On 01/24/2018 12:29 PM, Michael S. Tsirkin wrote: On Mon, Jan 22, 2018 at 07:25:45PM +0800, Wei Wang wrote: On 01/19/2018 08:39 PM, Michael S. Tsirkin wrote: On Fri, Jan 19, 2018 at 11:44:21AM +0800, Wei Wang wrote: On 01/18/2018 12:44 AM, Michael S. Tsirkin wrote: On Wed, Jan 17, 2018 at 01

[PATCH v24 2/2] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT

2018-01-24 Thread Wei Wang
the reporting in advance by sending the stop cmd id to the guest via the configuration register. Signed-off-by: Wei Wang <wei.w.w...@intel.com> Signed-off-by: Liang Li <liang.z...@intel.com> Cc: Michael S. Tsirkin <m...@redhat.com> Cc: Michal Hocko <mho...@kernel.org

[PATCH v24 0/2] Virtio-balloon: support free page reporting

2018-01-24 Thread Wei Wang
to have simpler implementation; - add destroy_workqueue(vb->balloon_wq); v21->v22: - add_one_sg: some code and comment re-arrangement - send_cmd_id: handle a cornercase For previous ChangeLog, please reference https://lwn.net/Articles/743660/

[PATCH v24 1/2] mm: support reporting free page blocks

2018-01-24 Thread Wei Wang
ges but are written after the report function returns will be captured by the hypervisor, and they will be added to the next round of memory transfer. Signed-off-by: Wei Wang <wei.w.w...@intel.com> Signed-off-by: Liang Li <liang.z...@intel.com> Cc: Michal Hocko <mho...@kernel.org> C

Re: [PATCH v23 2/2] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_VQ

2018-01-23 Thread Wei Wang
On 01/24/2018 01:01 PM, Michael S. Tsirkin wrote: On Wed, Jan 24, 2018 at 10:50:27AM +0800, Wei Wang wrote: This will not DTRT in all cases. It's quite possible that host does not need the kick when ring is half full but does need it later when ring is full. You can kick at ring half full

Re: [virtio-dev] Re: [PATCH v22 2/3] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_VQ

2018-01-23 Thread Wei Wang
On 01/22/2018 07:25 PM, Wei Wang wrote: On 01/19/2018 08:39 PM, Michael S. Tsirkin wrote: On Fri, Jan 19, 2018 at 11:44:21AM +0800, Wei Wang wrote: On 01/18/2018 12:44 AM, Michael S. Tsirkin wrote: On Wed, Jan 17, 2018 at 01:10:11PM +0800, Wei Wang wrote: +vb->start_cmd_id = cmd

[PATCH v23 2/2] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_VQ

2018-01-23 Thread Wei Wang
the reporting in advance by sending the stop cmd id to the guest via the configuration register. Signed-off-by: Wei Wang <wei.w.w...@intel.com> Signed-off-by: Liang Li <liang.z...@intel.com> Cc: Michael S. Tsirkin <m...@redhat.com> Cc: Michal Hocko <mho...@kernel.org

[PATCH v23 0/2] Virtio-balloon: support free page reporting

2018-01-23 Thread Wei Wang
add_one_sg: some code and comment re-arrangement - send_cmd_id: handle a cornercase For previous ChangeLog, please reference https://lwn.net/Articles/743660/ Wei Wang (2): mm: support reporting free page blocks virtio-balloon: VIRTIO_BALLOON_F_FREE_PA

[PATCH v23 1/2] mm: support reporting free page blocks

2018-01-23 Thread Wei Wang
ges but are written after the report function returns will be captured by the hypervisor, and they will be added to the next round of memory transfer. Signed-off-by: Wei Wang <wei.w.w...@intel.com> Signed-off-by: Liang Li <liang.z...@intel.com> Cc: Michal Hocko <mho...@kernel.org> C

Re: [virtio-dev] Re: [PATCH v22 2/3] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_VQ

2018-01-22 Thread Wei Wang
On 01/19/2018 08:39 PM, Michael S. Tsirkin wrote: On Fri, Jan 19, 2018 at 11:44:21AM +0800, Wei Wang wrote: On 01/18/2018 12:44 AM, Michael S. Tsirkin wrote: On Wed, Jan 17, 2018 at 01:10:11PM +0800, Wei Wang wrote: + vb->start_cmd_id = cmd_id; + queue_work

Re: [PATCH v22 2/3] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_VQ

2018-01-18 Thread Wei Wang
On 01/18/2018 12:44 AM, Michael S. Tsirkin wrote: On Wed, Jan 17, 2018 at 01:10:11PM +0800, Wei Wang wrote: +static void virtballoon_changed(struct virtio_device *vdev) +{ + struct virtio_balloon *vb = vdev->priv; + unsigned long flags; + __u32 cmd_id; + s64 d

Re: [PATCH v22 2/3] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_VQ

2018-01-18 Thread Wei Wang
On 01/18/2018 12:44 AM, Michael S. Tsirkin wrote: On Wed, Jan 17, 2018 at 01:10:11PM +0800, Wei Wang wrote: +{ + struct scatterlist sg; + unsigned int unused; + int err; + + sg_init_one(, addr, sizeof(uint32_t)); This passes a guest-endian value to host

Re: [PATCH v22 2/3] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_VQ

2018-01-17 Thread Wei Wang
. Host may also requests the guest to stop the reporting in advance by sending the stop cmd id to the guest via the configuration register. Signed-off-by: Wei Wang <wei.w.w...@intel.com> Signed-off-by: Liang Li <liang.z...@intel.com> Cc: Michael S. Tsirkin <m...@redhat.com> Cc:

[PATCH v22 3/3] virtio-balloon: don't report free pages when page poisoning is enabled

2018-01-16 Thread Wei Wang
adds a config field, poison_val. Guest writes to the config field to tell the host about the poisoning value. The value will be 0 in the following cases: 1) PAGE_POISONING_NO_SANITY is enabled; 2) page poisoning is disabled; or 3) PAGE_POISONING_ZERO is enabled. Signed-off-by: Wei Wang <wei.

[PATCH v22 2/3] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_VQ

2018-01-16 Thread Wei Wang
the reporting in advance by sending the stop cmd id to the guest via the configuration register. Signed-off-by: Wei Wang <wei.w.w...@intel.com> Signed-off-by: Liang Li <liang.z...@intel.com> Cc: Michael S. Tsirkin <m...@redhat.com> Cc: Michal Hocko <mho...@kernel.org

[PATCH v22 1/3] mm: support reporting free page blocks

2018-01-16 Thread Wei Wang
ges but are written after the report function returns will be captured by the hypervisor, and they will be added to the next round of memory transfer. Signed-off-by: Wei Wang <wei.w.w...@intel.com> Signed-off-by: Liang Li <liang.z...@intel.com> Cc: Michal Hocko <mho...@kernel.org> C

[PATCH v22 0/3] Virtio-balloon: support free page reporting

2018-01-16 Thread Wei Wang
nd comment re-arrangement - send_cmd_id: handle a cornercase For precious ChangeLog, please reference https://lwn.net/Articles/743660/ Wei Wang (3): mm: support reporting free page blocks virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_VQ virtio-balloon: don't report free pages when page

Re: [PATCH v21 2/5 RESEND] virtio-balloon: VIRTIO_BALLOON_F_SG

2018-01-12 Thread Wei Wang
On 01/11/2018 07:06 PM, Tetsuo Handa wrote: Wei Wang wrote: Michael, could we merge patch 3-5 first? No! I'm repeatedly asking you to propose only VIRTIO_BALLOON_F_SG changes. Please don't ignore me. Patch 4 depends on patch 2. Thus, back to patch 2. There is not strict dependence per se

Re: [PATCH v21 2/5 RESEND] virtio-balloon: VIRTIO_BALLOON_F_SG

2018-01-10 Thread Wei Wang
On 01/09/2018 10:42 PM, Tetsuo Handa wrote: Wei Wang wrote: - enable OOM to free inflated pages maintained in the local temporary list. I do want to see it before applying this patch. Fine, then what do you think of the method I shared in your post here: https://patchwork.kernel.org

[PATCH v21 2/5 RESEND] virtio-balloon: VIRTIO_BALLOON_F_SG

2018-01-09 Thread Wei Wang
OOM to free inflated pages maintained in the local temporary list. Signed-off-by: Wei Wang <wei.w.w...@intel.com> Signed-off-by: Liang Li <liang.z...@intel.com> Suggested-by: Michael S. Tsirkin <m...@redhat.com> Cc: Tetsuo Handa <penguin-ker...@i-love.sakura.ne.jp

[PATCH v21 5/5] virtio-balloon: don't report free pages when page poisoning is enabled

2018-01-09 Thread Wei Wang
adds a config field, poison_val. Guest writes to the config field to tell the host about the poisoning value. The value will be 0 in the following cases: 1) PAGE_POISONING_NO_SANITY is enabled; 2) page poisoning is disabled; or 3) PAGE_POISONING_ZERO is enabled. Signed-off-by: Wei Wang <wei.

[PATCH v21 4/5] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_VQ

2018-01-09 Thread Wei Wang
the reporting in advance by sending the stop cmd id to the guest via the configuration register. Signed-off-by: Wei Wang <wei.w.w...@intel.com> Signed-off-by: Liang Li <liang.z...@intel.com> Cc: Michael S. Tsirkin <m...@redhat.com> Cc: Michal Hocko <mho...@kernel.org

[PATCH v21 3/5] mm: support reporting free page blocks

2018-01-09 Thread Wei Wang
ges but are written after the report function returns will be captured by the hypervisor, and they will be added to the next round of memory transfer. Signed-off-by: Wei Wang <wei.w.w...@intel.com> Signed-off-by: Liang Li <liang.z...@intel.com> Cc: Michal Hocko <mho...@kernel.org> C

[PATCH v21 0/5] Virtio-balloon Enhancement

2018-01-09 Thread Wei Wang
e-write the virtio-balloon implementation patch. 3) commit changes 4) patch re-org Matthew Wilcox (1): xbitmap: Introduce xbitmap Wei Wang (4): virtio-balloon: VIRTIO_BALLOON_F_SG mm: support reporting free page blocks virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_VQ virtio-balloo

[PATCH v21 2/5] virtio-balloon: VIRTIO_BALLOON_F_SG

2018-01-09 Thread Wei Wang
OOM to free inflated pages maintained in the local temporary list. Signed-off-by: Wei Wang <wei.w.w...@intel.com> Signed-off-by: Liang Li <liang.z...@intel.com> Suggested-by: Michael S. Tsirkin <m...@redhat.com> Cc: Tetsuo Handa <penguin-ker...@i-love.sakura.ne.jp

[PATCH v21 1/5] xbitmap: Introduce xbitmap

2018-01-09 Thread Wei Wang
From: Matthew Wilcox <mawil...@microsoft.com> The eXtensible Bitmap is a sparse bitmap representation which is efficient for set bits which tend to cluster. It supports up to 'unsigned long' worth of bits. Signed-off-by: Matthew Wilcox <mawil...@microsoft.com> Signed-off-by: Wei W

Re: [PATCH v20 4/7] virtio-balloon: VIRTIO_BALLOON_F_SG

2018-01-03 Thread Wei Wang
On 01/03/2018 10:29 AM, Tetsuo Handa wrote: Matthew Wilcox wrote: The radix tree convention is objectively awful, which is why I'm working to change it. Specifying the GFP flags at radix tree initialisation time rather than allocation time leads to all kinds of confusion. The preload API is a

Re: [PATCH v20 3/7 RESEND] xbitmap: add more operations

2018-01-03 Thread Wei Wang
On 01/02/2018 10:09 PM, Matthew Wilcox wrote: On Fri, Dec 22, 2017 at 04:49:11PM +0800, Wei Wang wrote: Thanks for the improvement. I also found a small bug in xb_zero. With the following changes, it has passed the current test cases and tested with the virtio-balloon usage without any issue

Re: [PATCH v20 4/7] virtio-balloon: VIRTIO_BALLOON_F_SG

2017-12-26 Thread Wei Wang
On 12/26/2017 06:38 PM, Tetsuo Handa wrote: Wei Wang wrote: On 12/25/2017 10:51 PM, Tetsuo Handa wrote: Wei Wang wrote: What we are doing here is to free the pages that were just allocated in this round of inflating. Next round will be sometime later when the balloon work item gets its turn

Re: [virtio-dev] Re: [PATCH v20 4/7] virtio-balloon: VIRTIO_BALLOON_F_SG

2017-12-24 Thread Wei Wang
On 12/24/2017 03:42 PM, Wei Wang wrote: On 12/24/2017 12:45 PM, Tetsuo Handa wrote: Matthew Wilcox wrote: +unsigned long pfn = page_to_pfn(page); +int ret; + +*pfn_min = min(pfn, *pfn_min); +*pfn_max = max(pfn, *pfn_max); + +do { +if (xb_preload(GFP_NOWAIT

Re: [PATCH v20 4/7] virtio-balloon: VIRTIO_BALLOON_F_SG

2017-12-23 Thread Wei Wang
On 12/24/2017 12:45 PM, Tetsuo Handa wrote: Matthew Wilcox wrote: + unsigned long pfn = page_to_pfn(page); + int ret; + + *pfn_min = min(pfn, *pfn_min); + *pfn_max = max(pfn, *pfn_max); + + do { + if (xb_preload(GFP_NOWAIT | __GFP_NOWARN) < 0) +

Re: [PATCH v20 3/7 RESEND] xbitmap: add more operations

2017-12-23 Thread Wei Wang
On 12/23/2017 10:33 PM, Tetsuo Handa wrote: + bitmap = rcu_dereference_raw(*slot); + if (!bitmap) { + bitmap = this_cpu_xchg(ida_bitmap, NULL); + if (!bitmap) + return -ENOMEM; I can't understand this. I can understand if it were

Re: [PATCH v20 3/7 RESEND] xbitmap: add more operations

2017-12-22 Thread Wei Wang
On 12/22/2017 05:03 AM, Matthew Wilcox wrote: OK, here's a rewrite of xbitmap. Compared to the version you sent: - xb_find_set() is the rewrite I sent out yesterday. - xb_find_clear() is a new implementation. I use the IDR_FREE tag to find clear bits. This led to me finding a bug in

Re: [PATCH v20 3/7 RESEND] xbitmap: add more operations

2017-12-22 Thread Wei Wang
On 12/21/2017 10:37 PM, Tetsuo Handa wrote: Matthew Wilcox wrote: +/** + * xb_find_set - find the next set bit in a range of bits + * @xb: the xbitmap to search from + * @offset: the offset in the range to start searching + * @size: the size of the range + * + * Returns: the found bit or, @size

Re: [PATCH v20 0/7] Virtio-balloon Enhancement

2017-12-20 Thread Wei Wang
On 12/21/2017 01:10 AM, Matthew Wilcox wrote: On Wed, Dec 20, 2017 at 04:13:16PM +, Wang, Wei W wrote: On Wednesday, December 20, 2017 8:26 PM, Matthew Wilcox wrote: unsigned long bit; xb_preload(GFP_KERNEL); xb_set_bit(xb, 700); xb_preload_end();

Re: [PATCH v20 0/7] Virtio-balloon Enhancement

2017-12-20 Thread Wei Wang
On 12/19/2017 10:05 PM, Tetsuo Handa wrote: Wei Wang wrote: ChangeLog: v19->v20: 1) patch 1: xbitmap - add __rcu to "void **slot"; - remove the exceptional path. 2) patch 3: xbitmap - DeveloperNotes: add an item to comment that the current bit range

[PATCH v20 7/7] virtio-balloon: don't report free pages when page poisoning is enabled

2017-12-19 Thread Wei Wang
adds a config field, poison_val. Guest writes to the config field to tell the host about the poisoning value. The value will be 0 in the following cases: 1) PAGE_POISONING_NO_SANITY is enabled; 2) page poisoning is disabled; or 3) PAGE_POISONING_ZERO is enabled. Signed-off-by: Wei Wang <wei.

[PATCH v20 6/7] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_VQ

2017-12-19 Thread Wei Wang
the reporting in advance by sending the stop cmd id to the guest via the configuration register. Signed-off-by: Wei Wang <wei.w.w...@intel.com> Signed-off-by: Liang Li <liang.z...@intel.com> Cc: Michael S. Tsirkin <m...@redhat.com> Cc: Michal Hocko <mho...@kernel.org

[PATCH v20 5/7] mm: support reporting free page blocks

2017-12-19 Thread Wei Wang
ges but are written after the report function returns will be captured by the hypervisor, and they will be added to the next round of memory transfer. Signed-off-by: Wei Wang <wei.w.w...@intel.com> Signed-off-by: Liang Li <liang.z...@intel.com> Cc: Michal Hocko <mho...@kernel.org> C

[PATCH v20 3/7] xbitmap: add more operations

2017-12-19 Thread Wei Wang
to help searching. Signed-off-by: Wei Wang <wei.w.w...@intel.com> Cc: Matthew Wilcox <mawil...@microsoft.com> Cc: Andrew Morton <a...@linux-foundation.org> Cc: Michal Hocko <mho...@kernel.org> Cc: Michael S. Tsirkin <m...@redhat.com> Cc: Tetsuo Handa <penguin-ker.

[PATCH v20 4/7] virtio-balloon: VIRTIO_BALLOON_F_SG

2017-12-19 Thread Wei Wang
-by: Wei Wang <wei.w.w...@intel.com> Signed-off-by: Liang Li <liang.z...@intel.com> Suggested-by: Michael S. Tsirkin <m...@redhat.com> Cc: Tetsuo Handa <penguin-ker...@i-love.sakura.ne.jp> --- drivers/virtio/virtio_balloon.c | 234

[PATCH v20 1/7] xbitmap: Introduce xbitmap

2017-12-19 Thread Wei Wang
st_bit(). Signed-off-by: Wei Wang <wei.w.w...@intel.com> Cc: Matthew Wilcox <mawil...@microsoft.com> Cc: Andrew Morton <a...@linux-foundation.org> Cc: Michal Hocko <mho...@kernel.org> Cc: Michael S. Tsirkin <m...@redhat.com> Cc: Tetsuo Handa <penguin-ker...@i-love.sakura

[PATCH v20 0/7] Virtio-balloon Enhancement

2017-12-19 Thread Wei Wang
e-write the virtio-balloon implementation patch. 3) commit changes 4) patch re-org Matthew Wilcox (1): xbitmap: Introduce xbitmap Wei Wang (6): xbitmap: potential improvement xbitmap: add more operations virtio-balloon: VIRTIO_BALLOON_F_SG mm: support reporting free page blocks virtio-ba

[PATCH v20 2/7] xbitmap: potential improvement

2017-12-19 Thread Wei Wang
there, this will be a problem when inserting a node to the tree later. This patch moves __radix_tree_preload() after kmalloc() and returns a boolean to indicate the success or failure. Also, add the __must_check annotation to xb_preload for prudence purpose. Signed-off-by: Wei Wang <wei.w.w...@intel.com&

Re: [PATCH v19 3/7] xbitmap: add more operations

2017-12-18 Thread Wei Wang
On 12/17/2017 11:16 PM, Tetsuo Handa wrote: Wang, Wei W wrote: Wei Wang wrote: But passing GFP_NOWAIT means that we can handle allocation failure. There is no need to use preload approach when we can handle allocation failure. I think the reason we need xb_preload is because radix tree

<    1   2   3   4   5   >