From patchwork Mon Jul 10 16:08:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Aneesh Kumar K.V" X-Patchwork-Id: 13307363 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 A173FEB64D9 for ; Mon, 10 Jul 2023 16:09:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 073456B0074; Mon, 10 Jul 2023 12:09:30 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EE41D6B0075; Mon, 10 Jul 2023 12:09:29 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D85268D0001; Mon, 10 Jul 2023 12:09:29 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id CC2A76B0074 for ; Mon, 10 Jul 2023 12:09:29 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 8FFA612013A for ; Mon, 10 Jul 2023 16:09:29 +0000 (UTC) X-FDA: 80996187258.10.B5F9744 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by imf26.hostedemail.com (Postfix) with ESMTP id 882CA14004E for ; Mon, 10 Jul 2023 16:09:21 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=KwskIEIk; dmarc=pass (policy=none) header.from=ibm.com; spf=pass (imf26.hostedemail.com: domain of aneesh.kumar@linux.ibm.com designates 148.163.156.1 as permitted sender) smtp.mailfrom=aneesh.kumar@linux.ibm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1689005361; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=R97SYAHPLPjbUcnqCpDHlj9OaI8fme9l4271zttXIHk=; b=phr59AoK/MS10QetqnutH5I1N2zY6uJa7x8KrRrDpf2LiNIHM0ntzHwZCxntOIj52+xOxv /zmmWZUydEprTVdS0FTUBhQ9Dji21Wa8yHWOhjyNvFYZcN9vrgvmRqdfxV+uVg+WQMut2y iKbS/HANUki63oKNgetdjNItfXM1JvM= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=KwskIEIk; dmarc=pass (policy=none) header.from=ibm.com; spf=pass (imf26.hostedemail.com: domain of aneesh.kumar@linux.ibm.com designates 148.163.156.1 as permitted sender) smtp.mailfrom=aneesh.kumar@linux.ibm.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1689005361; a=rsa-sha256; cv=none; b=MNFhgXYoSw/4bixi5GkxATb3ynRD2vrK1x7sNEOHB2ZKXMzuVfAzuU4Dl+S07vWiVgvWJf LNyYzQbQP8tkYPrTL/wWrfptj0o6Pa7VBkrkoUJgoaSfKfoJHrNmQNqkaWO8X9gbtVd1iu bBZSr4lya6PIF14SdzUJ71kts8r8QcU= Received: from pps.filterd (m0356517.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 36AFlL93023765; Mon, 10 Jul 2023 16:09:08 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=R97SYAHPLPjbUcnqCpDHlj9OaI8fme9l4271zttXIHk=; b=KwskIEIkkIV+aqQwFzX382fAIa7SLYXvfa0kyvxCAHqpxhfqQNG+0qtui9kdLz0V4JBT CWUL+fkptfiHqCcj1QYsZx6XGRBFd2/1GpFzIIPRLZyrU3IHNnpxrRf+6uoVDOVfHC7B Dny9fNdoN7OpiXBlpVu5clWTD1gKhYEnjdpzWNsnqP4Pr2sPq4J9f1woLu0LMmmhKtHy QKdKjfzZ4ScD9LyKGwTBg7hGYsp+xVA62F8kBXoYBoAELRA2InXIcFS8su0i99BneBOm WRkxM8TQcaf5UkOd2pu5aE0VYezv3eHTp7E3rxKeIW64EsJQaPBOcuwSBRvHh8HuL7iE 7Q== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3rrmxfgnbk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 10 Jul 2023 16:09:07 +0000 Received: from m0356517.ppops.net (m0356517.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 36AFlNFX023882; Mon, 10 Jul 2023 16:09:07 GMT Received: from ppma03dal.us.ibm.com (b.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.11]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3rrmxfgnb0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 10 Jul 2023 16:09:06 +0000 Received: from pps.filterd (ppma03dal.us.ibm.com [127.0.0.1]) by ppma03dal.us.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 36A8vxnA026453; Mon, 10 Jul 2023 16:09:06 GMT Received: from smtprelay02.dal12v.mail.ibm.com ([9.208.130.97]) by ppma03dal.us.ibm.com (PPS) with ESMTPS id 3rpye5kb75-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 10 Jul 2023 16:09:06 +0000 Received: from smtpav03.dal12v.mail.ibm.com (smtpav03.dal12v.mail.ibm.com [10.241.53.102]) by smtprelay02.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 36AG94gE19530414 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 10 Jul 2023 16:09:04 GMT Received: from smtpav03.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C17305805A; Mon, 10 Jul 2023 16:09:04 +0000 (GMT) Received: from smtpav03.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9DA555803F; Mon, 10 Jul 2023 16:08:58 +0000 (GMT) Received: from skywalker.ibmuc.com (unknown [9.43.9.86]) by smtpav03.dal12v.mail.ibm.com (Postfix) with ESMTP; Mon, 10 Jul 2023 16:08:58 +0000 (GMT) From: "Aneesh Kumar K.V" To: linux-mm@kvack.org, akpm@linux-foundation.org, mpe@ellerman.id.au, linuxppc-dev@lists.ozlabs.org, npiggin@gmail.com, christophe.leroy@csgroup.eu Cc: Oscar Salvador , Mike Kravetz , Dan Williams , Joao Martins , Catalin Marinas , Muchun Song , Will Deacon , "Aneesh Kumar K.V" Subject: [PATCH v4 02/13] mm: Change pudp_huge_get_and_clear_full take vm_area_struct as arg Date: Mon, 10 Jul 2023 21:38:31 +0530 Message-ID: <20230710160842.56300-3-aneesh.kumar@linux.ibm.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230710160842.56300-1-aneesh.kumar@linux.ibm.com> References: <20230710160842.56300-1-aneesh.kumar@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: iLZ8Yq_G01MfDLpzxucUkVl7nzK6S6G7 X-Proofpoint-ORIG-GUID: Y7_DABXpJy3T1IElMeTpP7bBWxwNNyzf X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-07-10_12,2023-07-06_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 impostorscore=0 phishscore=0 suspectscore=0 bulkscore=0 priorityscore=1501 mlxscore=0 spamscore=0 malwarescore=0 mlxlogscore=999 adultscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2307100145 X-Rspam-User: X-Stat-Signature: er1y7xwgagx7awcyqai71ojii7w3rdzo X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 882CA14004E X-HE-Tag: 1689005361-470679 X-HE-Meta: U2FsdGVkX18887lyITULBEm2PnZk5cWJ7YJhV/pM8mkTqTJ0maskkVTLrKPBDGSfV0WFA//HFZXaTWoiJAhomBJc2A+pkvwI+Q7wxRKBDa+56ajjp9BuPtCodx5Rjn4QN8CE4EJlzo4v0t+RPHeq1VkH4eAU4550c6S96f9fVgBSWnsewivUq15CPOBWR8AZctaHfi0ItVCs1mXckObo4t71RCOEczDw23r5KzHfa7jLHSl0g7ZVFO34S2W6Kj06d0EhizZNVUbIKZBE7Vnizb0boZ0GD5f26k5sbFBDipTYhsutIp8bl51IpW9AGMMqEWtxnoIYIi5h1LXvGUlv/HEh3N4D4q1wcpB0JCdBWNnQSzTAFfhhy+1cwM861QRxMz/TNVxniAcSZFVf87vAoT/B9fySovv8G62TtM7J+AwC46GmZnMisix/NMlCUtjqg3UbEbeQ4GdMDWQ7IGAdcXXXoqJjErvSctUeJlKse+D562fY34+oIFGOPqkBm/2pErmafbgTXL+vGqEvjrFnr7n6RqzNMlriWikZ+7oIFduB0lV2pPhl/BY4U7+7tzI5RJdiIwLP3MkN8kcSha5EuHejA2AoMtM/cBadpD+LdmdzF34AWCQ11pGRzLUX7jnsAEz7GmAoIzABgb545AlaWRdop41Pl+/Cqd+3AvJUVnny9SJIDP0HMSxlKfa6ELRL/Ev/uq/0EqaSuVK7XAOkKsVrJURwf2oBMpKNr8LyMPMu8COk41sflDmWGKVYaOxOu8qd4hKX8+mVyOzaR9NZHCRXz3iHkD9x5ktuovlen/fhpo2kjGCnAcMuAGmrgWrGbIgQVT/6QHF0i9vT1DMQxartzT9e9lyQQdm1gEB28IO/2glnzJ13vf9vaa92KaJ+Xx9zguyrRSvEh1MfP7BgxuFuXh44vEefr6mcAqKluqo8m+447IcuIpPF3aPzpx+TevI2CKGcs1LE0wLclWQ m+HIg4VO VReYSMSRawnTZDI4SN+1yTdxgl/gQaMS6HDzB9HsjX7CyjsjOEBk1LBNnjSX5sCtTJk2eMPiK78e/vlHXX+YdgcUmYH/rNuCCGqCLblMvTZh7npSaYNEcqgWUjeOC/kGGVxIVMgmFrVJQ7bpVm7XWUQTk5G7x42lqmYF5fIKaX+JVApaaIzRXbbsB+VuIfFm1AuUA 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: We will use this in a later patch to do tlb flush when clearing pud entries on powerpc. This is similar to commit 93a98695f2f9 ("mm: change pmdp_huge_get_and_clear_full take vm_area_struct as arg") Signed-off-by: Aneesh Kumar K.V Reviewed-by: Christophe Leroy --- include/linux/pgtable.h | 4 ++-- mm/debug_vm_pgtable.c | 2 +- mm/huge_memory.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/linux/pgtable.h b/include/linux/pgtable.h index cf13f8d938a8..6fd9b2831338 100644 --- a/include/linux/pgtable.h +++ b/include/linux/pgtable.h @@ -450,11 +450,11 @@ static inline pmd_t pmdp_huge_get_and_clear_full(struct vm_area_struct *vma, #endif #ifndef __HAVE_ARCH_PUDP_HUGE_GET_AND_CLEAR_FULL -static inline pud_t pudp_huge_get_and_clear_full(struct mm_struct *mm, +static inline pud_t pudp_huge_get_and_clear_full(struct vm_area_struct *vma, unsigned long address, pud_t *pudp, int full) { - return pudp_huge_get_and_clear(mm, address, pudp); + return pudp_huge_get_and_clear(vma->vm_mm, address, pudp); } #endif #endif /* CONFIG_TRANSPARENT_HUGEPAGE */ diff --git a/mm/debug_vm_pgtable.c b/mm/debug_vm_pgtable.c index ee119e33fef1..ee2c4c1dcfc8 100644 --- a/mm/debug_vm_pgtable.c +++ b/mm/debug_vm_pgtable.c @@ -385,7 +385,7 @@ static void __init pud_advanced_tests(struct pgtable_debug_args *args) WARN_ON(!(pud_write(pud) && pud_dirty(pud))); #ifndef __PAGETABLE_PMD_FOLDED - pudp_huge_get_and_clear_full(args->mm, vaddr, args->pudp, 1); + pudp_huge_get_and_clear_full(args->vma, vaddr, args->pudp, 1); pud = READ_ONCE(*args->pudp); WARN_ON(!pud_none(pud)); #endif /* __PAGETABLE_PMD_FOLDED */ diff --git a/mm/huge_memory.c b/mm/huge_memory.c index eb3678360b97..ba20cef681a4 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -1981,7 +1981,7 @@ int zap_huge_pud(struct mmu_gather *tlb, struct vm_area_struct *vma, if (!ptl) return 0; - pudp_huge_get_and_clear_full(tlb->mm, addr, pud, tlb->fullmm); + pudp_huge_get_and_clear_full(vma, addr, pud, tlb->fullmm); tlb_remove_pud_tlb_entry(tlb, pud, addr); if (vma_is_special_huge(vma)) { spin_unlock(ptl);