From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964830AbdCJJ6U (ORCPT ); Fri, 10 Mar 2017 04:58:20 -0500 Received: from szxga01-in.huawei.com ([45.249.212.187]:4291 "EHLO dggrg01-dlp.huawei.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S933479AbdCJJ6Q (ORCPT ); Fri, 10 Mar 2017 04:58:16 -0500 Subject: Re: [RFC] mm/compaction: ignore block suitable after check large free page To: Vlastimil Babka , , , , , , References: <1489119648-59583-1-git-send-email-xieyisheng1@huawei.com> CC: , , , , From: Yisheng Xie Message-ID: <9104271f-c90f-772c-26b2-410fa8bdfdb0@huawei.com> Date: Fri, 10 Mar 2017 17:53:58 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.29.40] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020205.58C277C2.017D,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: ca408940d783db6877e7fee368091734 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Vlastimil, Thanks for comment. On 2017/3/10 15:30, Vlastimil Babka wrote: > On 03/10/2017 05:20 AM, Yisheng Xie wrote: >> If the migrate target is a large free page and we ignore suitable, >> it may not good for defrag. So move the ignore block suitable after >> check large free page. > > Right. But in practice I expect close to no impact, because direct > compaction shouldn't have to be called if there's a >=pageblock_order > page already available. > Maybe you are right and this change is just based on logical analyses. Presently, only in direct compaction, we increase the compaction priority, and ignore suitable at MIN_COMPACT_PRIORITY. I have a silly question, can we do the similar thing in kcompactd? maybe by doing most work in kcompactd, we can get better perf of slow path. Thanks Yisheng Xie >> Signed-off-by: Yisheng Xie >> --- >> mm/compaction.c | 6 +++--- >> 1 file changed, 3 insertions(+), 3 deletions(-) >> >> diff --git a/mm/compaction.c b/mm/compaction.c >> index 0fdfde0..4bf2a5d 100644 >> --- a/mm/compaction.c >> +++ b/mm/compaction.c >> @@ -991,9 +991,6 @@ static bool too_many_isolated(struct zone *zone) >> static bool suitable_migration_target(struct compact_control *cc, >> struct page *page) >> { >> - if (cc->ignore_block_suitable) >> - return true; >> - >> /* If the page is a large free page, then disallow migration */ >> if (PageBuddy(page)) { >> /* >> @@ -1005,6 +1002,9 @@ static bool suitable_migration_target(struct compact_control *cc, >> return false; >> } >> >> + if (cc->ignore_block_suitable) >> + return true; >> + >> /* If the block is MIGRATE_MOVABLE or MIGRATE_CMA, allow migration */ >> if (migrate_async_suitable(get_pageblock_migratetype(page))) >> return true; >> > > > . >