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: 13236383 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 29CC3C77B7C for ; Wed, 10 May 2023 04:58:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BAAE26B0071; Wed, 10 May 2023 00:58:55 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B5B706B0072; Wed, 10 May 2023 00:58:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9FCFD6B0074; Wed, 10 May 2023 00:58:55 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 91FE56B0071 for ; Wed, 10 May 2023 00:58:55 -0400 (EDT) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 646101A04C9 for ; Wed, 10 May 2023 04:58:55 +0000 (UTC) X-FDA: 80773140630.27.C9D5CA3 Received: from mail-yb1-f169.google.com (mail-yb1-f169.google.com [209.85.219.169]) by imf02.hostedemail.com (Postfix) with ESMTP id 974F580007 for ; Wed, 10 May 2023 04:58:53 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=google.com header.s=20221208 header.b=P9kK3Ha7; spf=pass (imf02.hostedemail.com: domain of hughd@google.com designates 209.85.219.169 as permitted sender) smtp.mailfrom=hughd@google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1683694733; a=rsa-sha256; cv=none; b=OS1DPox38E6WWyoz3weHLTOa+J9Qlpar7pRS6hEt4D+bM0PJ93PRk/rSubt5eu2xXHQg/t A8piKaKF4o4ptnYKT2A3Xr4AyJIj9VN0OlLQ0LvE5tTT4sJmJF8/jmWFSC0bSEOOIAAs7f APrhR0nutcOtF1BfxCNkbNEt625bvW4= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=google.com header.s=20221208 header.b=P9kK3Ha7; spf=pass (imf02.hostedemail.com: domain of hughd@google.com designates 209.85.219.169 as permitted sender) smtp.mailfrom=hughd@google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1683694733; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=i7vs80eeAHoowuGiB3IXr1R0pQ52ZVhylKFRPge1iSc=; b=AlnjKQ4cA4GMJrSprVqE/7dSa/AYYsD3KRgv+LWWp+07QHgoVFwte0OUCB7wMd2LqfizpN IKh+xQKy1vF2OYye9Awro/xS5LY8spOeWCqfptrfYE3brC1+eJ5V48mIhybbALOXBBjHN+ qkakAanFuMIUeCddy/hDjdOqBrk/W/M= Received: by mail-yb1-f169.google.com with SMTP id 3f1490d57ef6-b9e6ec482b3so8690389276.3 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=gDDFML35qybhOFRIw8QskUwx8I3Gco8clMFleyFcSQXv+B0DxKEoZILGkxcJWrpBCw cvywJD9ZCVa/SqCP53cLDBGOjzKksUS/b15Lz1LfW2utubwidbWiqicovVpWodK5NvuF uKLitmU5J6y38vpBND1+u58owhIjgrfqbguFLdVZU1aX8EAHY1JuQGaXbJz8hSyJeAyG mBSLPM04sjsga5X0OTFABcy7INVLAuHAJqfuVjhWfJVVpX0NVLsWlfaFSb9rRKJ+S2qX NbfGzhCZbA1qZ5in5hpbXihmpp5reMsz0j0iARr90QgpqajZ0AOjTQbuad8Ivdwqr/3h mykw== X-Gm-Message-State: AC+VfDxr4lzeyxW8LSRb0yiyR3TVnnsBCPLb5uMOWRJVPJRSCxGs78er bWDKLbrZYiJuCJmy4GHhgsoyQw== X-Google-Smtp-Source: ACHHUZ6HrZAnm+aaG2sOhULY3F7mb+ht2GRzSsBKsJ/KT5tYwkiRpQQy7lJKEHctJdijcfVx9gaq3w== 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-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 974F580007 X-Stat-Signature: zmufpzkjybpygroso9bxn11pxk695cts X-HE-Tag: 1683694733-144469 X-HE-Meta: U2FsdGVkX1++oscSneIu9koFrSXwQ9gU78n81Z34xT5KgnHONmhq/NJNi38yIu+B9I8FmY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ozR1rwrpoN9VPBX/uoKX5FSiqE8pKgvZrQR9OwTogB2b4D2EFsm/n9c82l4Y1WdZSPhvsT3IcmjYZkK1Gg5acFlwM10MkZSBKLtDPe3FL0Befc91J/6iSZZDjvZYf4r68XPwj84bxi7VurZW/vgICeQdpX5EuefasHsD+Zdbz0AfkGpeFrwMxPYsiFzVcCtEWB7bt6Mh4PgppnBWP3ZoY3401ZZvVCGZSqxdWB+2pA7Q5FPmF/C5PpMJxxE6Q0898i++YPJR8DBRGw/08+E7or4Ieh0Jgt6XPQ== 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: 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));