From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C6ED3C54FCB for ; Mon, 20 Apr 2020 11:20:17 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 8B84520747 for ; Mon, 20 Apr 2020 11:20:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="NQpj3uRg" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8B84520747 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 295008E0005; Mon, 20 Apr 2020 07:20:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 244D08E0003; Mon, 20 Apr 2020 07:20:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 15B3D8E0005; Mon, 20 Apr 2020 07:20:17 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0180.hostedemail.com [216.40.44.180]) by kanga.kvack.org (Postfix) with ESMTP id 00FF38E0003 for ; Mon, 20 Apr 2020 07:20:16 -0400 (EDT) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id B2B28181AEF39 for ; Mon, 20 Apr 2020 11:20:16 +0000 (UTC) X-FDA: 76727989632.22.dog62_59aee419d9a56 X-HE-Tag: dog62_59aee419d9a56 X-Filterd-Recvd-Size: 3777 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf19.hostedemail.com (Postfix) with ESMTP for ; Mon, 20 Apr 2020 11:20:16 +0000 (UTC) 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> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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?