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=-2.5 required=3.0 tests=MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 9BEB9C10F14 for ; Tue, 15 Oct 2019 12:16:09 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4F79621835 for ; Tue, 15 Oct 2019 12:16:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4F79621835 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 46svXj6CXQzDqwM for ; Tue, 15 Oct 2019 23:16:05 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; spf=softfail (mailfrom) smtp.mailfrom=kernel.org (client-ip=195.135.220.15; helo=mx1.suse.de; envelope-from=mhocko@kernel.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=fail (p=none dis=none) header.from=kernel.org Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 46svRp16G5zDr4Y for ; Tue, 15 Oct 2019 23:11:49 +1100 (AEDT) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 6BE98B2CF; Tue, 15 Oct 2019 12:11:46 +0000 (UTC) Date: Tue, 15 Oct 2019 14:11:45 +0200 From: Michal Hocko To: David Hildenbrand Subject: Re: [PATCH V6 1/2] mm/page_alloc: Make alloc_gigantic_page() available for general use Message-ID: <20191015121145.GG317@dhcp22.suse.cz> References: <1571131302-32290-1-git-send-email-anshuman.khandual@arm.com> <1571131302-32290-2-git-send-email-anshuman.khandual@arm.com> <9da1f196-51bd-06ac-c5dc-b55776fce2be@redhat.com> <20191015114723.GD317@dhcp22.suse.cz> <513bc2f7-8110-58f7-36c1-a04b59f11f7e@redhat.com> <20191015120956.GF317@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191015120956.GF317@dhcp22.suse.cz> User-Agent: Mutt/1.10.1 (2018-07-13) X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , linux-ia64@vger.kernel.org, linux-sh@vger.kernel.org, Peter Zijlstra , James Hogan , Tetsuo Handa , Heiko Carstens , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Paul Mackerras , sparclinux@vger.kernel.org, Thomas Gleixner , Andrea Arcangeli , linux-s390@vger.kernel.org, x86@kernel.org, Russell King - ARM Linux , Matthew Wilcox , Steven Price , Jason Gunthorpe , Gerald Schaefer , David Rientjes , linux-snps-arc@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Kees Cook , Anshuman Khandual , Masahiro Yamada , linuxppc-dev@lists.ozlabs.org, Mark Brown , "Kirill A . Shutemov" , Dan Williams , Vlastimil Babka , Oscar Salvador , Sri Krishna chowdary , Ard Biesheuvel , Greg Kroah-Hartman , Dave Hansen , linux-mips@vger.kernel.org, Ralf Baechle , Paul Burton , Mike Rapoport , Vineet Gupta , Martin Schwidefsky , Andrew Morton , Mel Gorman , "David S. Miller" , Mike Kravetz Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Tue 15-10-19 14:09:56, Michal Hocko wrote: > On Tue 15-10-19 13:50:02, David Hildenbrand wrote: > > On 15.10.19 13:47, Michal Hocko wrote: > > > On Tue 15-10-19 13:42:03, David Hildenbrand wrote: > > > [...] > > > > > -static bool pfn_range_valid_gigantic(struct zone *z, > > > > > - unsigned long start_pfn, unsigned long nr_pages) > > > > > -{ > > > > > - unsigned long i, end_pfn = start_pfn + nr_pages; > > > > > - struct page *page; > > > > > - > > > > > - for (i = start_pfn; i < end_pfn; i++) { > > > > > - if (!pfn_valid(i)) > > > > > - return false; > > > > > - > > > > > - page = pfn_to_page(i); > > > > > > > > Am I missing something or should here really be a pfn_to_online_page() here > > > > instead of a pfn_valid() ? > > > > > > http://lkml.kernel.org/r/20180423000943.GO17484@dhcp22.suse.cz > > > > > > > So we managed to add PageReserved(page) but not pfn_to_online_page(). But it > > is the right thing to do? (or am I missing something?) > > Yeah, pfn_to_online_page is better. But please note that this is an > optimistic check. The real check has to be done when isolating the > pageblock because things might change in the meantime. Except I have missed that we do get zone from the page and other undefined state. Scratch my above comment. -- Michal Hocko SUSE Labs