From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755326AbdCGLEb (ORCPT ); Tue, 7 Mar 2017 06:04:31 -0500 Received: from szxga03-in.huawei.com ([45.249.212.189]:3928 "EHLO dggrg03-dlp.huawei.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1754775AbdCGLEF (ORCPT ); Tue, 7 Mar 2017 06:04:05 -0500 Message-ID: <58BE938B.9020908@huawei.com> Date: Tue, 7 Mar 2017 19:03:39 +0800 From: Xishi Qiu User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: Michal Hocko CC: Andrew Morton , Vlastimil Babka , Mel Gorman , Minchan Kim , Joonsoo Kim , Yisheng Xie , Linux MM , LKML Subject: Re: [RFC][PATCH 1/2] mm: use MIGRATE_HIGHATOMIC as late as possible References: <58BE8C91.20600@huawei.com> <20170307104758.GE28642@dhcp22.suse.cz> In-Reply-To: <20170307104758.GE28642@dhcp22.suse.cz> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.25.179] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020205.58BE9394.0107,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: aff3860705060d52a5ed9b096a411202 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2017/3/7 18:47, Michal Hocko wrote: > On Tue 07-03-17 18:33:53, Xishi Qiu wrote: >> MIGRATE_HIGHATOMIC page blocks are reserved for an atomic >> high-order allocation, so use it as late as possible. > > Why is this better? Are you seeing any problem which this patch > resolves? In other words the patch description should explain why not > only what (that is usually clear from looking at the diff). > Hi Michal, I have not see any problem yet, I think if we reserve more high order pageblocks, the more success rate we will get when meet an atomic high-order allocation, right? Thanks, Xishi Qiu >> Signed-off-by: Xishi Qiu >> --- >> mm/page_alloc.c | 6 ++---- >> 1 file changed, 2 insertions(+), 4 deletions(-) >> >> diff --git a/mm/page_alloc.c b/mm/page_alloc.c >> index 40d79a6..2331840 100644 >> --- a/mm/page_alloc.c >> +++ b/mm/page_alloc.c >> @@ -2714,14 +2714,12 @@ struct page *rmqueue(struct zone *preferred_zone, >> spin_lock_irqsave(&zone->lock, flags); >> >> do { >> - page = NULL; >> - if (alloc_flags & ALLOC_HARDER) { >> + page = __rmqueue(zone, order, migratetype); >> + if (!page && alloc_flags & ALLOC_HARDER) { >> page = __rmqueue_smallest(zone, order, MIGRATE_HIGHATOMIC); >> if (page) >> trace_mm_page_alloc_zone_locked(page, order, migratetype); >> } >> - if (!page) >> - page = __rmqueue(zone, order, migratetype); >> } while (page && check_new_pages(page, order)); >> spin_unlock(&zone->lock); >> if (!page) >> -- >> 1.8.3.1 >> >