search for: max_free_page_blocks

Displaying 19 results from an estimated 19 matches for "max_free_page_blocks".

2018 Jul 10
0
[PATCH v35 1/5] mm: support to get hints of free page blocks
...clude/linux/mm.h +++ b/include/linux/mm.h @@ -2007,6 +2007,9 @@ extern void free_area_init(unsigned long * zones_size); extern void free_area_init_node(int nid, unsigned long * zones_size, unsigned long zone_start_pfn, unsigned long *zholes_size); extern void free_initmem(void); +unsigned long max_free_page_blocks(int order); +int get_from_free_page_list(int order, struct list_head *pages, + unsigned int size, unsigned long *loaded_num); /* * Free reserved pages within range [PAGE_ALIGN(start), end & PAGE_MASK) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 1521100..b67839b 100644 --- a/...
2018 Jun 27
2
[PATCH v34 2/4] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT
...a list of pages is better. > > > > > > Best, > > > Wei > > How much memory 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 all...
2018 Jun 27
2
[PATCH v34 2/4] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT
...a list of pages is better. > > > > > > Best, > > > Wei > > How much memory 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 all...
2018 Jul 10
7
[PATCH v35 0/5] Virtio-balloon: support free page reporting
...ed ring; unused buffers are freed immediately when guest finishes reporting. - change uint32_t to u32; - patch 2 is split out as an independent patch, as it's unrelated to the free page hinting feature. v33->v34: - mm: - add a new API max_free_page_blocks, which estimates the max number of free page blocks that a free page list may have - get_from_free_page_list: store addresses to multiple arrays, instead of just one array. This removes the limitation of being able to report only 2TB free memory (the largest ar...
2018 Jun 27
2
[PATCH v34 2/4] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT
...> > > Wei > > > > How much memory 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 % entrie...
2018 Jun 27
2
[PATCH v34 2/4] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT
...> > > Wei > > > > How much memory 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 % entrie...
2018 Jun 25
9
[PATCH v34 0/4] Virtio-balloon: support free page reporting
...- Live Migration Time (average) Optimization v.s. Legacy = 1402ms v.s. 2528ms --> ~44% reduction - Linux Compilation Time Optimization v.s. Legacy = 5min6s v.s. 5min12s --> no obvious difference ChangeLog: v33->v34: - mm: - add a new API max_free_page_blocks, which estimates the max number of free page blocks that a free page list may have - get_from_free_page_list: store addresses to multiple arrays, instead of just one array. This removes the limitation of being able to report only 2TB free memory (the largest ar...
2018 Jun 25
9
[PATCH v34 0/4] Virtio-balloon: support free page reporting
...- Live Migration Time (average) Optimization v.s. Legacy = 1402ms v.s. 2528ms --> ~44% reduction - Linux Compilation Time Optimization v.s. Legacy = 5min6s v.s. 5min12s --> no obvious difference ChangeLog: v33->v34: - mm: - add a new API max_free_page_blocks, which estimates the max number of free page blocks that a free page list may have - get_from_free_page_list: store addresses to multiple arrays, instead of just one array. This removes the limitation of being able to report only 2TB free memory (the largest ar...
2018 Jun 27
0
[PATCH v34 2/4] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT
.... >>>> >>>> Best, >>>> Wei >>> How much memory 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); > &...
2018 Jun 27
0
[PATCH v34 2/4] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT
...t; Wei >>>>> How much memory 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_entr...
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 26
2
[PATCH v34 2/4] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT
...lloon *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 / entries_per_array + > + !!(max_entries % entries_per_array); > + arrays = kmalloc_array(max_array_num,...
2018 Jun 26
2
[PATCH v34 2/4] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT
...lloon *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 / entries_per_array + > + !!(max_entries % entries_per_array); > + arrays = kmalloc_array(max_array_num,...
2018 Jun 26
0
[PATCH v34 2/4] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT
...out_err; > Don't we need to kick here? I think not needed, because we have kicked host about starting 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_...
2018 Jun 27
0
[PATCH v34 0/4] Virtio-balloon: support free page reporting
...that already happened during the development of this series, I think we should rather look into how clean free page hinting might solve the same problem. If it can't be solved using free page hinting, fair enough. > ChangeLog: > v33->v34: > - mm: > - add a new API max_free_page_blocks, which estimates the max > number of free page blocks that a free page list may have > - get_from_free_page_list: store addresses to multiple arrays, > instead of just one array. This removes the limitation of being > able to report only 2TB free me...
2018 Jun 26
2
[PATCH v34 2/4] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT
...#39;t exit unless receiving this stop sign or > the migration thread asks to exit. You can't assume that. Host might 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); >...
2018 Jun 26
2
[PATCH v34 2/4] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT
...#39;t exit unless receiving this stop sign or > the migration thread asks to exit. You can't assume that. Host might 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); >...
2018 Jun 25
0
[PATCH v34 2/4] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT
...re 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); + arrays = kmalloc_array(max_array_num, sizeof(__le64 *), GFP_KE...