search for: max_array_num

Displaying 18 results from an estimated 18 matches for "max_array_num".

2018 Jun 27
2
[PATCH v34 2/4] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT
...wrote: > > > > On Tue, Jun 26, 2018 at 11:46:35AM +0800, Wei Wang wrote: > > > > > > > > > > > + if (!arrays) > > > > > > > + return NULL; > > > > > > > + > > > > > > > + for (i = 0; i < max_array_num; i++) { > > > > > > So we are getting a ton of memory here just to free it up a bit later. > > > > > > Why doesn't get_from_free_page_list get the pages from free list for us? > > > > > > We could also avoid the 1st allocation then - just bu...
2018 Jun 27
2
[PATCH v34 2/4] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT
...wrote: > > > > On Tue, Jun 26, 2018 at 11:46:35AM +0800, Wei Wang wrote: > > > > > > > > > > > + if (!arrays) > > > > > > > + return NULL; > > > > > > > + > > > > > > > + for (i = 0; i < max_array_num; i++) { > > > > > > So we are getting a ton of memory here just to free it up a bit later. > > > > > > Why doesn't get_from_free_page_list get the pages from free list for us? > > > > > > We could also avoid the 1st allocation then - just bu...
2018 Jun 27
2
[PATCH v34 2/4] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT
...11:46:35AM +0800, Wei Wang wrote: > > > > > > > > > > > > > > > + if (!arrays) > > > > > > > > > + return NULL; > > > > > > > > > + > > > > > > > > > + for (i = 0; i < max_array_num; i++) { > > > > > > > > So we are getting a ton of memory here just to free it up a bit later. > > > > > > > > Why doesn't get_from_free_page_list get the pages from free list for us? > > > > > > > > We could also avoid the...
2018 Jun 27
2
[PATCH v34 2/4] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT
...11:46:35AM +0800, Wei Wang wrote: > > > > > > > > > > > > > > > + if (!arrays) > > > > > > > > > + return NULL; > > > > > > > > > + > > > > > > > > > + for (i = 0; i < max_array_num; i++) { > > > > > > > > So we are getting a ton of memory here just to free it up a bit later. > > > > > > > > Why doesn't get_from_free_page_list get the pages from free list for us? > > > > > > > > We could also avoid the...
2018 Jun 26
2
[PATCH v34 2/4] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT
...L 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_array_num = max_entries...
2018 Jun 26
2
[PATCH v34 2/4] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT
...L 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_array_num = max_entries...
2018 Jun 26
2
[PATCH v34 2/4] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT
...chael S. Tsirkin wrote: > > On Tue, Jun 26, 2018 at 11:46:35AM +0800, Wei Wang wrote: > > > > > > > > > > > > > > > + if (!arrays) > > > > > + return NULL; > > > > > + > > > > > + for (i = 0; i < max_array_num; i++) { > > > > So we are getting a ton of memory here just to free it up a bit later. > > > > Why doesn't get_from_free_page_list get the pages from free list for us? > > > > We could also avoid the 1st allocation then - just build a list > > > >...
2018 Jun 26
2
[PATCH v34 2/4] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT
...chael S. Tsirkin wrote: > > On Tue, Jun 26, 2018 at 11:46:35AM +0800, Wei Wang wrote: > > > > > > > > > > > > > > > + if (!arrays) > > > > > + return NULL; > > > > > + > > > > > + for (i = 0; i < max_array_num; i++) { > > > > So we are getting a ton of memory here just to free it up a bit later. > > > > Why doesn't get_from_free_page_list get the pages from free list for us? > > > > We could also avoid the 1st allocation then - just build a list > > > >...
2018 Jun 26
2
[PATCH v34 2/4] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT
...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, how about get_free_pages here as well? > > Sounds good, will replace kmalloc_a...
2018 Jun 26
2
[PATCH v34 2/4] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT
...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, how about get_free_pages here as well? > > Sounds good, will replace kmalloc_a...
2018 Jun 27
0
[PATCH v34 2/4] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT
...sirkin wrote: >>>>> On Tue, Jun 26, 2018 at 11:46:35AM +0800, Wei Wang wrote: >>>>> >>>>>>>> + if (!arrays) >>>>>>>> + return NULL; >>>>>>>> + >>>>>>>> + for (i = 0; i < max_array_num; i++) { >>>>>>> So we are getting a ton of memory here just to free it up a bit later. >>>>>>> Why doesn't get_from_free_page_list get the pages from free list for us? >>>>>>> We could also avoid the 1st allocation then - just build...
2018 Jun 27
0
[PATCH v34 2/4] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT
...e, Jun 26, 2018 at 11:46:35AM +0800, Wei Wang wrote: >>>>>>> >>>>>>>>>> + if (!arrays) >>>>>>>>>> + return NULL; >>>>>>>>>> + >>>>>>>>>> + for (i = 0; i < max_array_num; i++) { >>>>>>>>> So we are getting a ton of memory here just to free it up a bit later. >>>>>>>>> Why doesn't get_from_free_page_list get the pages from free list for us? >>>>>>>>> We could also avoid the 1st allo...
2018 Jun 25
0
[PATCH v34 2/4] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT
...sses 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 % entries_per_array); +...
2018 Jun 26
0
[PATCH v34 2/4] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT
...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 here as well? Sounds good, will replace kmalloc_array with __get_free_pages(...
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
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 < max_array_num; i++) { >>> So we are getting a ton of memory here just to free it up a bit later. >>> Why doesn't get_from_free_page_list get the pages from free list for us? >>> We could also avoid the 1st allocation then - just build a list >>> of these. >> That wou...
2018 Jun 27
0
[PATCH v34 2/4] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT
...e: >> 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 < max_array_num; i++) { >>>>> So we are getting a ton of memory here just to free it up a bit later. >>>>> Why doesn't get_from_free_page_list get the pages from free list for us? >>>>> We could also avoid the 1st allocation then - just build a list >>>>...