From patchwork Thu Jun 8 19:30:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hugh Dickins X-Patchwork-Id: 105120 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp506581vqr; Thu, 8 Jun 2023 12:53:46 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6tdohfEITNlUmMN0KeF/bNWJnPHaP4YYQHYkb10lFN1xl+jp4OdfRSzv+UKC2Vc/tUHhGy X-Received: by 2002:a05:6a00:cd4:b0:64c:e899:dcd1 with SMTP id b20-20020a056a000cd400b0064ce899dcd1mr13620786pfv.5.1686254026460; Thu, 08 Jun 2023 12:53:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686254026; cv=none; d=google.com; s=arc-20160816; b=WkNhWHv0F6NQLHKYqPUVB/b6QTeLMOPSelMTLejh0Bvu26mlAFMKxGwD5ItngYPHaP yD2PSdfS0TJKHsYmTbAhBJOtk2+nc+nvcS1kA68ctQ4T1lWroF9giNjm1nKzySDyL86x rF4n+Th5cL0M81/jEtqWo+Y12GBT79Cx8SIBpazlJ1fTHGKG0hUKKQQW9sqSrGEm+Dy0 H8ICiEtlE6lWZgytz202OEOr7Kh+Tpizjw1VwQVIuTwD676NOGyk3TWqdIEa8QY2S94B BEbcNq8WVLhxp2Hmb54xUhIVAg+M8RegqOxMOEaST/dWW02iERQbv4FHSO81lJgbEdlK c/Bg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:message-id:in-reply-to :subject:cc:to:from:date:dkim-signature; bh=mCwP+3tlZqvvMSbN25I242CI8N2o4w3/6RVIlVlj13g=; b=na7gGtVBd8MRHgcUfTN1SCar6ToANLp++QKM81bpVTuzhltBhhFeWCieiH2F/hkP4c kKDc3yu06/e8ANlO0i+q4/xItMmU0U0jv1LlIc3aX/frTUTkITi78O6uDGcBpp8zhsM3 6IUri4gOl4yOii5asCgntGkbFz+jqRc8iTPar9Qa6vbErG/xKpx6FnsIBcZoh5Btnlqo bUAR1LJWkcvejE91d046IYPXzf9Upb7y8UqpJ/NgdeAasD64sGFhYS5DTk7+zDp0fyif go8HZolgq8eLj91BxW5G0qcMEAhMgcUTy7EjOuohM0gVMC2noZQK7peT+jkGVSQnAbwe 5ThQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=Z+1ROWx9; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z17-20020a637e11000000b005348549fae5si1451879pgc.252.2023.06.08.12.53.32; Thu, 08 Jun 2023 12:53:46 -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; dkim=pass header.i=@google.com header.s=20221208 header.b=Z+1ROWx9; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233422AbjFHTad (ORCPT + 99 others); Thu, 8 Jun 2023 15:30:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45438 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235589AbjFHTa2 (ORCPT ); Thu, 8 Jun 2023 15:30:28 -0400 Received: from mail-il1-x130.google.com (mail-il1-x130.google.com [IPv6:2607:f8b0:4864:20::130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF9312134 for ; Thu, 8 Jun 2023 12:30:19 -0700 (PDT) Received: by mail-il1-x130.google.com with SMTP id e9e14a558f8ab-33b04c8f3eeso4381495ab.0 for ; Thu, 08 Jun 2023 12:30:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1686252619; x=1688844619; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to; bh=mCwP+3tlZqvvMSbN25I242CI8N2o4w3/6RVIlVlj13g=; b=Z+1ROWx9LnxdX5nt3Yo9Gw9A1LjKJHFc2WtgcRAYaFIpj6m1+MueknjL2tetH/Yt/E Jkma5NMQVv2CGzmJBnvKYmHLILgxFTZBZe29Vg5F330+u2fSbBPVEtX3NRx2YFJBGUmp kCJjjc7KvjHhyEDucY5j+/eHT1OpuVlzl/VgAMVyKWRQ9P9ksfEE7oKQrQHB2ZVzogis AlGkparAM9e3I8OX/wc+UGRKJ9WTDNWGaUDF7YaTiCVpSxpo1NNn2hyrTeXSAmMOPutQ TUN3B1UmJFKBBqlJCwM8cMmQBeV6xJ4ogL/1WbFBc8kxJTJPQLfJ0hWbM0sLcNxIcm/D dTzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686252619; x=1688844619; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=mCwP+3tlZqvvMSbN25I242CI8N2o4w3/6RVIlVlj13g=; b=HOM2GwKIR67WYuX8Vnyx9M97cqzy+DLF/lehMWxTlMG6vRJLbyGM+isz6mngd/lG74 4aeTewjkJ1LAt+z5nBVCWsUm0033HsWl2ugHlYFgfEJhltf/EP/+g2aQDzzzyn2d/Qhv AVWNtz0NuVaEGsy69/s33Og7MampQaZsjd/5VP6hVUF8RlfhnwR0zfn9NdU+Yr8aMKZb 29jfU8ma7sE3sH5odE0OGN6Aje5AM3tjc/Wb4XYsRw9rhlpYq84KB8piRl9kubXrS8Mw 8dO55eFj0E8w7bQGgFOqEV0vuuiGUx/m46aDPCSQxS3KYp21mXbM9OEkFAwTAZ8QE/pz IQSA== X-Gm-Message-State: AC+VfDwuRIV4q0SYiDOiUkRWFYpZZe4cp92MUg+JlkBWtSxSpcsYpcYa P7m8GhFqz4Ny/HLSsDCdahMnWQ== X-Received: by 2002:a92:d34a:0:b0:33b:820:41ad with SMTP id a10-20020a92d34a000000b0033b082041admr8096921ilh.9.1686252619199; Thu, 08 Jun 2023 12:30:19 -0700 (PDT) Received: from ripple.attlocal.net (172-10-233-147.lightspeed.sntcca.sbcglobal.net. [172.10.233.147]) by smtp.gmail.com with ESMTPSA id h184-20020a256cc1000000b00bad07875d9bsm450282ybc.11.2023.06.08.12.30.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Jun 2023 12:30:18 -0700 (PDT) Date: Thu, 8 Jun 2023 12:30:14 -0700 (PDT) From: Hugh Dickins X-X-Sender: hugh@ripple.attlocal.net To: Andrew Morton cc: Mike Kravetz , Mike Rapoport , "Kirill A. Shutemov" , Matthew Wilcox , David Hildenbrand , Suren Baghdasaryan , Qi Zheng , Peter Zijlstra , 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 , Alexander Gordeev , 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 Subject: [PATCH v2 17/23] sh/hugetlb: pte_alloc_huge() pte_offset_huge() In-Reply-To: Message-ID: References: MIME-Version: 1.0 X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768165501863022803?= X-GMAIL-MSGID: =?utf-8?q?1768165501863022803?= 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/sh/mm/hugetlbpage.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/sh/mm/hugetlbpage.c b/arch/sh/mm/hugetlbpage.c index 999ab5916e69..6cb0ad73dbb9 100644 --- a/arch/sh/mm/hugetlbpage.c +++ b/arch/sh/mm/hugetlbpage.c @@ -38,7 +38,7 @@ pte_t *huge_pte_alloc(struct mm_struct *mm, struct vm_area_struct *vma, if (pud) { pmd = pmd_alloc(mm, pud, addr); if (pmd) - pte = pte_alloc_map(mm, pmd, addr); + pte = pte_alloc_huge(mm, pmd, addr); } } } @@ -63,7 +63,7 @@ pte_t *huge_pte_offset(struct mm_struct *mm, if (pud) { pmd = pmd_offset(pud, addr); if (pmd) - pte = pte_offset_map(pmd, addr); + pte = pte_offset_huge(pmd, addr); } } }