From patchwork Wed May 10 04:58:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hugh Dickins X-Patchwork-Id: 91864 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp3370301vqo; Tue, 9 May 2023 22:07:45 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6Ok28bsgolM0ymr+Jc8O3+skeHKD+ShT7tINKzSsZFkcO2qKb8Wjv3YHFRRmsi2pLt/93T X-Received: by 2002:a05:6a00:244e:b0:634:7ba3:d142 with SMTP id d14-20020a056a00244e00b006347ba3d142mr22128410pfj.10.1683695265128; Tue, 09 May 2023 22:07:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683695265; cv=none; d=google.com; s=arc-20160816; b=sNN9pWGqde5sNaucO1kV/jqQFdJiLspsGv9NsMuDVMrFpMsgdao/hMkPKv/v8RTiZa kMDOYiiTkiLCcTh5VymUh0VQYElisqiaaHiZ/iWj3YPM5h9xh32b4EIj5CkQNH39Ku0Y u8RBcU14MLAvR1Z8OkpY2cRLANGeZ8FHSKuT6a2BVr/Q1f8BhVHUZMZLhU0Dub80Qwwv cTXeu6b1npytzXsjgVn+hdfJOtNJrLm19tLd3XDQ4mL5L6sGvPK9Byg1O4rY9gKZUioO Bf1KLBpFvBz701xpYXF9JBfZKmex+amovgW+Kdhkj0SfyfWzKaSexj8BJFn2yKkHiI0M 1Euw== 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=i7vs80eeAHoowuGiB3IXr1R0pQ52ZVhylKFRPge1iSc=; b=TGsYySrpxK0Q/c6xl2L5OWtip7S1bVoQQ0Qab/j6dN7X2WKapQkBJAkST+ySRltqEa S9Ac+TWVMHyGTTJpMEoF9Jv38DQtUJxF5rrYHqNqW98fxDOEyxv4QYT+HVxLB4qwNepU iNJOBf6s/2F58YOtMfQ55y8kkx7bZ5NVT8FvrZ8CtdhH3BAFC6ok5GBTgatYF+jTNBaM fnyi5dsNKgJe+jEZnqITn9/M9u2ZAELyDTWs+VNfK7lvhTwSaBkCNzS6sjYhtMwvieqY p4ss8gjk37GuW3R+2CWOqmxbc4hXu2jempxJaBEp5a1jdA6tIjrtwu8oolLj0sKV+022 VpRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=P9kK3Ha7; 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 y187-20020a638ac4000000b005142038a8c7si3280680pgd.291.2023.05.09.22.07.32; Tue, 09 May 2023 22:07:45 -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=P9kK3Ha7; 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 S235734AbjEJE7A (ORCPT + 99 others); Wed, 10 May 2023 00:59:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53588 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235687AbjEJE6z (ORCPT ); Wed, 10 May 2023 00:58:55 -0400 Received: from mail-yb1-xb2e.google.com (mail-yb1-xb2e.google.com [IPv6:2607:f8b0:4864:20::b2e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7DE5F1FD2 for ; Tue, 9 May 2023 21:58:53 -0700 (PDT) Received: by mail-yb1-xb2e.google.com with SMTP id 3f1490d57ef6-b9d881ad689so8687594276.2 for ; Tue, 09 May 2023 21:58:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1683694732; x=1686286732; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to; bh=i7vs80eeAHoowuGiB3IXr1R0pQ52ZVhylKFRPge1iSc=; b=P9kK3Ha7kM6a70P/N9uB2lWXrssqQgUHBWNV/ZpJwPmg2mPzx8gUi6+Y5U3HPMDHz9 0fAlFOi/bTART9baPPENUGYRX+MazYzuiDcAIMOosxi9lXkJsm3mNsaLjOWtnLwgcry5 sP0r/lFyFBNCqz3voFtKwARlNZyj767HfljqLFdQYp3UaORt42cJzHdk0VN4kJ5NQH/7 DWlXvI97puE4OaBtmUgMd/qH5Lin+XJ2aRjT13gN8vWtWVfPYNVNo8e918/mLGqALa1y O7U3+kDK92dAzqxBb57AmVgMsRrk/0cmMw+aKo8waotZHzpB3mgtMwAgWyIj42FB5uoU 5erQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683694732; x=1686286732; 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=i7vs80eeAHoowuGiB3IXr1R0pQ52ZVhylKFRPge1iSc=; b=dKagHNSJhP60IthC1u6m9rVMbdJm/H13InEaVSeH87C569jdtlhEmrCMa8Ec7umuhz yFvm7AENMNuDWNS/dTcvNc5wfNHgLrKq3EuQ/Ya0Gwk6AE4+zFPxhcHkZ7FtDruWANz/ s3i8h0OTJydCIAMzEqgv/B4jTzzHH229xrFblAcv0wISx/VcAXRcNKjxTF+KAJ5c0rMB h4E7VuSbvCgRVi2LowePPnK6OdKuKrpTVg2NpdUVZ+Evf89iGy4Nedc9DkuaufZvCwEC fg57+iDSpU9vQnP77Ajvn6RQHQrx7JfR3OT2WiZBstD4mFR3mhFDiRfEbtZSy1GITcFP 78Fg== X-Gm-Message-State: AC+VfDwX4ujmPfvFtVmKxj7Tjt7LX47UrHvRnDAbd7JyKB2Ko59R9TRm 0UNnfZILemAQ/5DD85RcIlO6lQ== X-Received: by 2002:a25:d352:0:b0:ba2:16b6:b11e with SMTP id e79-20020a25d352000000b00ba216b6b11emr16144172ybf.0.1683694732647; Tue, 09 May 2023 21:58:52 -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 h66-20020a252145000000b00b9550fcb12fsm3461906ybh.64.2023.05.09.21.58.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 May 2023 21:58:52 -0700 (PDT) Date: Tue, 9 May 2023 21:58:48 -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 , 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 Subject: [PATCH 13/23] powerpc/hugetlb: pte_alloc_huge() In-Reply-To: <77a5d8c-406b-7068-4f17-23b7ac53bc83@google.com> Message-ID: <1a3ee4d4-a829-35d4-d94e-885d5d4d6a8a@google.com> References: <77a5d8c-406b-7068-4f17-23b7ac53bc83@google.com> 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?1765482446015588775?= X-GMAIL-MSGID: =?utf-8?q?1765482446015588775?= 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. huge_pte_offset() is using __find_linux_pte(), which is using pte_offset_kernel() - don't rename that to _huge, it's more complicated. Signed-off-by: Hugh Dickins --- arch/powerpc/mm/hugetlbpage.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/mm/hugetlbpage.c b/arch/powerpc/mm/hugetlbpage.c index b900933507da..f7c683b672c1 100644 --- a/arch/powerpc/mm/hugetlbpage.c +++ b/arch/powerpc/mm/hugetlbpage.c @@ -183,7 +183,7 @@ pte_t *huge_pte_alloc(struct mm_struct *mm, struct vm_area_struct *vma, return NULL; if (IS_ENABLED(CONFIG_PPC_8xx) && pshift < PMD_SHIFT) - return pte_alloc_map(mm, (pmd_t *)hpdp, addr); + return pte_alloc_huge(mm, (pmd_t *)hpdp, addr); BUG_ON(!hugepd_none(*hpdp) && !hugepd_ok(*hpdp));