Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1560954
| From | "Michael S. Tsirkin" <mst@redhat.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v6 kernel 3/5] virtio-balloon: speed up inflate/deflate process |
| Date | 2017-01-17 20:30 +0100 |
| Message-ID | <t0HCa-2BA-29@gated-at.bofh.it> (permalink) |
| References | <sQJ2x-8nk-3@gated-at.bofh.it> <sQJ2x-8nk-7@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Wed, Dec 21, 2016 at 02:52:26PM +0800, Liang Li wrote:
>
> - /* We should always be able to add one buffer to an empty queue. */
> - virtqueue_add_outbuf(vq, &sg, 1, vb, GFP_KERNEL);
> - virtqueue_kick(vq);
> +static void do_set_resp_bitmap(struct virtio_balloon *vb,
> + unsigned long base_pfn, int pages)
>
> - /* When host has read buffer, this completes via balloon_ack */
> - wait_event(vb->acked, virtqueue_get_buf(vq, &len));
> +{
> + __le64 *range = vb->resp_data + vb->resp_pos;
>
> + if (pages > (1 << VIRTIO_BALLOON_NR_PFN_BITS)) {
> + /* when the length field can't contain pages, set it to 0 to
/*
* Multi-line
* comments
* should look like this.
*/
Also, pls start sentences with an upper-case letter.
> + * indicate the actual length is in the next __le64;
> + */
This is part of the interface so should be documented as such.
> + *range = cpu_to_le64((base_pfn <<
> + VIRTIO_BALLOON_NR_PFN_BITS) | 0);
> + *(range + 1) = cpu_to_le64(pages);
> + vb->resp_pos += 2;
Pls use structs for this kind of stuff.
> + } else {
> + *range = (base_pfn << VIRTIO_BALLOON_NR_PFN_BITS) | pages;
> + vb->resp_pos++;
> + }
> +}
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
Re: [PATCH v6 kernel 3/5] virtio-balloon: speed up inflate/deflate process "Michael S. Tsirkin" <mst@redhat.com> - 2017-01-17 20:30 +0100
RE: [PATCH v6 kernel 3/5] virtio-balloon: speed up inflate/deflate process "Li, Liang Z" <liang.z.li@intel.com> - 2017-01-18 06:10 +0100
Re: [PATCH v6 kernel 3/5] virtio-balloon: speed up inflate/deflate process "Michael S. Tsirkin" <mst@redhat.com> - 2017-01-18 16:40 +0100
RE: [PATCH v6 kernel 3/5] virtio-balloon: speed up inflate/deflate process "Li, Liang Z" <liang.z.li@intel.com> - 2017-01-19 02:50 +0100
Re: [PATCH v6 kernel 3/5] virtio-balloon: speed up inflate/deflate process "Michael S. Tsirkin" <mst@redhat.com> - 2017-01-20 17:40 +0100
csiph-web