Re: [virtio-dev] Re: [PATCH v13 4/5] mm: support reporting free page blocks

2017-08-10 Thread Michal Hocko
On Thu 10-08-17 15:38:34, Wei Wang wrote: > On 08/10/2017 03:05 PM, Michal Hocko wrote: > >On Tue 08-08-17 14:34:25, Wei Wang wrote: > >>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 ug

Re: [virtio-dev] Re: [PATCH v13 4/5] mm: support reporting free page blocks

2017-08-10 Thread Wei Wang
On 08/10/2017 03:05 PM, Michal Hocko wrote: On Tue 08-08-17 14:34:25, Wei Wang wrote: 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 outsi

Re: [virtio-dev] Re: [PATCH v13 4/5] mm: support reporting free page blocks

2017-08-10 Thread Michal Hocko
On Tue 08-08-17 14:34:25, Wei Wang wrote: > 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

Re: [virtio-dev] Re: [PATCH v13 4/5] mm: support reporting free page blocks

2017-08-07 Thread Wei Wang
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 suitabl

Re: [PATCH v13 4/5] mm: support reporting free page blocks

2017-08-07 Thread Wei Wang
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 on

Re: [PATCH v13 4/5] mm: support reporting free page blocks

2017-08-04 Thread Wei Wang
On 08/04/2017 04:24 PM, Michal Hocko wrote: For our use case, the callback just puts the reported page block to the ring, then returns. If the ring is full as the host is busy, then I think it should skip this one, and just return. Because: A. This is an optimization feature, losing a coup

Re: [PATCH v13 4/5] mm: support reporting free page blocks

2017-08-04 Thread Michal Hocko
On Fri 04-08-17 16:15:24, Wei Wang wrote: > On 08/04/2017 03:53 PM, Michal Hocko wrote: > >On Fri 04-08-17 00:02:01, Michael S. Tsirkin wrote: > >>On Thu, Aug 03, 2017 at 03:20:09PM +, Wang, Wei W wrote: > >>>On Thursday, August 3, 2017 9:51 PM, Michal Hocko: > As I've said earlier. Start s

Re: [PATCH v13 4/5] mm: support reporting free page blocks

2017-08-04 Thread Wei Wang
On 08/04/2017 03:53 PM, Michal Hocko wrote: On Fri 04-08-17 00:02:01, Michael S. Tsirkin wrote: On Thu, Aug 03, 2017 at 03:20:09PM +, Wang, Wei W wrote: On Thursday, August 3, 2017 9:51 PM, Michal Hocko: As I've said earlier. Start simple optimize incrementally with some numbers to justify

Re: [PATCH v13 4/5] mm: support reporting free page blocks

2017-08-04 Thread Michal Hocko
On Fri 04-08-17 00:02:01, Michael S. Tsirkin wrote: > On Thu, Aug 03, 2017 at 03:20:09PM +, Wang, Wei W wrote: > > On Thursday, August 3, 2017 9:51 PM, Michal Hocko: > > > As I've said earlier. Start simple optimize incrementally with some > > > numbers to > > > justify a more subtle code. >

Re: [PATCH v13 4/5] mm: support reporting free page blocks

2017-08-03 Thread Michael S. Tsirkin
On Thu, Aug 03, 2017 at 03:20:09PM +, Wang, Wei W wrote: > On Thursday, August 3, 2017 9:51 PM, Michal Hocko: > > As I've said earlier. Start simple optimize incrementally with some numbers > > to > > justify a more subtle code. > > -- > > OK. Let's start with the simple implementation as yo

RE: [PATCH v13 4/5] mm: support reporting free page blocks

2017-08-03 Thread Wang, Wei W
On Thursday, August 3, 2017 9:51 PM, Michal Hocko: > As I've said earlier. Start simple optimize incrementally with some numbers to > justify a more subtle code. > -- OK. Let's start with the simple implementation as you suggested. Best, Wei

Re: [PATCH v13 4/5] mm: support reporting free page blocks

2017-08-03 Thread Michal Hocko
On Thu 03-08-17 21:17:25, Wei Wang wrote: > On 08/03/2017 08:41 PM, Michal Hocko wrote: > >On Thu 03-08-17 20:11:58, Wei Wang wrote: > >>On 08/03/2017 07:28 PM, Michal Hocko wrote: > >>>On Thu 03-08-17 19:27:19, Wei Wang wrote: > On 08/03/2017 06:44 PM, Michal Hocko wrote: > >On Thu 03-08-1

Re: [PATCH v13 4/5] mm: support reporting free page blocks

2017-08-03 Thread Wei Wang
On 08/03/2017 08:41 PM, Michal Hocko wrote: On Thu 03-08-17 20:11:58, Wei Wang wrote: On 08/03/2017 07:28 PM, Michal Hocko wrote: On Thu 03-08-17 19:27:19, Wei Wang wrote: On 08/03/2017 06:44 PM, Michal Hocko wrote: On Thu 03-08-17 18:42:15, Wei Wang wrote: On 08/03/2017 05:11 PM, Michal Hoc

Re: [PATCH v13 4/5] mm: support reporting free page blocks

2017-08-03 Thread Michal Hocko
On Thu 03-08-17 20:11:58, Wei Wang wrote: > On 08/03/2017 07:28 PM, Michal Hocko wrote: > >On Thu 03-08-17 19:27:19, Wei Wang wrote: > >>On 08/03/2017 06:44 PM, Michal Hocko wrote: > >>>On Thu 03-08-17 18:42:15, Wei Wang wrote: > On 08/03/2017 05:11 PM, Michal Hocko wrote: > >On Thu 03-08-1

Re: [PATCH v13 4/5] mm: support reporting free page blocks

2017-08-03 Thread Wei Wang
On 08/03/2017 07:28 PM, Michal Hocko wrote: On Thu 03-08-17 19:27:19, Wei Wang wrote: On 08/03/2017 06:44 PM, Michal Hocko wrote: On Thu 03-08-17 18:42:15, Wei Wang wrote: On 08/03/2017 05:11 PM, Michal Hocko wrote: On Thu 03-08-17 14:38:18, Wei Wang wrote: [...] +static int report_free_pag

Re: [PATCH v13 4/5] mm: support reporting free page blocks

2017-08-03 Thread Michal Hocko
On Thu 03-08-17 19:27:19, Wei Wang wrote: > On 08/03/2017 06:44 PM, Michal Hocko wrote: > >On Thu 03-08-17 18:42:15, Wei Wang wrote: > >>On 08/03/2017 05:11 PM, Michal Hocko wrote: > >>>On Thu 03-08-17 14:38:18, Wei Wang wrote: > >[...] > +static int report_free_page_block(struct zone *zone, un

Re: [PATCH v13 4/5] mm: support reporting free page blocks

2017-08-03 Thread Wei Wang
On 08/03/2017 06:44 PM, Michal Hocko wrote: On Thu 03-08-17 18:42:15, Wei Wang wrote: On 08/03/2017 05:11 PM, Michal Hocko wrote: On Thu 03-08-17 14:38:18, Wei Wang wrote: [...] +static int report_free_page_block(struct zone *zone, unsigned int order, + unsigne

Re: [PATCH v13 4/5] mm: support reporting free page blocks

2017-08-03 Thread Michal Hocko
On Thu 03-08-17 18:42:15, Wei Wang wrote: > On 08/03/2017 05:11 PM, Michal Hocko wrote: > >On Thu 03-08-17 14:38:18, Wei Wang wrote: [...] > >>+static int report_free_page_block(struct zone *zone, unsigned int order, > >>+ unsigned int migratetype, struct page **page) >

Re: [PATCH v13 4/5] mm: support reporting free page blocks

2017-08-03 Thread Wei Wang
On 08/03/2017 05:11 PM, Michal Hocko wrote: On Thu 03-08-17 14:38:18, Wei Wang wrote: This patch adds support to walk through the free page blocks in the system and report them via a callback function. Some page blocks may leave the free list after the report function returns, so it is the calle

Re: [PATCH v13 4/5] mm: support reporting free page blocks

2017-08-03 Thread Michal Hocko
On Thu 03-08-17 14:38:18, Wei Wang wrote: > This patch adds support to walk through the free page blocks in the > system and report them via a callback function. Some page blocks may > leave the free list after the report function returns, so it is the > caller's responsibility to either detect or