Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp3512892ybz; Mon, 20 Apr 2020 04:23:12 -0700 (PDT) X-Google-Smtp-Source: APiQypKTnl6ec14I7FawwCu6hMv7gzK2sA1aQzGpfV6ZDBlmeF7EWX1NIthAG+E0sbU9tla3VQYJ X-Received: by 2002:a17:906:4cc3:: with SMTP id q3mr6551109ejt.170.1587381792056; Mon, 20 Apr 2020 04:23:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587381792; cv=none; d=google.com; s=arc-20160816; b=gDXGAaqIGiY0k00+2RcxX/FZj2a+ljq/5PTKIz8yLipmDrjlZnRXjLSKSLxDa1fPrn M6aNzca5GY6AZ+kypSLcglNZ5j6OB8zeVOYwcCcizzoUd+ZGfmHMX/p3jq4289FELV+3 Lui89KZcURa33EjBR4l5bab5mmUJrVqOt+8mAr1bjTBnr/IL7e5qIGezXmhH5tcAwGeJ piEBwLU9xMSS7QYSqxXwB/CsZuQvXZc0oSPjZgKTvdDf4kYPldekQhIcAL4j3F9uhQMs xDAqnWxY7XobuBmpaLjSjFVy9RvNGDdtWvaIceyVfxm4BTE2uJ9nxOtGD0yn1Do+yVRF ZTew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=f0cvpJYoLzD97qtyZ06Wi/pSIo+Zf1D3ZnjsqWEec+4=; b=tDBQH7wcz/3apDXyIx3aF8cQhAC3ElgFu4oxkHjYU193rXpss9A42+ivUeaSGKelxT baz9n70qKQw2EofrE3URfzHS5CHWtNv5MU+ymOaPuWfguJaoHFceD9JCOkN89BDuSd1S NlYPdUB93bSWVwCY6Wr0ZZbJ+RbwBaAZHQOzcafvHFymvNwjfCuOhaiS/cvgG0xMLoO3 ug+X1jAREoPMJ5ZR8suVsMtE9DQTua7id7aBVGWwiqUVaYT7bsQrGyBZulCT7Q6vsH1g HWxUTIaLDMhiXr+ZjBjwPR8YauG50BOeMLNCKgS+skAUnxXdOlwxL3L01/P70u+oPw8g oIMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=NQpj3uRg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l11si375253eja.20.2020.04.20.04.22.48; Mon, 20 Apr 2020 04:23:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=NQpj3uRg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726055AbgDTLUQ (ORCPT + 99 others); Mon, 20 Apr 2020 07:20:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48326 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725775AbgDTLUQ (ORCPT ); Mon, 20 Apr 2020 07:20:16 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 19F58C061A0C for ; Mon, 20 Apr 2020 04:20:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=f0cvpJYoLzD97qtyZ06Wi/pSIo+Zf1D3ZnjsqWEec+4=; b=NQpj3uRgKrebKItqEk5MSgmovV ZGyV/nJ32iVTWVz4HSCbk/lB/ENDVMLV7AylNHRPegzphNzNxZquGuW3BbJO8FwpSgDFj5FvR/a5i lZh9AOHIDVN8BR1Y5kpTuhY2rzFoxYBhuJBdwy2S0MHLsdwZTem75KHH554S2Yn+R/yoNuS2CIWTU aQwVO6UH0HwwKqkNjBHqw2soj35C7UM6HIw7aNx1zkGH+RmO6MzqjMQnIfZ8L4m6VcEuwASBqAT5H Up3sZvtk6xvWyvnwte4HXE4T29WmV/AxL2lDWgLY0jTfWfqJrY6cPJJjiuOr45FWMmhrB4TmDrOo6 2mCJjB7g==; Received: from willy by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jQUTC-0005QJ-Ff; Mon, 20 Apr 2020 11:20:10 +0000 Date: Mon, 20 Apr 2020 04:20:10 -0700 From: Matthew Wilcox To: js1304@gmail.com Cc: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Vlastimil Babka , Laura Abbott , "Aneesh Kumar K . V" , Mel Gorman , Michal Hocko , Johannes Weiner , Roman Gushchin , Minchan Kim , Rik van Riel , Christian Koenig , Huang Rui , Eric Biederman , "Rafael J . Wysocki" , Pavel Machek , Joonsoo Kim Subject: Re: [PATCH 01/10] mm/page-flags: introduce PageHighMemZone() Message-ID: <20200420112010.GA5820@bombadil.infradead.org> References: <1587369582-3882-1-git-send-email-iamjoonsoo.kim@lge.com> <1587369582-3882-2-git-send-email-iamjoonsoo.kim@lge.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1587369582-3882-2-git-send-email-iamjoonsoo.kim@lge.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 20, 2020 at 04:59:33PM +0900, js1304@gmail.com wrote: > ZONE_MOVABLE is special. It is considered as normal type zone on > !CONFIG_HIGHMEM, but, it is considered as highmem type zone > on CONFIG_HIGHMEM. Let's focus on later case. In later case, all pages > on the ZONE_MOVABLE has no direct mapping until now. > > However, following patchset > "mm/cma: manage the memory of the CMA area by using the ZONE_MOVABLE" > , which is once merged and reverted, will be tried again and will break > this assumption that all pages on the ZONE_MOVABLE has no direct mapping. > Hence, the ZONE_MOVABLE which is considered as highmem type zone could > have the both types of pages, direct mapped and not. Since > the ZONE_MOVABLE could have both type of pages, __GFP_HIGHMEM is still > required to allocate the memory from it. And, we conservatively need to > consider the ZONE_MOVABLE as highmem type zone. I don't understand why CMA allocating pages from ZONE_MOVABLE somehow gives these pages a direct mapping. Maybe you have a freaky layout in the architecture that makes no sense and that's what needs to be fixed? My understanding of the zones is based on x86, and it looks like this on a 32-bit system with 8GB of memory: ZONE_DMA 0-16MB ZONE_NORMAL 16-896MB ZONE_HIGHMEM 896-xMB ZONE_MOVABLE x-8192MB where x is a boot option used to partition the highmem between movable and unmovable. Now, why would allocating the CMA from ZONE_NORMAL suddenly make these pages part of the direct mapping?