Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp6936912rwr; Wed, 10 May 2023 01:13:32 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7nK1UXkOOFiRO0b9R6Cha6qM95Oq/D6HKIOc2MmUV1aulHJCT63ANvWI+rj/b6RX8qReWM X-Received: by 2002:a05:6a00:10d2:b0:643:96bc:b292 with SMTP id d18-20020a056a0010d200b0064396bcb292mr18852120pfu.5.1683706412038; Wed, 10 May 2023 01:13:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683706412; cv=none; d=google.com; s=arc-20160816; b=cbryPrsz60cFebLukYC6GNZDx+Jo4f/hM+BbvRD3sEF+hF8YhwubrguhZVwIZ5Z95B yjuzZpko/MUqXra7Y0meCM4KBvJz57tuwHcF4uvfLerVJD3R4IyOJNdDZdRLrzVEqm1r beDYISulxZ3kthERWS9fJz3bqreEWsv3eD6DJ8FJ/thoRO94dMscMyYiafHkxEOWDCWh v1w61S1Reg7Dpmy4HXZ+NaPbFDt1bzhsIzPeMBkSwI/CplNNO2/St5MUGrgs/ztGLLGe OpBKYKovM+ooeOC8oBAsZ6pUe5qUqOAf7s7uVeQ7axGlUTb1MpW6L3YXcR+wj35nGS+a VLsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id; bh=DrU4Y1FQg/oc407oD4Clvf8qo1qRpZwslxDKni8EZw8=; b=Rz9pRJ0V9Qa6UgzqHczjJEH+Wt54/QXHJNID/6TYG2qWPPIINki5mitUSOvVZzCxvL RCpKJvqD5jvjRQOPPUgajXJEacgzX5Y2sv1pESSeKSFdkLd+KjijBqMrfU18EWNgqVDi 9gWLU9sq2SE+TJwW93HBBvyQsPc1m2nWChP7lp9SdDERPWjjeJfZ78qvV6Pcj3espw4h VGm9CrztttjXp+7w0n7DszD+dW2BQ3mm7f/1gZdjJrXiRl3xKHo0OKw6PsChHOWZMLH3 Ral9ZqcnJ94v+yHunRiVsdOZrWT3C2IihaYjIh0+HQ32eax2sZjfqOax3ALKw8TbCTo0 mTFA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b123-20020a62cf81000000b0063b72afb4cdsi4474285pfg.5.2023.05.10.01.13.20; Wed, 10 May 2023 01:13:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236479AbjEJIBc (ORCPT + 99 others); Wed, 10 May 2023 04:01:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52424 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235798AbjEJIBa (ORCPT ); Wed, 10 May 2023 04:01:30 -0400 Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4028DF0; Wed, 10 May 2023 01:01:28 -0700 (PDT) Received: (Authenticated sender: alex@ghiti.fr) by mail.gandi.net (Postfix) with ESMTPSA id 90583E000A; Wed, 10 May 2023 08:01:13 +0000 (UTC) Message-ID: <6ad10e79-74e5-7c48-d10c-78229187da32@ghiti.fr> Date: Wed, 10 May 2023 10:01:13 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH 14/23] riscv/hugetlb: pte_alloc_huge() pte_offset_huge() To: Hugh Dickins , Andrew Morton Cc: Mike Kravetz , Mike Rapoport , "Kirill A. Shutemov" , Matthew Wilcox , David Hildenbrand , Suren Baghdasaryan , Qi Zheng , Russell King , Catalin Marinas , Will Deacon , Geert Uytterhoeven , Greg Ungerer , Michal Simek , Thomas Bogendoerfer , Helge Deller , John David Anglin , "Aneesh Kumar K.V" , Michael Ellerman , Alexandre Ghiti , Palmer Dabbelt , Heiko Carstens , Christian Borntraeger , Claudio Imbrenda , John Paul Adrian Glaubitz , "David S. Miller" , Chris Zankel , Max Filippov , x86@kernel.org, linux-arm-kernel@lists.infradead.org, linux-ia64@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org References: <77a5d8c-406b-7068-4f17-23b7ac53bc83@google.com> Content-Language: en-US From: Alexandre Ghiti In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.9 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Hugh, On 5/10/23 06:59, Hugh Dickins wrote: > pte_alloc_map() expects to be followed by pte_unmap(), but hugetlb omits > that: to keep balance in future, use the recently added pte_alloc_huge() > instead; with pte_offset_huge() a better name for pte_offset_kernel(). > > Signed-off-by: Hugh Dickins > --- > arch/riscv/mm/hugetlbpage.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/arch/riscv/mm/hugetlbpage.c b/arch/riscv/mm/hugetlbpage.c > index a163a3e0f0d4..80926946759f 100644 > --- a/arch/riscv/mm/hugetlbpage.c > +++ b/arch/riscv/mm/hugetlbpage.c > @@ -43,7 +43,7 @@ pte_t *huge_pte_alloc(struct mm_struct *mm, > > for_each_napot_order(order) { > if (napot_cont_size(order) == sz) { > - pte = pte_alloc_map(mm, pmd, addr & napot_cont_mask(order)); > + pte = pte_alloc_huge(mm, pmd, addr & napot_cont_mask(order)); > break; > } > } > @@ -90,7 +90,7 @@ pte_t *huge_pte_offset(struct mm_struct *mm, > > for_each_napot_order(order) { > if (napot_cont_size(order) == sz) { > - pte = pte_offset_kernel(pmd, addr & napot_cont_mask(order)); > + pte = pte_offset_huge(pmd, addr & napot_cont_mask(order)); > break; > } > } Reviewed-by: Alexandre Ghiti Thanks, Alex