Received: by 10.213.65.68 with SMTP id h4csp162567imn; Fri, 23 Mar 2018 01:40:01 -0700 (PDT) X-Google-Smtp-Source: AG47ELvSBwT9VlwVpbXpLF95Th6aizoJyg2nJJxcAeuOQvtNTjp+HeGcFdGsnXOQvB+D1dvJ5zpo X-Received: by 10.99.99.194 with SMTP id x185mr20119876pgb.4.1521794400978; Fri, 23 Mar 2018 01:40:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521794400; cv=none; d=google.com; s=arc-20160816; b=cVuGMjlIAo2blASBKwcK52SrI3xZZjeaclXvTFlUtG1xDHPg9jkhR37bb6dvPW+g/G IoN7S8EdbxA67dsxNfNbPvCOpUNlHFP4myd3nuCvbyQflZoiN3R/G3EAJaac7OJ16XHX 77RPluJpfPbxmYbE/mtdnIdCqgot+fSaPSDoyxIkcePMKws9PxKN9MIUHu49VDAtDYoK 39uw3pe3WJA/6M87MlkGzu6MvaQklwtWKYLW5QO80boQyp9WHAEL7ELItRToGV2gWNYL kaBpG3Glw2VI+ynC+ekHXQHYlWPSEztCuHD+wDVahuPU2G5ljcbnwORGsfx17rkOPHOI FgXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=MpYsI/hFRxjOSPBjf6scM2nGreEMNDCcMDLSwSb74Ng=; b=bvd6Uo+xjqo4NcLC1HjcdpMXePq+R9IU6xjMzCBFAYBSk4XSEe9qJ84/kTR84f8tLD 4YFshgIS8IB+I/OACgBxWWhhR4sbXU3pzp2hoLSrxQjON7wTCobysCyyCGU2nKIOhGfe x9FEQGwwrzgQeahDaheiJVrNay5mRb+m4mtsuxi+iXZJglM33HDgyjnJ4cQAcA7Z6Wv2 JyBRu4k1A+lDWeKyVFxene1uwRqBre1/imsYNwBvs7wwffylEt6TtyULag4SNap4Lm87 JoBxY4BjUSTaef42QgFbX2cHOEAUfskNVyvK8BfGvFsAe6AqnaCqX8eeDzogpYH1bymK yFQA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c2si5664931pgq.675.2018.03.23.01.39.45; Fri, 23 Mar 2018 01:40:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751694AbeCWIiv (ORCPT + 99 others); Fri, 23 Mar 2018 04:38:51 -0400 Received: from mx2.suse.de ([195.135.220.15]:60052 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751221AbeCWIiu (ORCPT ); Fri, 23 Mar 2018 04:38:50 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id D0172ACD2; Fri, 23 Mar 2018 08:38:48 +0000 (UTC) Date: Fri, 23 Mar 2018 09:38:47 +0100 From: Michal Hocko To: Zhaoyang Huang Cc: zhaoyang.huang@spreadtrum.com, Andrew Morton , Vlastimil Babka , Mel Gorman , Johannes Weiner , vel Tatashin , Tetsuo Handa , linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-patch-test@lists.linaro.org Subject: Re: [PATCH v1] mm: help the ALLOC_HARDER allocation pass the watermarki when CMA on Message-ID: <20180323083847.GJ23100@dhcp22.suse.cz> References: <1521791852-7048-1-git-send-email-zhaoyang.huang@spreadtrum.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1521791852-7048-1-git-send-email-zhaoyang.huang@spreadtrum.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri 23-03-18 15:57:32, Zhaoyang Huang wrote: > For the type of 'ALLOC_HARDER' page allocation, there is an express > highway for the whole process which lead the allocation reach __rmqueue_xxx > easier than other type. > However, when CMA is enabled, the free_page within zone_watermark_ok() will > be deducted for number the pages in CMA type, which may cause the watermark > check fail, but there are possible enough HighAtomic or Unmovable and > Reclaimable pages in the zone. So add 'alloc_harder' here to > count CMA pages in to clean the obstacles on the way to the final. This is no longer the case in the current mmotm tree. Have a look at Joonsoo's zone movable based CMA patchset http://lkml.kernel.org/r/1512114786-5085-1-git-send-email-iamjoonsoo.kim@lge.com > Signed-off-by: Zhaoyang Huang > --- > mm/page_alloc.c | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > index 635d7dd..cc18620 100644 > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -3045,8 +3045,11 @@ bool __zone_watermark_ok(struct zone *z, unsigned int order, unsigned long mark, > > > #ifdef CONFIG_CMA > - /* If allocation can't use CMA areas don't use free CMA pages */ > - if (!(alloc_flags & ALLOC_CMA)) > + /* > + * If allocation can't use CMA areas and no alloc_harder set for none > + * order0 allocation, don't use free CMA pages. > + */ > + if (!(alloc_flags & ALLOC_CMA) && (!alloc_harder || !order)) > free_pages -= zone_page_state(z, NR_FREE_CMA_PAGES); > #endif > > -- > 1.9.1 > -- Michal Hocko SUSE Labs