search for: migrate_types

Displaying 20 results from an estimated 108 matches for "migrate_types".

2017 Aug 10
1
[virtio-dev] Re: [PATCH v13 4/5] mm: support reporting free page blocks
...min_order; order < MAX_ORDER; ++order) { >>> >>> This appears to be covered by for_each_migratetype_order(order, mt) below. > yes but > #define for_each_migratetype_order(order, type) \ > for (order = 0; order < MAX_ORDER; order++) \ > for (type = 0; type < MIGRATE_TYPES; type++) > > so you would have to skip orders < min_order Yes, that's why we have a new macro #define for_each_migratetype_order_decend(min_order, order, type) \ for (order = MAX_ORDER - 1; order < MAX_ORDER && order >= min_order; \ order--) \ for (type = 0; ty...
2017 Aug 10
1
[virtio-dev] Re: [PATCH v13 4/5] mm: support reporting free page blocks
...min_order; order < MAX_ORDER; ++order) { >>> >>> This appears to be covered by for_each_migratetype_order(order, mt) below. > yes but > #define for_each_migratetype_order(order, type) \ > for (order = 0; order < MAX_ORDER; order++) \ > for (type = 0; type < MIGRATE_TYPES; type++) > > so you would have to skip orders < min_order Yes, that's why we have a new macro #define for_each_migratetype_order_decend(min_order, order, type) \ for (order = MAX_ORDER - 1; order < MAX_ORDER && order >= min_order; \ order--) \ for (type = 0; ty...
2018 Jun 16
2
[PATCH v33 1/4] mm: add a function to get free page blocks
...gt; + struct zone *zone; > + enum migratetype mt; > + struct page *page; > + struct list_head *list; > + unsigned long addr, flags; > + uint32_t index = 0; > + > + for_each_populated_zone(zone) { > + spin_lock_irqsave(&zone->lock, flags); > + for (mt = 0; mt < MIGRATE_TYPES; mt++) { > + list = &zone->free_area[order].free_list[mt]; > + list_for_each_entry(page, list, lru) { > + addr = page_to_pfn(page) << PAGE_SHIFT; > + if (likely(index < size)) { > + buf[index++] = cpu_to_le64(addr); > + } else { > + spin_unl...
2017 Aug 08
2
[virtio-dev] Re: [PATCH v13 4/5] mm: support reporting free page blocks
On 08/08/2017 02:12 PM, Wei Wang wrote: > On 08/03/2017 05:11 PM, Michal Hocko wrote: >> On Thu 03-08-17 14:38:18, Wei Wang wrote: >> This is just too ugly and wrong actually. Never provide struct page >> pointers outside of the zone->lock. What I've had in mind was to simply >> walk free lists of the suitable order and call the callback for each >> one.
2017 Aug 08
2
[virtio-dev] Re: [PATCH v13 4/5] mm: support reporting free page blocks
On 08/08/2017 02:12 PM, Wei Wang wrote: > On 08/03/2017 05:11 PM, Michal Hocko wrote: >> On Thu 03-08-17 14:38:18, Wei Wang wrote: >> This is just too ugly and wrong actually. Never provide struct page >> pointers outside of the zone->lock. What I've had in mind was to simply >> walk free lists of the suitable order and call the callback for each >> one.
2017 Jun 12
1
[PATCH v11 6/6] virtio-balloon: VIRTIO_BALLOON_F_CMD_VQ
On 06/09/2017 03:41 AM, Wei Wang wrote: > + for_each_populated_zone(zone) { > + for (order = MAX_ORDER - 1; order > 0; order--) { > + for (migratetype = 0; migratetype < MIGRATE_TYPES; > + migratetype++) { > + do { > + ret = report_unused_page_block(zone, > + order, migratetype, &page); > + if (!ret) { > + pfn = (u64)page_to_pfn(page); > + add_one_chunk(vb, vq, > + PAGE_CHNUK_UNUSED_PAGE, > + pfn <<...
2017 Jun 12
1
[PATCH v11 6/6] virtio-balloon: VIRTIO_BALLOON_F_CMD_VQ
On 06/09/2017 03:41 AM, Wei Wang wrote: > + for_each_populated_zone(zone) { > + for (order = MAX_ORDER - 1; order > 0; order--) { > + for (migratetype = 0; migratetype < MIGRATE_TYPES; > + migratetype++) { > + do { > + ret = report_unused_page_block(zone, > + order, migratetype, &page); > + if (!ret) { > + pfn = (u64)page_to_pfn(page); > + add_one_chunk(vb, vq, > + PAGE_CHNUK_UNUSED_PAGE, > + pfn <<...
2017 Aug 03
0
[PATCH v13 4/5] mm: support reporting free page blocks
...attern diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index fc14b8b..59eacf2 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -83,6 +83,11 @@ static inline bool is_migrate_movable(int mt) for (order = 0; order < MAX_ORDER; order++) \ for (type = 0; type < MIGRATE_TYPES; type++) +#define for_each_migratetype_order_decend(min_order, order, type) \ + for (order = MAX_ORDER - 1; order < MAX_ORDER && order >= min_order; \ + order--) \ + for (type = 0; type < MIGRATE_TYPES; type++) + extern int page_group_by_mobility_disabled; #define NR_MI...
2017 Mar 16
4
[PATCH kernel v8 3/4] mm: add inerface to offer info about unused pages
...4 *chunk; > + > + if (zone_is_empty(zone)) > + return 0; > + > + spin_lock_irqsave(&zone->lock, flags); > + > + if (*offset + zone->free_area[order].nr_free > size && !part_fill) { > + ret = -ENOSPC; > + goto out; > + } > + for (t = 0; t < MIGRATE_TYPES; t++) { > + list_for_each(curr, &zone->free_area[order].free_list[t]) { > + pfn = page_to_pfn(list_entry(curr, struct page, lru)); > + chunk = buf + *offset; > + if (*offset + 2 > size) { > + ret = -ENOSPC; > + goto out; > + } > + /* Align to the c...
2017 Mar 16
4
[PATCH kernel v8 3/4] mm: add inerface to offer info about unused pages
...4 *chunk; > + > + if (zone_is_empty(zone)) > + return 0; > + > + spin_lock_irqsave(&zone->lock, flags); > + > + if (*offset + zone->free_area[order].nr_free > size && !part_fill) { > + ret = -ENOSPC; > + goto out; > + } > + for (t = 0; t < MIGRATE_TYPES; t++) { > + list_for_each(curr, &zone->free_area[order].free_list[t]) { > + pfn = page_to_pfn(list_entry(curr, struct page, lru)); > + chunk = buf + *offset; > + if (*offset + 2 > size) { > + ret = -ENOSPC; > + goto out; > + } > + /* Align to the c...
2017 Mar 29
2
[PATCH kernel v8 3/4] mm: add inerface to offer info about unused pages
...; + > > > + spin_lock_irqsave(&zone->lock, flags); > > > + > > > + if (*offset + zone->free_area[order].nr_free > size && !part_fill) { > > > + ret = -ENOSPC; > > > + goto out; > > > + } > > > + for (t = 0; t < MIGRATE_TYPES; t++) { > > > + list_for_each(curr, &zone->free_area[order].free_list[t]) { > > > + pfn = page_to_pfn(list_entry(curr, struct page, lru)); > > > + chunk = buf + *offset; > > > + if (*offset + 2 > size) { > > > + ret = -ENOSPC; > &g...
2017 Mar 29
2
[PATCH kernel v8 3/4] mm: add inerface to offer info about unused pages
...; + > > > + spin_lock_irqsave(&zone->lock, flags); > > > + > > > + if (*offset + zone->free_area[order].nr_free > size && !part_fill) { > > > + ret = -ENOSPC; > > > + goto out; > > > + } > > > + for (t = 0; t < MIGRATE_TYPES; t++) { > > > + list_for_each(curr, &zone->free_area[order].free_list[t]) { > > > + pfn = page_to_pfn(list_entry(curr, struct page, lru)); > > > + chunk = buf + *offset; > > > + if (*offset + 2 > size) { > > > + ret = -ENOSPC; > &g...
2017 Apr 13
2
[PATCH v9 5/5] virtio-balloon: VIRTIO_BALLOON_F_MISC_VQ
..._UNUSED_PAGES; Gets endian-ness and whitespace wrong. Pls use static checkers to catch this type of error. > + miscq_out_hdr->flags = 0; > + > + for_each_populated_zone(zone) { > + for (order = MAX_ORDER - 1; order > 0; order--) { > + for (migratetype = 0; migratetype < MIGRATE_TYPES; > + migratetype++) { > + do { > + ret = inquire_unused_page_block(zone, > + order, migratetype, &page); > + if (!ret) { > + pfn = (u64)page_to_pfn(page); > + add_one_chunk(vb, vq, > + PAGE_CHUNK_TYPE_UNUSED, > + pfn, >...
2017 Apr 13
2
[PATCH v9 5/5] virtio-balloon: VIRTIO_BALLOON_F_MISC_VQ
..._UNUSED_PAGES; Gets endian-ness and whitespace wrong. Pls use static checkers to catch this type of error. > + miscq_out_hdr->flags = 0; > + > + for_each_populated_zone(zone) { > + for (order = MAX_ORDER - 1; order > 0; order--) { > + for (migratetype = 0; migratetype < MIGRATE_TYPES; > + migratetype++) { > + do { > + ret = inquire_unused_page_block(zone, > + order, migratetype, &page); > + if (!ret) { > + pfn = (u64)page_to_pfn(page); > + add_one_chunk(vb, vq, > + PAGE_CHUNK_TYPE_UNUSED, > + pfn, >...
2016 Nov 30
2
[PATCH kernel v5 5/5] virtio-balloon: tell host vm's unused page info
...>lock, flags); > + > + if (*pos + zone->free_area[order].nr_free > size) > + return -ENOSPC; Urg, so this won't partially fill? So, what the nr_free pages limit where we no longer fit in the kmalloc()'d buffer where this simply won't work? > + for (t = 0; t < MIGRATE_TYPES; t++) { > + list_for_each(curr, &zone->free_area[order].free_list[t]) { > + pfn = page_to_pfn(list_entry(curr, struct page, lru)); > + info = (struct page_info_item *)(unused_pages + *pos); > + info->start_pfn = pfn; > + info->page_shift = order + PAGE_SHIFT; &g...
2016 Nov 30
2
[PATCH kernel v5 5/5] virtio-balloon: tell host vm's unused page info
...>lock, flags); > + > + if (*pos + zone->free_area[order].nr_free > size) > + return -ENOSPC; Urg, so this won't partially fill? So, what the nr_free pages limit where we no longer fit in the kmalloc()'d buffer where this simply won't work? > + for (t = 0; t < MIGRATE_TYPES; t++) { > + list_for_each(curr, &zone->free_area[order].free_list[t]) { > + pfn = page_to_pfn(list_entry(curr, struct page, lru)); > + info = (struct page_info_item *)(unused_pages + *pos); > + info->start_pfn = pfn; > + info->page_shift = order + PAGE_SHIFT; &g...
2018 Mar 26
4
[PATCH v29 1/4] mm: support reporting free page blocks
...> + unsigned long pfn, > + unsigned long num)) > +{ > + struct zone *zone; > + int order; > + enum migratetype mt; > + int ret; > + > + for_each_populated_zone(zone) { > + for (order = MAX_ORDER - 1; order >= min_order; order--) { > + for (mt = 0; mt < MIGRATE_TYPES; mt++) { > + ret = walk_free_page_list(opaque, zone, > + order, mt, > + report_pfn_range); > + if (ret) > + return ret; > + } > + } > + } > + > + return 0; > +} > +EXPORT_SYMBOL_GPL(walk_free_mem_block); This looks like it could take...
2018 Mar 26
4
[PATCH v29 1/4] mm: support reporting free page blocks
...> + unsigned long pfn, > + unsigned long num)) > +{ > + struct zone *zone; > + int order; > + enum migratetype mt; > + int ret; > + > + for_each_populated_zone(zone) { > + for (order = MAX_ORDER - 1; order >= min_order; order--) { > + for (mt = 0; mt < MIGRATE_TYPES; mt++) { > + ret = walk_free_page_list(opaque, zone, > + order, mt, > + report_pfn_range); > + if (ret) > + return ret; > + } > + } > + } > + > + return 0; > +} > +EXPORT_SYMBOL_GPL(walk_free_mem_block); This looks like it could take...
2017 Jul 14
4
[PATCH v12 6/8] mm: support reporting free page blocks
...unsigned int migratetype, struct page **page) > +{ > + struct zone *this_zone; > + struct list_head *this_list; > + int ret = 0; > + unsigned long flags; > + > + /* Sanity check */ > + if (zone == NULL || page == NULL || order >= MAX_ORDER || > + migratetype >= MIGRATE_TYPES) > + return -EINVAL; > + > + /* Zone validity check */ > + for_each_populated_zone(this_zone) { > + if (zone == this_zone) > + break; > + } > + > + /* Got a non-existent zone from the caller? */ > + if (zone != this_zone) > + return -EINVAL; Huh, what do you c...
2017 Jul 14
4
[PATCH v12 6/8] mm: support reporting free page blocks
...unsigned int migratetype, struct page **page) > +{ > + struct zone *this_zone; > + struct list_head *this_list; > + int ret = 0; > + unsigned long flags; > + > + /* Sanity check */ > + if (zone == NULL || page == NULL || order >= MAX_ORDER || > + migratetype >= MIGRATE_TYPES) > + return -EINVAL; > + > + /* Zone validity check */ > + for_each_populated_zone(this_zone) { > + if (zone == this_zone) > + break; > + } > + > + /* Got a non-existent zone from the caller? */ > + if (zone != this_zone) > + return -EINVAL; Huh, what do you c...