Received: by 10.213.65.68 with SMTP id h4csp186854imn; Fri, 23 Mar 2018 02:21:08 -0700 (PDT) X-Google-Smtp-Source: AG47ELs3bBGpUG6ezbOQC8J7NFNNFNalekYJveAWYlQLGczsICbceTiDWjEZ0HmYcobrb/HD8uvA X-Received: by 10.98.62.71 with SMTP id l68mr19125403pfa.98.1521796868354; Fri, 23 Mar 2018 02:21:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521796868; cv=none; d=google.com; s=arc-20160816; b=NxoiiKqWgX1d6j5iJIZWUgFjiPIgPIDvd4R5TTvl/R27ez5k16INEQfb8PgnTBwT4f zHP2VkakZHVEW8tTP/8u3H+AV60c3hJOiGjPve4T0HRvZxn+DrmDvISLJ5jVpX4ZBAsy rZJZephfIT7ci7ADSHpxMP7gfLRkoujqwoEEmMkeLOLn+mfEYYkdRCWedNiaVBWynNU3 N4h1PlbIuKU+tWWFBZSjL0LYoi5tMwdqM1zl/IbRFCK17xgZM7VQ1uiLxF3B++xmtpu9 T9/Psf1cfJjynqF5sOTGnAJ7eWApQlIHhchuFh7T7v+xQAhudnQpEy6Iwk8Crj1ZpTey W/EA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=HBkM1W6nRwpP9IdQWup+AgwY5OiZlJv62izjo8hiK2M=; b=FIlNiOnlwrIx5/RGTiXlsgOgiEDEyySnzVAg/VfpnTGITpFA+0teIRaebKP658VG52 FO+p5XKQFVYcHjJDPChanRRMvBqPPErce7Gpev5t9WOjA0EQraNchzKf0kNf9TFaqo5j 7RcHsENAWGy/ecbvGYCBMF9rlzvpS0TiBkoro6Ebw/LT6/hm7At3s24Odd/82a473vff kIkaKRvk3WuBpH/CKJUEfgiK1LCt6knJ3hopxcCDgcpQZI41ZizwZcC/he2Fbe1Fdray m4EDioCvpcZ2KMtudz0FqfbyCUlU4e3a0cZaacW+9akIUp3Xvb/uSlbs9hzalOho94AV g6nw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=PAKylw9U; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s10si6441475pfi.143.2018.03.23.02.20.53; Fri, 23 Mar 2018 02:21:08 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=PAKylw9U; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752469AbeCWJTd (ORCPT + 99 others); Fri, 23 Mar 2018 05:19:33 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:35359 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752284AbeCWJT1 (ORCPT ); Fri, 23 Mar 2018 05:19:27 -0400 Received: by mail-wm0-f67.google.com with SMTP id r82so2262013wme.0 for ; Fri, 23 Mar 2018 02:19:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=HBkM1W6nRwpP9IdQWup+AgwY5OiZlJv62izjo8hiK2M=; b=PAKylw9Ud14EmhyZpQfEJ/TCht2glMUNtFbFQpYF98bOX3Lgj/TPLQ6Uia7ZPYqPoC yBDY9cTg8Fq93sdtyQzgixH/CotXaZMweXBgt3zW+y5iFqbtjBnDH4HWduSuZAyg7RxX xtQAkebwflnk8PDaPhsPE6qdLh2EilyqAS9xEXlxzTXfubZ8zgGy9H8LlEAP4kKDU810 hVP/L5pFcSaWW284l5YEqSLarwcpWSDODEvoo4yOwetsKYRK2Uz57hTDqnRrwjWIar79 9Ts/FaziQVxAaya8xij9UbhGVMUrm+xle1nI/l0ZDWnnRbmzC+j4VkFCdIZqs62ktkdZ W3IA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=HBkM1W6nRwpP9IdQWup+AgwY5OiZlJv62izjo8hiK2M=; b=Nr4I48tS2x5osEIi9nNdlvi9UpUMYZ9QPvJxSaQ3n7Gr7nkEXnnLKoCMpFXgd03Ke9 tdc8M2m+nIDmAamjca/40hgWFAYq2uicoqJPpoL5DXPR2BmlwApOsi/MqZ7htB4OpjZC o1bTl6xpwD2uec1MgPbqS1g1y9/2ltyueMdkMrfdGY0uS3QUU2ojCPeu5T6HW6S4xh5v Iy7Cdn46Mip63tuJ3F/VNlnvZzXOyWCLwOGEGOfZMH7zaa8jfKTxnrDMAPsuKroqh09+ PWK8gldxlmNp0pMvzBQN4gqNAwd1aEco/fqDbbhgZq2710jGgXi4hiYlhQ531fGyb2wB 7UOQ== X-Gm-Message-State: AElRT7ELpx9Ib6TvyhEjvmcWakAoIKGcOFmLCD6v0vGWlQbuCJcW5cZM WYo+oDlQKGJJlWhvlPtBUn51v9oeEWVLqxNUeZY= X-Received: by 10.80.244.167 with SMTP id s36mr29215418edm.262.1521796766339; Fri, 23 Mar 2018 02:19:26 -0700 (PDT) MIME-Version: 1.0 Received: by 10.80.149.7 with HTTP; Fri, 23 Mar 2018 02:19:26 -0700 (PDT) In-Reply-To: <20180323083847.GJ23100@dhcp22.suse.cz> References: <1521791852-7048-1-git-send-email-zhaoyang.huang@spreadtrum.com> <20180323083847.GJ23100@dhcp22.suse.cz> From: Zhaoyang Huang Date: Fri, 23 Mar 2018 17:19:26 +0800 Message-ID: Subject: Re: [PATCH v1] mm: help the ALLOC_HARDER allocation pass the watermarki when CMA on To: Michal Hocko 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 23, 2018 at 4:38 PM, Michal Hocko wrote: > 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 > Thanks for the information. However, I can't find the commit in the latest mainline, is it merged? >> 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