search for: cmd_id_use

Displaying 20 results from an estimated 37 matches for "cmd_id_use".

2018 Apr 03
2
[PATCH v30 2/4] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT
...struct work_struct update_balloon_stats_work; > @@ -63,6 +76,13 @@ struct virtio_balloon { > spinlock_t stop_update_lock; > bool stop_update; > > + /* The new cmd id received from host */ > + uint32_t cmd_id_received; > + /* The cmd id that is in use */ > + __virtio32 cmd_id_use; > + /* Buffer to store the stop sign */ > + __virtio32 stop_cmd_id; > + > /* Waiting for host to ack the pages we released. */ > wait_queue_head_t acked; > > @@ -320,17 +340,6 @@ static void stats_handle_request(struct virtio_balloon *vb) > virtqueue_kick(vq); >...
2018 Apr 03
2
[PATCH v30 2/4] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT
...struct work_struct update_balloon_stats_work; > @@ -63,6 +76,13 @@ struct virtio_balloon { > spinlock_t stop_update_lock; > bool stop_update; > > + /* The new cmd id received from host */ > + uint32_t cmd_id_received; > + /* The cmd id that is in use */ > + __virtio32 cmd_id_use; > + /* Buffer to store the stop sign */ > + __virtio32 stop_cmd_id; > + > /* Waiting for host to ack the pages we released. */ > wait_queue_head_t acked; > > @@ -320,17 +340,6 @@ static void stats_handle_request(struct virtio_balloon *vb) > virtqueue_kick(vq); >...
2018 Apr 04
0
[PATCH v30 2/4] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT
...aque; >> + uint32_t len = nr_pages << PAGE_SHIFT; >> + >> + /* >> + * If a stop id or a new cmd id was just received from host, stop >> + * the reporting, and return 1 to indicate an active stop. >> + */ >> + if (virtio32_to_cpu(vb->vdev, vb->cmd_id_use) != vb->cmd_id_received) >> + return 1; >> + > this access to cmd_id_use and cmd_id_received without locks > bothers me. Pls document why it's safe. OK. Probably we could add below to the above comments: cmd_id_use and cmd_id_received don't need to be accessed under...
2018 Apr 04
2
[PATCH v30 2/4] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT
...ages << PAGE_SHIFT; > > > + > > > + /* > > > + * If a stop id or a new cmd id was just received from host, stop > > > + * the reporting, and return 1 to indicate an active stop. > > > + */ > > > + if (virtio32_to_cpu(vb->vdev, vb->cmd_id_use) != vb->cmd_id_received) > > > + return 1; functions returning int should return 0 or -errno on failure, positive return code should indicate progress. If you want a boolean, use bool pls. > > > + > > this access to cmd_id_use and cmd_id_received without locks > &...
2018 Apr 04
2
[PATCH v30 2/4] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT
...ages << PAGE_SHIFT; > > > + > > > + /* > > > + * If a stop id or a new cmd id was just received from host, stop > > > + * the reporting, and return 1 to indicate an active stop. > > > + */ > > > + if (virtio32_to_cpu(vb->vdev, vb->cmd_id_use) != vb->cmd_id_received) > > > + return 1; functions returning int should return 0 or -errno on failure, positive return code should indicate progress. If you want a boolean, use bool pls. > > > + > > this access to cmd_id_use and cmd_id_received without locks > &...
2018 Apr 05
2
[PATCH v30 2/4] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT
...t; > > > + /* > > > > > + * If a stop id or a new cmd id was just received from host, stop > > > > > + * the reporting, and return 1 to indicate an active stop. > > > > > + */ > > > > > + if (virtio32_to_cpu(vb->vdev, vb->cmd_id_use) != vb- > > >cmd_id_received) > > > > > + return 1; > > > > functions returning int should return 0 or -errno on failure, positive return > > code should indicate progress. > > > > If you want a boolean, use bool pls. > > OK. I plan to...
2018 Apr 05
2
[PATCH v30 2/4] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT
...t; > > > + /* > > > > > + * If a stop id or a new cmd id was just received from host, stop > > > > > + * the reporting, and return 1 to indicate an active stop. > > > > > + */ > > > > > + if (virtio32_to_cpu(vb->vdev, vb->cmd_id_use) != vb- > > >cmd_id_received) > > > > > + return 1; > > > > functions returning int should return 0 or -errno on failure, positive return > > code should indicate progress. > > > > If you want a boolean, use bool pls. > > OK. I plan to...
2018 Apr 03
0
[PATCH v30 2/4] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT
...delegated to a freezable workqueue. */ struct work_struct update_balloon_stats_work; @@ -63,6 +76,13 @@ struct virtio_balloon { spinlock_t stop_update_lock; bool stop_update; + /* The new cmd id received from host */ + uint32_t cmd_id_received; + /* The cmd id that is in use */ + __virtio32 cmd_id_use; + /* Buffer to store the stop sign */ + __virtio32 stop_cmd_id; + /* Waiting for host to ack the pages we released. */ wait_queue_head_t acked; @@ -320,17 +340,6 @@ static void stats_handle_request(struct virtio_balloon *vb) virtqueue_kick(vq); } -static void virtballoon_changed(struct...
2018 Apr 03
5
[PATCH v30 0/4] Virtio-balloon: support free page reporting
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 the virtio-balloon driver to report hints of guest free pages to the host. It can be used to accelerate live migration of VMs. Here is an introduction of this usage: Live migration needs to transfer the VM's
2018 Feb 07
2
[PATCH v26 2/2 RESEND] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT
...delegated to a freezable workqueue. */ struct work_struct update_balloon_stats_work; @@ -63,6 +76,11 @@ struct virtio_balloon { spinlock_t stop_update_lock; bool stop_update; + /* The new cmd id received from host */ + uint32_t cmd_id_received; + /* The cmd id that is in use */ + __virtio32 cmd_id_use; + /* Waiting for host to ack the pages we released. */ wait_queue_head_t acked; @@ -316,17 +334,6 @@ static void stats_handle_request(struct virtio_balloon *vb) virtqueue_kick(vq); } -static void virtballoon_changed(struct virtio_device *vdev) -{ - struct virtio_balloon *vb = vdev->p...
2018 Feb 07
2
[PATCH v26 2/2 RESEND] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT
...delegated to a freezable workqueue. */ struct work_struct update_balloon_stats_work; @@ -63,6 +76,11 @@ struct virtio_balloon { spinlock_t stop_update_lock; bool stop_update; + /* The new cmd id received from host */ + uint32_t cmd_id_received; + /* The cmd id that is in use */ + __virtio32 cmd_id_use; + /* Waiting for host to ack the pages we released. */ wait_queue_head_t acked; @@ -316,17 +334,6 @@ static void stats_handle_request(struct virtio_balloon *vb) virtqueue_kick(vq); } -static void virtballoon_changed(struct virtio_device *vdev) -{ - struct virtio_balloon *vb = vdev->p...
2018 Jan 25
0
[PATCH v25 2/2] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT
...delegated to a freezable workqueue. */ struct work_struct update_balloon_stats_work; @@ -63,6 +76,11 @@ struct virtio_balloon { spinlock_t stop_update_lock; bool stop_update; + /* The new cmd id received from host */ + uint32_t cmd_id_received; + /* The cmd id that is in use */ + __virtio32 cmd_id_use; + /* Waiting for host to ack the pages we released. */ wait_queue_head_t acked; @@ -316,17 +334,6 @@ static void stats_handle_request(struct virtio_balloon *vb) virtqueue_kick(vq); } -static void virtballoon_changed(struct virtio_device *vdev) -{ - struct virtio_balloon *vb = vdev->p...
2018 Apr 05
0
[PATCH v30 2/4] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT
...> > > + > > > > + /* > > > > + * If a stop id or a new cmd id was just received from host, stop > > > > + * the reporting, and return 1 to indicate an active stop. > > > > + */ > > > > + if (virtio32_to_cpu(vb->vdev, vb->cmd_id_use) != vb- > >cmd_id_received) > > > > + return 1; > > functions returning int should return 0 or -errno on failure, positive return > code should indicate progress. > > If you want a boolean, use bool pls. OK. I plan to change 1 to -EBUSY to indicate the case tha...
2018 Apr 06
0
[PATCH v31 2/4] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT
...delegated to a freezable workqueue. */ struct work_struct update_balloon_stats_work; @@ -63,6 +76,13 @@ struct virtio_balloon { spinlock_t stop_update_lock; bool stop_update; + /* The new cmd id received from host */ + uint32_t cmd_id_received; + /* The cmd id that is in use */ + __virtio32 cmd_id_use; + /* Buffer to store the stop sign */ + __virtio32 stop_cmd_id; + /* Waiting for host to ack the pages we released. */ wait_queue_head_t acked; @@ -320,17 +340,6 @@ static void stats_handle_request(struct virtio_balloon *vb) virtqueue_kick(vq); } -static void virtballoon_changed(struct...
2018 Feb 07
0
[PATCH v26 2/2 RESEND] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT
...struct work_struct update_balloon_stats_work; > @@ -63,6 +76,11 @@ struct virtio_balloon { > spinlock_t stop_update_lock; > bool stop_update; > > + /* The new cmd id received from host */ > + uint32_t cmd_id_received; > + /* The cmd id that is in use */ > + __virtio32 cmd_id_use; > + > /* Waiting for host to ack the pages we released. */ > wait_queue_head_t acked; > > @@ -316,17 +334,6 @@ static void stats_handle_request(struct virtio_balloon *vb) > virtqueue_kick(vq); > } > > -static void virtballoon_changed(struct virtio_device *vdev...
2018 Apr 09
1
[PATCH v31 2/4] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT
...struct work_struct update_balloon_stats_work; > @@ -63,6 +76,13 @@ struct virtio_balloon { > spinlock_t stop_update_lock; > bool stop_update; > > + /* The new cmd id received from host */ > + uint32_t cmd_id_received; > + /* The cmd id that is in use */ > + __virtio32 cmd_id_use; I'd prefer cmd_id_active but it's not critical. > + /* Buffer to store the stop sign */ > + __virtio32 stop_cmd_id; > + > /* Waiting for host to ack the pages we released. */ > wait_queue_head_t acked; > > @@ -320,17 +340,6 @@ static void stats_handle_request(s...
2018 Apr 05
2
[PATCH v30 2/4] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT
...t; I'm afraid the driver couldn't be aware if the added hints are stale > > > or not, > > > > > > No - I mean that driver has code that compares two values and stops > > reporting. Can one of the values be stale? > > The driver compares "vb->cmd_id_use != vb->cmd_id_received" to decide if it needs to stop reporting hints, and cmd_id_received is what the driver reads from host (host notifies the driver to read for the latest value). If host sends a new cmd id, it will notify the guest to read again. I'm not sure how that could be a sta...
2018 Apr 05
2
[PATCH v30 2/4] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT
...t; I'm afraid the driver couldn't be aware if the added hints are stale > > > or not, > > > > > > No - I mean that driver has code that compares two values and stops > > reporting. Can one of the values be stale? > > The driver compares "vb->cmd_id_use != vb->cmd_id_received" to decide if it needs to stop reporting hints, and cmd_id_received is what the driver reads from host (host notifies the driver to read for the latest value). If host sends a new cmd id, it will notify the guest to read again. I'm not sure how that could be a sta...
2018 Jan 25
2
[PATCH v25 2/2] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT
...struct work_struct update_balloon_stats_work; > @@ -63,6 +76,11 @@ struct virtio_balloon { > spinlock_t stop_update_lock; > bool stop_update; > > + /* The new cmd id received from host */ > + uint32_t cmd_id_received; > + /* The cmd id that is in use */ > + __virtio32 cmd_id_use; > + > /* Waiting for host to ack the pages we released. */ > wait_queue_head_t acked; > > @@ -316,17 +334,6 @@ static void stats_handle_request(struct virtio_balloon *vb) > virtqueue_kick(vq); > } > > -static void virtballoon_changed(struct virtio_device *vdev...
2018 Apr 06
5
[PATCH v31 0/4] Virtio-balloon: support free page reporting
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 the virtio-balloon driver to report hints of guest free pages to the host. It can be used to accelerate live migration of VMs. Here is an introduction of this usage: Live migration needs to transfer the VM's