Displaying 16 results from an estimated 16 matches for "entries_per_array".
2018 Jun 27
2
[PATCH v34 2/4] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT
...mory is this allocating anyway?
> >
>
> For every 2TB memory that the guest has, we allocate 4MB.
Hmm I guess I'm missing something, I don't see it:
+ max_entries = max_free_page_blocks(ARRAY_ALLOC_ORDER);
+ entries_per_page = PAGE_SIZE / sizeof(__le64);
+ entries_per_array = entries_per_page * (1 << ARRAY_ALLOC_ORDER);
+ max_array_num = max_entries / entries_per_array +
+ !!(max_entries % entries_per_array);
Looks like you always allocate the max number?
> This is the same
> for both cases.
> For today's guests, usual...
2018 Jun 27
2
[PATCH v34 2/4] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT
...mory is this allocating anyway?
> >
>
> For every 2TB memory that the guest has, we allocate 4MB.
Hmm I guess I'm missing something, I don't see it:
+ max_entries = max_free_page_blocks(ARRAY_ALLOC_ORDER);
+ entries_per_page = PAGE_SIZE / sizeof(__le64);
+ entries_per_array = entries_per_page * (1 << ARRAY_ALLOC_ORDER);
+ max_array_num = max_entries / entries_per_array +
+ !!(max_entries % entries_per_array);
Looks like you always allocate the max number?
> This is the same
> for both cases.
> For today's guests, usual...
2018 Jun 27
2
[PATCH v34 2/4] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT
...very 2TB memory that the guest has, we allocate 4MB.
> > Hmm I guess I'm missing something, I don't see it:
> >
> >
> > + max_entries = max_free_page_blocks(ARRAY_ALLOC_ORDER);
> > + entries_per_page = PAGE_SIZE / sizeof(__le64);
> > + entries_per_array = entries_per_page * (1 << ARRAY_ALLOC_ORDER);
> > + max_array_num = max_entries / entries_per_array +
> > + !!(max_entries % entries_per_array);
> >
> > Looks like you always allocate the max number?
>
> Yes. We allocated the max nu...
2018 Jun 27
2
[PATCH v34 2/4] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT
...very 2TB memory that the guest has, we allocate 4MB.
> > Hmm I guess I'm missing something, I don't see it:
> >
> >
> > + max_entries = max_free_page_blocks(ARRAY_ALLOC_ORDER);
> > + entries_per_page = PAGE_SIZE / sizeof(__le64);
> > + entries_per_array = entries_per_page * (1 << ARRAY_ALLOC_ORDER);
> > + max_array_num = max_entries / entries_per_array +
> > + !!(max_entries % entries_per_array);
> >
> > Looks like you always allocate the max number?
>
> Yes. We allocated the max nu...
2018 Jun 25
0
[PATCH v34 2/4] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT
...ry that holds the addresses of the allocated
+ * arrays, or NULL if no arrays are allocated.
+ */
+static __le64 **virtio_balloon_load_hints(struct virtio_balloon *vb,
+ uint32_t *array_num,
+ uint32_t *last_array_hints)
+{
+ __le64 **arrays;
+ uint32_t max_entries, entries_per_page, entries_per_array,
+ max_array_num, loaded_hints;
+ int i;
+
+ max_entries = max_free_page_blocks(ARRAY_ALLOC_ORDER);
+ entries_per_page = PAGE_SIZE / sizeof(__le64);
+ entries_per_array = entries_per_page * (1 << ARRAY_ALLOC_ORDER);
+ max_array_num = max_entries / entries_per_array +
+ !!(max_entries % en...
2018 Jun 26
2
[PATCH v34 2/4] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT
...ated
> + * arrays, or NULL if no arrays are allocated.
> + */
> +static __le64 **virtio_balloon_load_hints(struct virtio_balloon *vb,
> + uint32_t *array_num,
> + uint32_t *last_array_hints)
> +{
> + __le64 **arrays;
> + uint32_t max_entries, entries_per_page, entries_per_array,
> + max_array_num, loaded_hints;
All above likely should be int.
> + int i;
> +
> + max_entries = max_free_page_blocks(ARRAY_ALLOC_ORDER);
> + entries_per_page = PAGE_SIZE / sizeof(__le64);
> + entries_per_array = entries_per_page * (1 << ARRAY_ALLOC_ORDER);
> + max_...
2018 Jun 26
2
[PATCH v34 2/4] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT
...ated
> + * arrays, or NULL if no arrays are allocated.
> + */
> +static __le64 **virtio_balloon_load_hints(struct virtio_balloon *vb,
> + uint32_t *array_num,
> + uint32_t *last_array_hints)
> +{
> + __le64 **arrays;
> + uint32_t max_entries, entries_per_page, entries_per_array,
> + max_array_num, loaded_hints;
All above likely should be int.
> + int i;
> +
> + max_entries = max_free_page_blocks(ARRAY_ALLOC_ORDER);
> + entries_per_page = PAGE_SIZE / sizeof(__le64);
> + entries_per_array = entries_per_page * (1 << ARRAY_ALLOC_ORDER);
> + max_...
2018 Jun 27
0
[PATCH v34 2/4] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT
...way?
>>>
>> For every 2TB memory that the guest has, we allocate 4MB.
> Hmm I guess I'm missing something, I don't see it:
>
>
> + max_entries = max_free_page_blocks(ARRAY_ALLOC_ORDER);
> + entries_per_page = PAGE_SIZE / sizeof(__le64);
> + entries_per_array = entries_per_page * (1 << ARRAY_ALLOC_ORDER);
> + max_array_num = max_entries / entries_per_array +
> + !!(max_entries % entries_per_array);
>
> Looks like you always allocate the max number?
Yes. We allocated the max number and then free what's n...
2018 Jun 27
0
[PATCH v34 2/4] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT
...that the guest has, we allocate 4MB.
>>> Hmm I guess I'm missing something, I don't see it:
>>>
>>>
>>> + max_entries = max_free_page_blocks(ARRAY_ALLOC_ORDER);
>>> + entries_per_page = PAGE_SIZE / sizeof(__le64);
>>> + entries_per_array = entries_per_page * (1 << ARRAY_ALLOC_ORDER);
>>> + max_array_num = max_entries / entries_per_array +
>>> + !!(max_entries % entries_per_array);
>>>
>>> Looks like you always allocate the max number?
>> Yes. We allocated t...
2018 Jun 26
2
[PATCH v34 2/4] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT
On Tue, Jun 26, 2018 at 08:27:44PM +0800, Wei Wang wrote:
> On 06/26/2018 11:56 AM, Michael S. Tsirkin wrote:
> > On Tue, Jun 26, 2018 at 11:46:35AM +0800, Wei Wang wrote:
> >
>
> > >
> > > >
> > > > > + if (!arrays)
> > > > > + return NULL;
> > > > > +
> > > > > + for (i = 0; i <
2018 Jun 26
2
[PATCH v34 2/4] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT
On Tue, Jun 26, 2018 at 08:27:44PM +0800, Wei Wang wrote:
> On 06/26/2018 11:56 AM, Michael S. Tsirkin wrote:
> > On Tue, Jun 26, 2018 at 11:46:35AM +0800, Wei Wang wrote:
> >
>
> > >
> > > >
> > > > > + if (!arrays)
> > > > > + return NULL;
> > > > > +
> > > > > + for (i = 0; i <
2018 Jun 25
9
[PATCH v34 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 Jun 25
9
[PATCH v34 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 Jun 26
0
[PATCH v34 2/4] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT
...the
report, and the host side optimization won't exit unless receiving this
stop sign or the migration thread asks to exit.
>
>> + int i;
>> +
>> + max_entries = max_free_page_blocks(ARRAY_ALLOC_ORDER);
>> + entries_per_page = PAGE_SIZE / sizeof(__le64);
>> + entries_per_array = entries_per_page * (1 << ARRAY_ALLOC_ORDER);
>> + max_array_num = max_entries / entries_per_array +
>> + !!(max_entries % entries_per_array);
>> + arrays = kmalloc_array(max_array_num, sizeof(__le64 *), GFP_KERNEL);
> Instead of all this mess, how about get_free_pages...
2018 Jun 26
2
[PATCH v34 2/4] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT
...ht want to sleep.
If it doesn't then it will disable notifications and kick will be free.
> >
> > > + int i;
> > > +
> > > + max_entries = max_free_page_blocks(ARRAY_ALLOC_ORDER);
> > > + entries_per_page = PAGE_SIZE / sizeof(__le64);
> > > + entries_per_array = entries_per_page * (1 << ARRAY_ALLOC_ORDER);
> > > + max_array_num = max_entries / entries_per_array +
> > > + !!(max_entries % entries_per_array);
> > > + arrays = kmalloc_array(max_array_num, sizeof(__le64 *), GFP_KERNEL);
> > Instead of all this mess, h...
2018 Jun 26
2
[PATCH v34 2/4] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT
...ht want to sleep.
If it doesn't then it will disable notifications and kick will be free.
> >
> > > + int i;
> > > +
> > > + max_entries = max_free_page_blocks(ARRAY_ALLOC_ORDER);
> > > + entries_per_page = PAGE_SIZE / sizeof(__le64);
> > > + entries_per_array = entries_per_page * (1 << ARRAY_ALLOC_ORDER);
> > > + max_array_num = max_entries / entries_per_array +
> > > + !!(max_entries % entries_per_array);
> > > + arrays = kmalloc_array(max_array_num, sizeof(__le64 *), GFP_KERNEL);
> > Instead of all this mess, h...