Received: by 10.213.65.68 with SMTP id h4csp1635442imn; Thu, 5 Apr 2018 00:46:06 -0700 (PDT) X-Google-Smtp-Source: AIpwx4894MdOX2nTawPaGwoqU6igXcEDiLhXAE51LvJkh/2FKzjHGN5AdPTOdPSAouUjQsQ2YJ9i X-Received: by 2002:a17:902:6b8b:: with SMTP id p11-v6mr22028794plk.213.1522914366732; Thu, 05 Apr 2018 00:46:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522914366; cv=none; d=google.com; s=arc-20160816; b=jwSDKVM4nXfkxu2/KB91/T6T99iALql1n0tJN7O/GXIBr+X01R9+UhxjRWt20A0xOp V51XkjnWOFmFvuZw9Kj/l7QXlxb4DWQ0ny5d9xzIb6PAyUkfhuEMZSuA/7eP7N4/Zi9e voWylUArRmS1YOilufE1ETdcLyh3r22yb+iKJm43/jxRQ7a3L70qcoWs7RE3oo07WUeA LTECdj+b8h3UuVhIqv8tS88ePK1PIeD9OhmJRdVukMGuP+TiDQ3nmX2sidiQgrikWEXO XzLPLxxuR6QMnpg9oXLQNFZZouaFG/h+AwixyZBSFxiLSh1b4iVOUD1RWVnwuRjHe/6N bvFA== 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=KaW5OVSYrjgY8EPA3XPYF5HNSPvFmoSTECxB/nViIxI=; b=OwSmq1sjF4U7xQ458ibT0oyziRU/xa8nBsW8cJBSp7VTTXdQtGCVwGg9z+BBZP6eBZ CZrR89g1xbt6xxA9Qvmxet/UHIcLtatuv8rGr+n0kVpk1InmHuSuWC8DCANb6Vj+Bhof Wl50hnJaR/Q8kmfFG21GCSWFE3gUsltPv+5tR/R5opaVPCx2yzzNWqc1i6SAs4CVwXf+ K2jTk9t1ALHXhDCJVEQILu9bFXx5/b+MutteutQS64c/2astTq/WbREkiDVRMIVSYuKL na+4hN1VNLEEaula5xDGMvGgO9OLflAu1i4EOFCZkIlA5B6odaePGx0lZUocrtwK/8X6 flNA== 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 207si5666288pfz.108.2018.04.05.00.45.52; Thu, 05 Apr 2018 00:46:06 -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 S1751389AbeDEHoj (ORCPT + 99 others); Thu, 5 Apr 2018 03:44:39 -0400 Received: from lgeamrelo12.lge.com ([156.147.23.52]:49442 "EHLO lgeamrelo12.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751097AbeDEHoi (ORCPT ); Thu, 5 Apr 2018 03:44:38 -0400 Received: from unknown (HELO lgeamrelo01.lge.com) (156.147.1.125) by 156.147.23.52 with ESMTP; 5 Apr 2018 16:44:35 +0900 X-Original-SENDERIP: 156.147.1.125 X-Original-MAILFROM: iamjoonsoo.kim@lge.com Received: from unknown (HELO localhost) (10.177.220.142) by 156.147.1.125 with ESMTP; 5 Apr 2018 16:44:34 +0900 X-Original-SENDERIP: 10.177.220.142 X-Original-MAILFROM: iamjoonsoo.kim@lge.com Date: Thu, 5 Apr 2018 16:44:34 +0900 From: Joonsoo Kim To: Andrew Morton Cc: Michal Hocko , Zhaoyang Huang , zhaoyang.huang@spreadtrum.com, 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: <20180405074433.GA31920@js1304-desktop> References: <1521791852-7048-1-git-send-email-zhaoyang.huang@spreadtrum.com> <20180323083847.GJ23100@dhcp22.suse.cz> <20180323093327.GM23100@dhcp22.suse.cz> <20180323130408.0c6451fac02c49b535ec7485@linux-foundation.org> <20180404003028.GA6628@js1304-desktop> <20180404153703.8f9f04df4c991554f3bf0434@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180404153703.8f9f04df4c991554f3bf0434@linux-foundation.org> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 04, 2018 at 03:37:03PM -0700, Andrew Morton wrote: > On Wed, 4 Apr 2018 09:31:10 +0900 Joonsoo Kim wrote: > > > On Fri, Mar 23, 2018 at 01:04:08PM -0700, Andrew Morton wrote: > > > On Fri, 23 Mar 2018 10:33:27 +0100 Michal Hocko wrote: > > > > > > > On Fri 23-03-18 17:19:26, Zhaoyang Huang wrote: > > > > > 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? > > > > > > > > Not yet. It is still sitting in the mmomt tree. I am not sure what is > > > > the merge plan but I guess it is still waiting for some review feedback. > > > > > > http://lkml.kernel.org/r/20171222001113.GA1729@js1304-P5Q-DELUXE > > > > > > That patchset has been floating about since December and still has > > > unresolved issues. > > > > > > Joonsoo, can you please let us know the status? > > > > Hello, Andrew. > > Sorry for a late response. > > > > Today, I finally have answered the question from Michal and it seems > > that there is no problem at all. > > > > http://lkml.kernel.org/r/CAAmzW4NGv7RyCYyokPoj4aR3ySKub4jaBZ3k=pt_YReFbByvsw@mail.gmail.com > > > > You can merge the patch as is. > > > > hm. > > There was also a performance regression reported: > http://lkml.kernel.org/r/20180102063528.GG30397@yexl-desktop I analyze the report and may find the reason. When we uses more zones, min_free_kbytes is increased for avoiding fragmentation if THP is enabled. This patch uses one more zone to manage CMA memory so min_free_kbytes and thus min_watermark is increased. It would reduce our usable memory and cause regression. However, this reservation for fragmentation isn't needed for ZONE_MOVABLE since it has only movable pages so I send a patch to fix it. http://lkml.kernel.org/r/<1522913236-15776-1-git-send-email-iamjoonsoo.kim@lge.com> I'm not sure that it is a root cause of above performance regression but I highly anticipate that they are related. I will ask the reporter to test this patch on top of that. Thanks.