From patchwork Mon Jul 10 16:08:35 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: 13307368 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 84D66EB64D9 for ; Mon, 10 Jul 2023 16:09:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1ED8D8E0003; Mon, 10 Jul 2023 12:09:52 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 19E628E0002; Mon, 10 Jul 2023 12:09:52 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 03E608E0003; Mon, 10 Jul 2023 12:09:51 -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 E5CC98E0002 for ; Mon, 10 Jul 2023 12:09:51 -0400 (EDT) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id B5A7A801B7 for ; Mon, 10 Jul 2023 16:09:51 +0000 (UTC) X-FDA: 80996188182.17.6AFC17E Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by imf11.hostedemail.com (Postfix) with ESMTP id 40CD74001A for ; Mon, 10 Jul 2023 16:09:49 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=AI5YZKyh; dmarc=pass (policy=none) header.from=ibm.com; spf=pass (imf11.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=1689005389; 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=CCRKKwBNmbNEXrHZXrT40NjFgPyXV2Q+00nl9gdum18=; b=qNWd+bhy+8DMj5r+pdr8SVo/i0dlt5e6UrS0TjJ89Dv3iUDnSLWBpV0w0XOmB7vHXFdwU9 nEAFYizadyYfikQQbu+qg6qr6NW9bjArUNk4isZPaPaRbyN28DEDVVqTBW02D1JxTJ0iZF kDPDnrc86j8B9VyXvoXGgQO/e9Bh4lA= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=AI5YZKyh; dmarc=pass (policy=none) header.from=ibm.com; spf=pass (imf11.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=1689005389; a=rsa-sha256; cv=none; b=uVAx5/cgEWwbVSFjNc7+KDfpVF4IVpPOzWAoEPgT5AjFqrkvgu4Vb2A2IYxtORGfm1EKZY OSaR3DNFJhf3g3cYwITApgPq2fZf0Ika84y3WEpqHpq9H8/u96qq46Kk3S5MAQn1eY5Axe NvElQCsWehnMk9Tp/8iU0L33Le6/veg= Received: from pps.filterd (m0353729.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 36AFkjC4019114; Mon, 10 Jul 2023 16:09:33 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=CCRKKwBNmbNEXrHZXrT40NjFgPyXV2Q+00nl9gdum18=; b=AI5YZKyhZn6tnvPcxFvWHX/sp7ZrL65oAObj0hYnUUKE9aHgfbBdoPnvBL3xYSxaLi9J XkYMQqp6Cw/sjpCZaHdlXMnTSrFqNfCjgHKNjm5DD9PU+cp4F1uSPpLao//z5vEoWNng TVoj8fZGeqV1XChW/gBB9GaFkh3UBQ39qPCM2Khvje6YUJlJVUrLOrM7rHMFvIAZeMtB 0YSsd9h9IV+/D/gpK0ZGmuXxs1P2Qk3JFU8g37b2LH3PfDItALnrxeqznJJs4ga4ktJB ZPOdxAprsWQHztVQVPg/FDfvuNK7BDowa7Tu8eG0RaQnywTp/3OuM46O4jP7UH3bDWQH Eg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3rrmx390pr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 10 Jul 2023 16:09:33 +0000 Received: from m0353729.ppops.net (m0353729.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 36AFkj0Y019118; Mon, 10 Jul 2023 16:09:32 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 3rrmx390nw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 10 Jul 2023 16:09:32 +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 36A8QX4s026617; Mon, 10 Jul 2023 16:09:31 GMT Received: from smtprelay02.dal12v.mail.ibm.com ([9.208.130.97]) by ppma03dal.us.ibm.com (PPS) with ESMTPS id 3rpye5kb7n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 10 Jul 2023 16:09:31 +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 36AG9USk35389712 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 10 Jul 2023 16:09:30 GMT Received: from smtpav03.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 60AE05806A; Mon, 10 Jul 2023 16:09:30 +0000 (GMT) Received: from smtpav03.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D467258056; Mon, 10 Jul 2023 16:09:24 +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:09:24 +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 06/13] mm/huge pud: Use transparent huge pud helpers only with CONFIG_TRANSPARENT_HUGEPAGE Date: Mon, 10 Jul 2023 21:38:35 +0530 Message-ID: <20230710160842.56300-7-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: dbhA-LWUYgSgWwbUI2uwwftIoNmPxiD3 X-Proofpoint-ORIG-GUID: 3-U2rhMjLxVOMQog8i67w3UGZPyIEpc- 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 phishscore=0 mlxscore=0 bulkscore=0 impostorscore=0 mlxlogscore=999 suspectscore=0 malwarescore=0 spamscore=0 priorityscore=1501 clxscore=1015 adultscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2307100145 X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 40CD74001A X-Stat-Signature: ftepahcaf6iittnwns8577juq4j5r8br X-HE-Tag: 1689005388-792617 X-HE-Meta: U2FsdGVkX1+m2hETqLXmLZFyN2r9e4C5+a1wXGmR1dsIxdOZcGA3oo9jCnFWqP/OVe+dUcIMo7E9smmusTSbcXlXyTfEPYzWmSH/C6Xi99zeZFGFQ9rcy7VSEMdariZgnK3W6ETd61vHjWZhJaOYAi+v1MJdSitJ7OpTChN0P/EMyJySMZPVVc6pA0XmqN8yQebOQmHc/dpgUTYPs/5z96y1ma5xn+T60DgHK4cby1/HXGTuMoO0aRwsFhE93Sx++b1x0GLGhZiFoo3JYA7vjve5itG0CKQ/lZQGybzFd+B2XNcvxL8hLiGvhKocJVYyyspSUTdcLkmRv30ff/R29+J98JleGZgaNq5gsr2IQN1KSP07LMlVKgFN4KKvWW2nlpw4vpved1A+vatieWZgp89tvVVdsqaWb2c5Cd0/U7CL5KvZNEDnDMttV2AJ1sh7//zhGkngVUlvonJfI57/ZOQ9SJRLBOH4And4/51y15dg57ce34lzn06A0reHjYvjo8zMvJAfCc4nIXWodL1KERgMO6qyM7TvUBrnL1YEMk10vhfPunZkQiTWGWLIq72NPSCPNgPIQ4kiJSo4b8Ir5A4xTJ/p471ypy8tnGqplZtUBEtqs5Mm9aGBh5/B1DSIioRul8Ld2HfcjGeWIjBy23ZDFCUqUMoxm0QnH4KRIMIcB7QOlYzBvksxTucGqKUk6KkZv6r2FyjRrB2SJE6zOkF9b8E5aNHdl6JeoXrHELYuwjsIH44ryn7uLbgmOQs7HiX5Kpt0wEAMslWjfILnL+JpQLjTWtCLqVUIuYq36kHkY+PrxeaN0RI5XuzCGbPF2JkE8MJrWlynHMIBAoqvYD+HWjrhwdvj/MoE8b7SPfJSS50vhEV+aifAYmoSztdZPWDCWnS1qWPoSzshyqpDKkftbo/vv+R6zGia+LlBdndHUc9ai+egffnXP1W1MKMd4C7vTpABQFc17/kWjSQ wBxuEMP/ QuW5YOq2nfv9qS58YtHrwaBU+xHM9kZnj2BrdI3YBCN/l7Chdv8j/LJA+iIUIgYqhBiHm2a2BHMet+l00z93Y7cse7hjbXGsJoeh0Qf0R5ab9gEXJv/UFr6b78YCOIbZFScrTvLTVQ36FuQpBLoxhg+KRCr3U4+H0t+z1fpfBLaALJUUzzxPBjNYzJPomfVEXrLEW 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: pudp_set_wrprotect and move_huge_pud helpers are only used when CONFIG_TRANSPARENT_HUGEPAGE is enabled. Similar to pmdp_set_wrprotect and move_huge_pmd_helpers use architecture override only if CONFIG_TRANSPARENT_HUGEPAGE is set Signed-off-by: Aneesh Kumar K.V Reviewed-by: Christophe Leroy --- include/linux/pgtable.h | 2 ++ mm/mremap.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/include/linux/pgtable.h b/include/linux/pgtable.h index 91def34f7784..b5af3e014606 100644 --- a/include/linux/pgtable.h +++ b/include/linux/pgtable.h @@ -558,6 +558,7 @@ static inline void pmdp_set_wrprotect(struct mm_struct *mm, #endif #ifndef __HAVE_ARCH_PUDP_SET_WRPROTECT #ifdef CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD +#ifdef CONFIG_TRANSPARENT_HUGEPAGE static inline void pudp_set_wrprotect(struct mm_struct *mm, unsigned long address, pud_t *pudp) { @@ -571,6 +572,7 @@ static inline void pudp_set_wrprotect(struct mm_struct *mm, { BUILD_BUG(); } +#endif /* CONFIG_TRANSPARENT_HUGEPAGE */ #endif /* CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD */ #endif diff --git a/mm/mremap.c b/mm/mremap.c index 11e06e4ab33b..056478c106ee 100644 --- a/mm/mremap.c +++ b/mm/mremap.c @@ -349,7 +349,7 @@ static inline bool move_normal_pud(struct vm_area_struct *vma, } #endif -#ifdef CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD +#if defined(CONFIG_TRANSPARENT_HUGEPAGE) && defined(CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD) static bool move_huge_pud(struct vm_area_struct *vma, unsigned long old_addr, unsigned long new_addr, pud_t *old_pud, pud_t *new_pud) {