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=-3.8 required=3.0 tests=BAYES_00, 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 61392C56201 for ; Tue, 10 Nov 2020 06:33:33 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D2AE62064C for ; Tue, 10 Nov 2020 06:33:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D2AE62064C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 249636B0036; Tue, 10 Nov 2020 01:33:32 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1D3B26B005C; Tue, 10 Nov 2020 01:33:32 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 04BC76B005D; Tue, 10 Nov 2020 01:33:31 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0009.hostedemail.com [216.40.44.9]) by kanga.kvack.org (Postfix) with ESMTP id C99EB6B0036 for ; Tue, 10 Nov 2020 01:33:31 -0500 (EST) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 6BB811EE6 for ; Tue, 10 Nov 2020 06:33:31 +0000 (UTC) X-FDA: 77467542222.28.price65_080dc11272f3 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin28.hostedemail.com (Postfix) with ESMTP id 39AA16D6E for ; Tue, 10 Nov 2020 06:33:31 +0000 (UTC) X-HE-Tag: price65_080dc11272f3 X-Filterd-Recvd-Size: 2806 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf42.hostedemail.com (Postfix) with ESMTP for ; Tue, 10 Nov 2020 06:33:30 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 6E1EEABCC; Tue, 10 Nov 2020 06:33:29 +0000 (UTC) Date: Tue, 10 Nov 2020 07:33:25 +0100 From: Oscar Salvador To: Muchun Song Cc: Jonathan Corbet , Mike Kravetz , Thomas Gleixner , mingo@redhat.com, bp@alien8.de, x86@kernel.org, hpa@zytor.com, dave.hansen@linux.intel.com, luto@kernel.org, Peter Zijlstra , viro@zeniv.linux.org.uk, Andrew Morton , paulmck@kernel.org, mchehab+huawei@kernel.org, pawan.kumar.gupta@linux.intel.com, Randy Dunlap , oneukum@suse.com, anshuman.khandual@arm.com, jroedel@suse.de, Mina Almasry , David Rientjes , Matthew Wilcox , Michal Hocko , Xiongchun duan , linux-doc@vger.kernel.org, LKML , Linux Memory Management List , linux-fsdevel Subject: Re: [External] Re: [PATCH v3 05/21] mm/hugetlb: Introduce pgtable allocation/freeing helpers Message-ID: <20201110063325.GA4286@localhost.localdomain> References: <20201110054250.GA2906@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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, Nov 10, 2020 at 02:08:46PM +0800, Muchun Song wrote: > The check should be added here. > > if (!pgtable) > return NULL; > > Just like my previous v2 patch does. In this case, we can drop those > checks. What do you think? It is too early for me, so bear with me. page_huge_pte will only return NULL in case we did not get to preallocate any pgtable right? What I was talimg about is that > > > page_huge_pte(page) = list_first_entry_or_null(&pgtable->lru, > > struct page, lru); here we will get the either a pgtable entry or NULL in case we already consumed all entries from the list. If that is the case, we can return NULL and let the caller known that we are done. Am I missing anything? -- Oscar Salvador SUSE L3