Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1563511
| From | "Dr. David Alan Gilbert" <dgilbert@redhat.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v6 kernel 3/5] virtio-balloon: speed up inflate/deflate process |
| Date | 2017-01-20 12:50 +0100 |
| Message-ID | <t1FRD-6IR-11@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 |
* Liang Li (liang.z.li@intel.com) wrote:
<snip>
> +static void free_extended_page_bitmap(struct virtio_balloon *vb)
> +{
> + int i, bmap_count = vb->nr_page_bmap;
> +
> + for (i = 1; i < bmap_count; i++) {
> + kfree(vb->page_bitmap[i]);
> + vb->page_bitmap[i] = NULL;
> + vb->nr_page_bmap--;
> + }
> +}
> +
> +static void kfree_page_bitmap(struct virtio_balloon *vb)
> +{
> + int i;
> +
> + for (i = 0; i < vb->nr_page_bmap; i++)
> + kfree(vb->page_bitmap[i]);
> +}
It might be worth commenting that pair of functions to make it clear
why they are so different; I guess the kfree_page_bitmap
is used just before you free the structure above it so you
don't need to keep the count/pointers updated?
Dave
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
Re: [PATCH v6 kernel 3/5] virtio-balloon: speed up inflate/deflate process "Dr. David Alan Gilbert" <dgilbert@redhat.com> - 2017-01-20 12:50 +0100
csiph-web