Re: [PATCH] mm: skip the page buddy block instead of one page

2013-08-15 Thread Minchan Kim
On Thu, Aug 15, 2013 at 02:42:09PM +0100, Mel Gorman wrote: > On Thu, Aug 15, 2013 at 10:19:35PM +0900, Minchan Kim wrote: > > > > > > Why? We're looking for pages to migrate. If the page is free and at the > > > maximum order then there is no point searching in the middle of a free > > > page. >

Re: [PATCH] mm: skip the page buddy block instead of one page

2013-08-15 Thread Mel Gorman
On Thu, Aug 15, 2013 at 10:19:35PM +0900, Minchan Kim wrote: > > > > Why? We're looking for pages to migrate. If the page is free and at the > > maximum order then there is no point searching in the middle of a free > > page. > > isolate_migratepages_range API works with [low_pfn, end_pfn) > and

Re: [PATCH] mm: skip the page buddy block instead of one page

2013-08-15 Thread Minchan Kim
Hi Mel, On Thu, Aug 15, 2013 at 12:30:19PM +0100, Mel Gorman wrote: > On Thu, Aug 15, 2013 at 01:17:55PM +0900, Minchan Kim wrote: > > Hello, > > > > Well, this thread managed to get out of control for no good reason! > > > > > > > > > So, what's the result by that? > > > > As I said, it's

Re: [PATCH] mm: skip the page buddy block instead of one page

2013-08-15 Thread Mel Gorman
On Thu, Aug 15, 2013 at 01:17:55PM +0900, Minchan Kim wrote: > Hello, > Well, this thread managed to get out of control for no good reason! > > > > > > So, what's the result by that? > > > As I said, it's just skipping (pageblock_nr_pages -1) at worst case > > > > Hi Minchan, > > I mean if

Re: [PATCH] mm: skip the page buddy block instead of one page

2013-08-15 Thread Xishi Qiu
On 2013/8/15 17:51, Wanpeng Li wrote: > On Thu, Aug 15, 2013 at 03:45:11PM +0800, Xishi Qiu wrote: >> On 2013/8/15 12:24, Minchan Kim wrote: >> Please read full thread in detail. Mel suggested following as if (PageBuddy(page)) { int nr_pages = (1 <<

Re: [PATCH] mm: skip the page buddy block instead of one page

2013-08-15 Thread Xishi Qiu
On 2013/8/15 17:51, Wanpeng Li wrote: > On Thu, Aug 15, 2013 at 03:45:11PM +0800, Xishi Qiu wrote: >> On 2013/8/15 12:24, Minchan Kim wrote: >> Please read full thread in detail. Mel suggested following as if (PageBuddy(page)) { int nr_pages = (1 <<

Re: [PATCH] mm: skip the page buddy block instead of one page

2013-08-15 Thread Xishi Qiu
On 2013/8/15 12:24, Minchan Kim wrote: >> Please read full thread in detail. >> >> Mel suggested following as >> >> if (PageBuddy(page)) { >> int nr_pages = (1 << page_order(page)) - 1; >> if (PageBuddy(page)) { >> nr_pages = min(nr_pages, MAX_ORDER_NR_PAGES - 1);

Re: [PATCH] mm: skip the page buddy block instead of one page

2013-08-15 Thread Xishi Qiu
On 2013/8/15 12:17, Minchan Kim wrote: > > Please read full thread in detail. > > Mel suggested following as > > if (PageBuddy(page)) { > int nr_pages = (1 << page_order(page)) - 1; > if (PageBuddy(page)) { > nr_pages = min(nr_pages, MAX_ORDER_NR_PAGES - 1); >

Re: [PATCH] mm: skip the page buddy block instead of one page

2013-08-15 Thread Xishi Qiu
On 2013/8/15 12:17, Minchan Kim wrote: Please read full thread in detail. Mel suggested following as if (PageBuddy(page)) { int nr_pages = (1 page_order(page)) - 1; if (PageBuddy(page)) { nr_pages = min(nr_pages, MAX_ORDER_NR_PAGES - 1);

Re: [PATCH] mm: skip the page buddy block instead of one page

2013-08-15 Thread Xishi Qiu
On 2013/8/15 12:24, Minchan Kim wrote: Please read full thread in detail. Mel suggested following as if (PageBuddy(page)) { int nr_pages = (1 page_order(page)) - 1; if (PageBuddy(page)) { nr_pages = min(nr_pages, MAX_ORDER_NR_PAGES - 1);

Re: [PATCH] mm: skip the page buddy block instead of one page

2013-08-15 Thread Xishi Qiu
On 2013/8/15 17:51, Wanpeng Li wrote: On Thu, Aug 15, 2013 at 03:45:11PM +0800, Xishi Qiu wrote: On 2013/8/15 12:24, Minchan Kim wrote: Please read full thread in detail. Mel suggested following as if (PageBuddy(page)) { int nr_pages = (1 page_order(page)) - 1; if

Re: [PATCH] mm: skip the page buddy block instead of one page

2013-08-15 Thread Xishi Qiu
On 2013/8/15 17:51, Wanpeng Li wrote: On Thu, Aug 15, 2013 at 03:45:11PM +0800, Xishi Qiu wrote: On 2013/8/15 12:24, Minchan Kim wrote: Please read full thread in detail. Mel suggested following as if (PageBuddy(page)) { int nr_pages = (1 page_order(page)) - 1; if

Re: [PATCH] mm: skip the page buddy block instead of one page

2013-08-15 Thread Mel Gorman
On Thu, Aug 15, 2013 at 01:17:55PM +0900, Minchan Kim wrote: Hello, Well, this thread managed to get out of control for no good reason! SNIP So, what's the result by that? As I said, it's just skipping (pageblock_nr_pages -1) at worst case Hi Minchan, I mean if the private is

Re: [PATCH] mm: skip the page buddy block instead of one page

2013-08-15 Thread Minchan Kim
Hi Mel, On Thu, Aug 15, 2013 at 12:30:19PM +0100, Mel Gorman wrote: On Thu, Aug 15, 2013 at 01:17:55PM +0900, Minchan Kim wrote: Hello, Well, this thread managed to get out of control for no good reason! SNIP So, what's the result by that? As I said, it's just skipping

Re: [PATCH] mm: skip the page buddy block instead of one page

2013-08-15 Thread Mel Gorman
On Thu, Aug 15, 2013 at 10:19:35PM +0900, Minchan Kim wrote: Why? We're looking for pages to migrate. If the page is free and at the maximum order then there is no point searching in the middle of a free page. isolate_migratepages_range API works with [low_pfn, end_pfn) and we can't

Re: [PATCH] mm: skip the page buddy block instead of one page

2013-08-15 Thread Minchan Kim
On Thu, Aug 15, 2013 at 02:42:09PM +0100, Mel Gorman wrote: On Thu, Aug 15, 2013 at 10:19:35PM +0900, Minchan Kim wrote: Why? We're looking for pages to migrate. If the page is free and at the maximum order then there is no point searching in the middle of a free page.

Re: [PATCH] mm: skip the page buddy block instead of one page

2013-08-14 Thread Minchan Kim
On Thu, Aug 15, 2013 at 01:17:55PM +0900, Minchan Kim wrote: > Hello, > > On Thu, Aug 15, 2013 at 11:46:07AM +0800, Xishi Qiu wrote: > > On 2013/8/15 10:44, Minchan Kim wrote: > > > > > Hi Xishi, > > > > > > On Thu, Aug 15, 2013 at 10:32:50AM +0800, Xishi Qiu wrote: > > >> On 2013/8/15 2:00,

Re: [PATCH] mm: skip the page buddy block instead of one page

2013-08-14 Thread Minchan Kim
Hello, On Thu, Aug 15, 2013 at 11:46:07AM +0800, Xishi Qiu wrote: > On 2013/8/15 10:44, Minchan Kim wrote: > > > Hi Xishi, > > > > On Thu, Aug 15, 2013 at 10:32:50AM +0800, Xishi Qiu wrote: > >> On 2013/8/15 2:00, Mel Gorman wrote: > >> > > Even if the page is still page buddy, there is no

Re: [PATCH] mm: skip the page buddy block instead of one page

2013-08-14 Thread Xishi Qiu
On 2013/8/15 10:44, Minchan Kim wrote: > Hi Xishi, > > On Thu, Aug 15, 2013 at 10:32:50AM +0800, Xishi Qiu wrote: >> On 2013/8/15 2:00, Mel Gorman wrote: >> > Even if the page is still page buddy, there is no guarantee that it's > the same page order as the first read. It could have be

Re: [PATCH] mm: skip the page buddy block instead of one page

2013-08-14 Thread Minchan Kim
Hi Xishi, On Thu, Aug 15, 2013 at 10:32:50AM +0800, Xishi Qiu wrote: > On 2013/8/15 2:00, Mel Gorman wrote: > > >>> Even if the page is still page buddy, there is no guarantee that it's > >>> the same page order as the first read. It could have be currently > >>> merging with adjacent buddies

Re: [PATCH] mm: skip the page buddy block instead of one page

2013-08-14 Thread Xishi Qiu
On 2013/8/15 2:00, Mel Gorman wrote: >>> Even if the page is still page buddy, there is no guarantee that it's >>> the same page order as the first read. It could have be currently >>> merging with adjacent buddies for example. There is also a really >>> small race that a page was freed,

Re: [PATCH] mm: skip the page buddy block instead of one page

2013-08-14 Thread Mel Gorman
On Wed, Aug 14, 2013 at 01:26:02PM -0700, Andrew Morton wrote: > On Thu, 15 Aug 2013 00:52:29 +0900 Minchan Kim wrote: > > > On Wed, Aug 14, 2013 at 09:57:11AM +0100, Mel Gorman wrote: > > > On Wed, Aug 14, 2013 at 12:45:41PM +0800, Xishi Qiu wrote: > > > > A large free page buddy block will

Re: [PATCH] mm: skip the page buddy block instead of one page

2013-08-14 Thread Andrew Morton
On Thu, 15 Aug 2013 00:52:29 +0900 Minchan Kim wrote: > On Wed, Aug 14, 2013 at 09:57:11AM +0100, Mel Gorman wrote: > > On Wed, Aug 14, 2013 at 12:45:41PM +0800, Xishi Qiu wrote: > > > A large free page buddy block will continue many times, so if the page > > > is free, skip the whole page

Re: [PATCH] mm: skip the page buddy block instead of one page

2013-08-14 Thread Minchan Kim
On Wed, Aug 14, 2013 at 07:00:12PM +0100, Mel Gorman wrote: > On Thu, Aug 15, 2013 at 01:39:21AM +0900, Minchan Kim wrote: > > On Wed, Aug 14, 2013 at 05:16:42PM +0100, Mel Gorman wrote: > > > On Thu, Aug 15, 2013 at 12:52:29AM +0900, Minchan Kim wrote: > > > > Hi Mel, > > > > > > > > On Wed, Aug

Re: [PATCH] mm: skip the page buddy block instead of one page

2013-08-14 Thread Mel Gorman
On Thu, Aug 15, 2013 at 01:39:21AM +0900, Minchan Kim wrote: > On Wed, Aug 14, 2013 at 05:16:42PM +0100, Mel Gorman wrote: > > On Thu, Aug 15, 2013 at 12:52:29AM +0900, Minchan Kim wrote: > > > Hi Mel, > > > > > > On Wed, Aug 14, 2013 at 09:57:11AM +0100, Mel Gorman wrote: > > > > On Wed, Aug 14,

Re: [PATCH] mm: skip the page buddy block instead of one page

2013-08-14 Thread Minchan Kim
On Wed, Aug 14, 2013 at 05:16:42PM +0100, Mel Gorman wrote: > On Thu, Aug 15, 2013 at 12:52:29AM +0900, Minchan Kim wrote: > > Hi Mel, > > > > On Wed, Aug 14, 2013 at 09:57:11AM +0100, Mel Gorman wrote: > > > On Wed, Aug 14, 2013 at 12:45:41PM +0800, Xishi Qiu wrote: > > > > A large free page

Re: [PATCH] mm: skip the page buddy block instead of one page

2013-08-14 Thread Mel Gorman
On Thu, Aug 15, 2013 at 12:52:29AM +0900, Minchan Kim wrote: > Hi Mel, > > On Wed, Aug 14, 2013 at 09:57:11AM +0100, Mel Gorman wrote: > > On Wed, Aug 14, 2013 at 12:45:41PM +0800, Xishi Qiu wrote: > > > A large free page buddy block will continue many times, so if the page > > > is free, skip

Re: [PATCH] mm: skip the page buddy block instead of one page

2013-08-14 Thread Minchan Kim
Hi Mel, On Wed, Aug 14, 2013 at 09:57:11AM +0100, Mel Gorman wrote: > On Wed, Aug 14, 2013 at 12:45:41PM +0800, Xishi Qiu wrote: > > A large free page buddy block will continue many times, so if the page > > is free, skip the whole page buddy block instead of one page. > > > > Signed-off-by:

Re: [PATCH] mm: skip the page buddy block instead of one page

2013-08-14 Thread Xishi Qiu
On 2013/8/14 16:57, Mel Gorman wrote: > On Wed, Aug 14, 2013 at 12:45:41PM +0800, Xishi Qiu wrote: >> A large free page buddy block will continue many times, so if the page >> is free, skip the whole page buddy block instead of one page. >> >> Signed-off-by: Xishi Qiu > > page_order cannot be

Re: [PATCH] mm: skip the page buddy block instead of one page

2013-08-14 Thread Mel Gorman
On Wed, Aug 14, 2013 at 12:45:41PM +0800, Xishi Qiu wrote: > A large free page buddy block will continue many times, so if the page > is free, skip the whole page buddy block instead of one page. > > Signed-off-by: Xishi Qiu page_order cannot be used unless zone->lock is held which is not held

Re: [PATCH] mm: skip the page buddy block instead of one page

2013-08-14 Thread Minchan Kim
Hello, On Wed, Aug 14, 2013 at 12:45:41PM +0800, Xishi Qiu wrote: > A large free page buddy block will continue many times, so if the page > is free, skip the whole page buddy block instead of one page. > > Signed-off-by: Xishi Qiu Nitpick is it could change nr_scanned's result so that

Re: [PATCH] mm: skip the page buddy block instead of one page

2013-08-14 Thread Minchan Kim
Hello, On Wed, Aug 14, 2013 at 12:45:41PM +0800, Xishi Qiu wrote: A large free page buddy block will continue many times, so if the page is free, skip the whole page buddy block instead of one page. Signed-off-by: Xishi Qiu qiuxi...@huawei.com Nitpick is it could change nr_scanned's

Re: [PATCH] mm: skip the page buddy block instead of one page

2013-08-14 Thread Mel Gorman
On Wed, Aug 14, 2013 at 12:45:41PM +0800, Xishi Qiu wrote: A large free page buddy block will continue many times, so if the page is free, skip the whole page buddy block instead of one page. Signed-off-by: Xishi Qiu qiuxi...@huawei.com page_order cannot be used unless zone-lock is held

Re: [PATCH] mm: skip the page buddy block instead of one page

2013-08-14 Thread Xishi Qiu
On 2013/8/14 16:57, Mel Gorman wrote: On Wed, Aug 14, 2013 at 12:45:41PM +0800, Xishi Qiu wrote: A large free page buddy block will continue many times, so if the page is free, skip the whole page buddy block instead of one page. Signed-off-by: Xishi Qiu qiuxi...@huawei.com page_order

Re: [PATCH] mm: skip the page buddy block instead of one page

2013-08-14 Thread Minchan Kim
Hi Mel, On Wed, Aug 14, 2013 at 09:57:11AM +0100, Mel Gorman wrote: On Wed, Aug 14, 2013 at 12:45:41PM +0800, Xishi Qiu wrote: A large free page buddy block will continue many times, so if the page is free, skip the whole page buddy block instead of one page. Signed-off-by: Xishi Qiu

Re: [PATCH] mm: skip the page buddy block instead of one page

2013-08-14 Thread Mel Gorman
On Thu, Aug 15, 2013 at 12:52:29AM +0900, Minchan Kim wrote: Hi Mel, On Wed, Aug 14, 2013 at 09:57:11AM +0100, Mel Gorman wrote: On Wed, Aug 14, 2013 at 12:45:41PM +0800, Xishi Qiu wrote: A large free page buddy block will continue many times, so if the page is free, skip the whole

Re: [PATCH] mm: skip the page buddy block instead of one page

2013-08-14 Thread Minchan Kim
On Wed, Aug 14, 2013 at 05:16:42PM +0100, Mel Gorman wrote: On Thu, Aug 15, 2013 at 12:52:29AM +0900, Minchan Kim wrote: Hi Mel, On Wed, Aug 14, 2013 at 09:57:11AM +0100, Mel Gorman wrote: On Wed, Aug 14, 2013 at 12:45:41PM +0800, Xishi Qiu wrote: A large free page buddy block will

Re: [PATCH] mm: skip the page buddy block instead of one page

2013-08-14 Thread Mel Gorman
On Thu, Aug 15, 2013 at 01:39:21AM +0900, Minchan Kim wrote: On Wed, Aug 14, 2013 at 05:16:42PM +0100, Mel Gorman wrote: On Thu, Aug 15, 2013 at 12:52:29AM +0900, Minchan Kim wrote: Hi Mel, On Wed, Aug 14, 2013 at 09:57:11AM +0100, Mel Gorman wrote: On Wed, Aug 14, 2013 at

Re: [PATCH] mm: skip the page buddy block instead of one page

2013-08-14 Thread Minchan Kim
On Wed, Aug 14, 2013 at 07:00:12PM +0100, Mel Gorman wrote: On Thu, Aug 15, 2013 at 01:39:21AM +0900, Minchan Kim wrote: On Wed, Aug 14, 2013 at 05:16:42PM +0100, Mel Gorman wrote: On Thu, Aug 15, 2013 at 12:52:29AM +0900, Minchan Kim wrote: Hi Mel, On Wed, Aug 14, 2013 at

Re: [PATCH] mm: skip the page buddy block instead of one page

2013-08-14 Thread Andrew Morton
On Thu, 15 Aug 2013 00:52:29 +0900 Minchan Kim minc...@kernel.org wrote: On Wed, Aug 14, 2013 at 09:57:11AM +0100, Mel Gorman wrote: On Wed, Aug 14, 2013 at 12:45:41PM +0800, Xishi Qiu wrote: A large free page buddy block will continue many times, so if the page is free, skip the whole

Re: [PATCH] mm: skip the page buddy block instead of one page

2013-08-14 Thread Mel Gorman
On Wed, Aug 14, 2013 at 01:26:02PM -0700, Andrew Morton wrote: On Thu, 15 Aug 2013 00:52:29 +0900 Minchan Kim minc...@kernel.org wrote: On Wed, Aug 14, 2013 at 09:57:11AM +0100, Mel Gorman wrote: On Wed, Aug 14, 2013 at 12:45:41PM +0800, Xishi Qiu wrote: A large free page buddy block

Re: [PATCH] mm: skip the page buddy block instead of one page

2013-08-14 Thread Xishi Qiu
On 2013/8/15 2:00, Mel Gorman wrote: Even if the page is still page buddy, there is no guarantee that it's the same page order as the first read. It could have be currently merging with adjacent buddies for example. There is also a really small race that a page was freed, allocated with some

Re: [PATCH] mm: skip the page buddy block instead of one page

2013-08-14 Thread Minchan Kim
Hi Xishi, On Thu, Aug 15, 2013 at 10:32:50AM +0800, Xishi Qiu wrote: On 2013/8/15 2:00, Mel Gorman wrote: Even if the page is still page buddy, there is no guarantee that it's the same page order as the first read. It could have be currently merging with adjacent buddies for example.

Re: [PATCH] mm: skip the page buddy block instead of one page

2013-08-14 Thread Xishi Qiu
On 2013/8/15 10:44, Minchan Kim wrote: Hi Xishi, On Thu, Aug 15, 2013 at 10:32:50AM +0800, Xishi Qiu wrote: On 2013/8/15 2:00, Mel Gorman wrote: Even if the page is still page buddy, there is no guarantee that it's the same page order as the first read. It could have be currently merging

Re: [PATCH] mm: skip the page buddy block instead of one page

2013-08-14 Thread Minchan Kim
Hello, On Thu, Aug 15, 2013 at 11:46:07AM +0800, Xishi Qiu wrote: On 2013/8/15 10:44, Minchan Kim wrote: Hi Xishi, On Thu, Aug 15, 2013 at 10:32:50AM +0800, Xishi Qiu wrote: On 2013/8/15 2:00, Mel Gorman wrote: Even if the page is still page buddy, there is no guarantee that it's

Re: [PATCH] mm: skip the page buddy block instead of one page

2013-08-14 Thread Minchan Kim
On Thu, Aug 15, 2013 at 01:17:55PM +0900, Minchan Kim wrote: Hello, On Thu, Aug 15, 2013 at 11:46:07AM +0800, Xishi Qiu wrote: On 2013/8/15 10:44, Minchan Kim wrote: Hi Xishi, On Thu, Aug 15, 2013 at 10:32:50AM +0800, Xishi Qiu wrote: On 2013/8/15 2:00, Mel Gorman wrote:

[PATCH] mm: skip the page buddy block instead of one page

2013-08-13 Thread Xishi Qiu
A large free page buddy block will continue many times, so if the page is free, skip the whole page buddy block instead of one page. Signed-off-by: Xishi Qiu --- mm/compaction.c |5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/mm/compaction.c b/mm/compaction.c index

[PATCH] mm: skip the page buddy block instead of one page

2013-08-13 Thread Xishi Qiu
A large free page buddy block will continue many times, so if the page is free, skip the whole page buddy block instead of one page. Signed-off-by: Xishi Qiu qiuxi...@huawei.com --- mm/compaction.c |5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/mm/compaction.c