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 0B881ECE58F for ; Tue, 15 Oct 2019 12:10:04 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id CD83821928 for ; Tue, 15 Oct 2019 12:10:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CD83821928 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 54D098E0005; Tue, 15 Oct 2019 08:10:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4FD848E0001; Tue, 15 Oct 2019 08:10:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3EB508E0005; Tue, 15 Oct 2019 08:10:03 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0022.hostedemail.com [216.40.44.22]) by kanga.kvack.org (Postfix) with ESMTP id 180718E0001 for ; Tue, 15 Oct 2019 08:10:03 -0400 (EDT) Received: from smtpin05.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with SMTP id B4147181AF5C7 for ; Tue, 15 Oct 2019 12:10:02 +0000 (UTC) X-FDA: 76045900644.05.plate79_3a8921a5eab1f X-HE-Tag: plate79_3a8921a5eab1f X-Filterd-Recvd-Size: 4142 Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) by imf21.hostedemail.com (Postfix) with ESMTP for ; Tue, 15 Oct 2019 12:10:02 +0000 (UTC) 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 574D7B316; Tue, 15 Oct 2019 12:09:59 +0000 (UTC) Date: Tue, 15 Oct 2019 14:09:56 +0200 From: Michal Hocko To: David Hildenbrand Cc: Anshuman Khandual , linux-mm@kvack.org, Andrew Morton , Vlastimil Babka , Greg Kroah-Hartman , Thomas Gleixner , Mike Rapoport , Mike Kravetz , Jason Gunthorpe , Dan Williams , Peter Zijlstra , Mark Rutland , Mark Brown , Steven Price , Ard Biesheuvel , Masahiro Yamada , Kees Cook , Tetsuo Handa , Matthew Wilcox , Sri Krishna chowdary , Dave Hansen , Russell King - ARM Linux , Michael Ellerman , Paul Mackerras , Martin Schwidefsky , Heiko Carstens , "David S. Miller" , Vineet Gupta , James Hogan , Paul Burton , Ralf Baechle , "Kirill A . Shutemov" , Gerald Schaefer , Christophe Leroy , David Rientjes , Andrea Arcangeli , Oscar Salvador , Mel Gorman , linux-snps-arc@lists.infradead.org, linux-mips@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-ia64@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH V6 1/2] mm/page_alloc: Make alloc_gigantic_page() available for general use Message-ID: <20191015120956.GF317@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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <513bc2f7-8110-58f7-36c1-a04b59f11f7e@redhat.com> User-Agent: Mutt/1.10.1 (2018-07-13) 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 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. -- Michal Hocko SUSE Labs 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 8019BC10F14 for ; Tue, 15 Oct 2019 12:13:26 +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 374D3205F4 for ; Tue, 15 Oct 2019 12:13:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 374D3205F4 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 46svTY5Lm4zDqx6 for ; Tue, 15 Oct 2019 23:13:21 +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 46svPm5NH4zDqnc for ; Tue, 15 Oct 2019 23:10:04 +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 574D7B316; Tue, 15 Oct 2019 12:09:59 +0000 (UTC) Date: Tue, 15 Oct 2019 14:09:56 +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: <20191015120956.GF317@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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <513bc2f7-8110-58f7-36c1-a04b59f11f7e@redhat.com> 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 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. -- Michal Hocko SUSE Labs 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=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,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 E8A9AECE588 for ; Tue, 15 Oct 2019 12:10:16 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 BAFCC21925 for ; Tue, 15 Oct 2019 12:10:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="GxIikEgi" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BAFCC21925 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-snps-arc-bounces+linux-snps-arc=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=OkYTG5bNlnswz8vT/2xWLEvObMvenhf0qqvY9upKYQM=; b=GxIikEgiYrblSX oPZ6sG9GLbr6NZSL2fEkzhL6WvZK5vYHGvDBDdVvQD0vvlnWWsutk3EOXNbWmMIYmx/FDb2j8hu9W JmbtkGyBpRlGjEC5/bGZLsesA1Cl2ZRMEAKtlWy8hsg7bFEje127zqLtnj/oELg35dn8QYAlKIf44 NCsXQm6ewp1qcNgp1C/7Nq6Hfi945//QnqDvm/qKdmsRjmReCz72kJUwuaR1x4RQl1TXIxcsNJsLD GG4RgpxdXvmX5Pnzyi5zWyl9bDunUWbXjofscwENmNL/HllJCvK/LZwR0Wc6SkgCQ1YktmES0YA7Z W5QdvgcwtJXrVAXHgZNg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iKLeZ-0003XA-9Q; Tue, 15 Oct 2019 12:10:15 +0000 Received: from mx2.suse.de ([195.135.220.15] helo=mx1.suse.de) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iKLeM-0002C5-JQ; Tue, 15 Oct 2019 12:10:04 +0000 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 574D7B316; Tue, 15 Oct 2019 12:09:59 +0000 (UTC) Date: Tue, 15 Oct 2019 14:09:56 +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: <20191015120956.GF317@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> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <513bc2f7-8110-58f7-36c1-a04b59f11f7e@redhat.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191015_051002_796302_1826494B X-CRM114-Status: GOOD ( 14.86 ) X-BeenThere: linux-snps-arc@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on Synopsys ARC Processors 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, Michael Ellerman , 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 , Christophe Leroy , 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+linux-snps-arc=archiver.kernel.org@lists.infradead.org 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. -- Michal Hocko SUSE Labs _______________________________________________ linux-snps-arc mailing list linux-snps-arc@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-snps-arc 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=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,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 22233ECE596 for ; Tue, 15 Oct 2019 12:10:21 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 D9B1F205F4 for ; Tue, 15 Oct 2019 12:10:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="DtGzCM1F" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D9B1F205F4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=eAuDw5tI0EvoNDhQb17byO1tkrMkdAbUippQ4hwtPBU=; b=DtGzCM1FdJElyz Wg3mSFhzhmyfK4our5lGVVmZXJ56hs30HWoQhih5mOlELIMtslbYwUFUzz6/iDosjkN853qjyfPN+ 8Uhm10RDZlzWZvQImwF77sSRsj/qh/oNswfLn62kI9b/AWp3wgIne7Wc7M24SyM/kDGTUEqD1tKqQ GbK0O6YC9D7j1Ee6Fk+eNEfjama5Gf0nyrUXiW1up4PhEF4h/uO4Ldc/vGiqznaccJs/R8Bx4PZNR Dxz3gy1ET1U2r1iq2DWSCixlFmWsfjLwTfzrR0vw/MXKoMeQSoH7QuaCOz0vSUVih9GtT6Flq6wic ozcUbim2YRR4plAcCuBA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iKLeR-0002qs-1y; Tue, 15 Oct 2019 12:10:07 +0000 Received: from mx2.suse.de ([195.135.220.15] helo=mx1.suse.de) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iKLeM-0002C5-JQ; Tue, 15 Oct 2019 12:10:04 +0000 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 574D7B316; Tue, 15 Oct 2019 12:09:59 +0000 (UTC) Date: Tue, 15 Oct 2019 14:09:56 +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: <20191015120956.GF317@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> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <513bc2f7-8110-58f7-36c1-a04b59f11f7e@redhat.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191015_051002_796302_1826494B X-CRM114-Status: GOOD ( 14.86 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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, Michael Ellerman , 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 , Christophe Leroy , 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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. -- Michal Hocko SUSE Labs _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel