From patchwork Mon Jul 10 16:08:30 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: 13307362 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 CD4BAEB64DA for ; Mon, 10 Jul 2023 16:09:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1EDC66B0072; Mon, 10 Jul 2023 12:09:21 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 19D0B6B0074; Mon, 10 Jul 2023 12:09:21 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 065A08D0001; Mon, 10 Jul 2023 12:09:21 -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 EE80D6B0072 for ; Mon, 10 Jul 2023 12:09:20 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id B850712012C for ; Mon, 10 Jul 2023 16:09:20 +0000 (UTC) X-FDA: 80996186880.10.E13B888 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by imf21.hostedemail.com (Postfix) with ESMTP id 42F551C002A for ; Mon, 10 Jul 2023 16:09:17 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=d4fgA1Rm; dmarc=pass (policy=none) header.from=ibm.com; spf=pass (imf21.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=1689005358; 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=SO8r5VbGmdwJ3q2RNf1QQ4rNQ+vbk/APFGvtlYo2uGM=; b=PEh6SFDrzUIFocT0WVGDLUijP5rm9qXUhxzuR3jEdLHYiTuMOLShn5aTwxRWf53+arD/YT Ncc40x87jUNh3JO9SpLQEXWhWhsjFOTBYUaOONPAixeNl5M04I+uhDz5FYo49iAspC4C6U 3JTS2k6ofE0lFpfuGzMas8kFA1MeqrM= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=d4fgA1Rm; dmarc=pass (policy=none) header.from=ibm.com; spf=pass (imf21.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=1689005358; a=rsa-sha256; cv=none; b=ffAy5KCoXmzoyhmwE+OQguiOC+UrtqnFe20eSyWc8uepGj+9uy2uzbBgkEr3P2ICoNM95A ZOKz0KClEa1Uk320RIyPviV6az6ZWyQoqjNuN35DzofLgPi6SknHrqsMkIBUrSWgYlOvl7 6NkTQRZ7MYZwAdKdLZAHuAHjw9XR3+A= 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 36AFkiBM019039; Mon, 10 Jul 2023 16:09:01 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=SO8r5VbGmdwJ3q2RNf1QQ4rNQ+vbk/APFGvtlYo2uGM=; b=d4fgA1RmClJ6cJ4Rb0uGPCIn9Db2ye25xE+vqH2MAdQWs04W3vqm6mCBiBKfW32upwe8 keK9b0vdksVrtGy9JXe5Hb8SC2xfB2BhpIBGMli3I/dEfcgZ26uUHBuplCnLjKxw3Bdi HZrfMxpmQJW0swVWghM+Gp21Dfu5kFeQZbUMD0YvfiKy5oa7lvRfTQgNQNsRAFA0xaqJ TCIWOqir+mbTAl766Jjwc9oPOUJvfNdid2yTtIW6ZTzveeshZ65Ic/+pjZyj+/2W3KIS GpP2pfQImI568JZ/smyEfMAahkQviU8d66LqfZZIxPgCyacK3GRJ49/9zytKgeboRypE yg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3rrmx39069-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 10 Jul 2023 16:09:01 +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 36AFknv6019651; Mon, 10 Jul 2023 16:09:00 GMT Received: from ppma02dal.us.ibm.com (a.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.10]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3rrmx3905c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 10 Jul 2023 16:09:00 +0000 Received: from pps.filterd (ppma02dal.us.ibm.com [127.0.0.1]) by ppma02dal.us.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 36AEJ87o005249; Mon, 10 Jul 2023 16:08:59 GMT Received: from smtprelay05.wdc07v.mail.ibm.com ([9.208.129.117]) by ppma02dal.us.ibm.com (PPS) with ESMTPS id 3rpye60kkr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 10 Jul 2023 16:08:59 +0000 Received: from smtpav03.dal12v.mail.ibm.com (smtpav03.dal12v.mail.ibm.com [10.241.53.102]) by smtprelay05.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 36AG8vDm5243450 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 10 Jul 2023 16:08:58 GMT Received: from smtpav03.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CB17958056; Mon, 10 Jul 2023 16:08:57 +0000 (GMT) Received: from smtpav03.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 48C485803F; Mon, 10 Jul 2023 16:08:52 +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:51 +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 01/13] mm/hugepage pud: Allow arch-specific helper function to check huge page pud support Date: Mon, 10 Jul 2023 21:38:30 +0530 Message-ID: <20230710160842.56300-2-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: 1tTQ6MZX0f5Iyn8TK6o_wksTBUJECtQ7 X-Proofpoint-ORIG-GUID: 1ry6ZdJIbNBtR9f_VBxmEdWWbRe7-BlB 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-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 42F551C002A X-Stat-Signature: a5g9s6isw1nmqfhcuppewww53d3zkr5p X-Rspam-User: X-HE-Tag: 1689005357-24713 X-HE-Meta: U2FsdGVkX19D/lAeZNX2v0gHFNwrnL01/k42qq2bcEyay4QSX+PNm2Gkr0/ElGMlmqwaOB+watmE2INQE8UYbPsDkidQAo8VXJPxiT58KvZ70E4QOf1k4NN4naH49mn2Ps8ENtFPgktyfE4bRuWNeL/dvGz/kg++qDTs4ZRP4giFUMjPMkzns3JvGPturH2UNWcvHfbv9XEK2ZMSWhp3vyYp/Qx4rURHvmw/pYlW+KQTqiZs8kTCk9FlRpdghT0j2+zUE8A7sWEpnkqNFGAmOBS+DFDM9qfcn9jCu5ORTTK+Q1k86zX5FWtGr0NedFM6XEXFT3tnADcz0Wg6D58L9UK4dKMDOhgbdQk/B/Sws8tDnaXVzTytd7PqafRSBOxUgj5kqj0XJwTQKAGNXCAqNwwjgXJYBtvXs2DzeXOWcQg+UOrHGNDx8div45ICfXBk95uMdTh8+k7TXDSZA+UbcG40L2F0Lvn/dxbJ45qwnpIuLXRd8edpiczYvdyvrT5vtLjMBqnNMXy0Xru9zyj/3L0r6krH0iVf2diMQYFtIoFF8rgn26qhzt/+y4J4KaI3/y4LVsUEdWIfyAWSlO4lS3Zu820L95lzFGd5cbbJdeDYmNP9Rq8hWhaZwg2JUpTh9hAOC7C/LBtu2keY8ZTWiYSb1o5oIlkD9kTSUnroDYUyWLxHH1ZA07ywp89LQaMmdosaBQKS5jJ6F0ayoEcWHMCz4TlV4W0w/VZXumxC6x9jAG2jDCXDbQvehqD0tmNyFbJhNW6ztCH2ohuTIjP3VrMait+OMKp/+EQumxRaxMAEyoGEU2zEFtOwTsrlC3sU+v2k73m9Srbk1IOEfFZFr6J/3g9731t4UrDu9Ay74vm9aKNReGfuLByOLKTC4zATSHraNrJOIOcdsY/cBt/YmlT6G7XvQOVRioFic5eiuChKgqBtQ0OpCY4nGTBErN9zPa2Zn97WZO+v8ORZb/g mBpFrNmF TqIXSCR7cuaTsoHGLFqdKsKgN4TjsGL8JOJHpNy2h0iZA8RvBPy4vABSF5ZoSlETTfLji+cT4WiAfe6qo7yzJOQm/WEbkSa8MHwby55FGbZMkQE5Vmk38X1wFIJy8nlp5B2wkv/bDpSnOXxs= 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: Architectures like powerpc would like to enable transparent huge page pud support only with radix translation. To support that add has_transparent_pud_hugepage() helper that architectures can override. Signed-off-by: Aneesh Kumar K.V Reviewed-by: Christophe Leroy --- drivers/nvdimm/pfn_devs.c | 2 +- include/linux/pgtable.h | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/nvdimm/pfn_devs.c b/drivers/nvdimm/pfn_devs.c index af7d9301520c..18ad315581ca 100644 --- a/drivers/nvdimm/pfn_devs.c +++ b/drivers/nvdimm/pfn_devs.c @@ -100,7 +100,7 @@ static unsigned long *nd_pfn_supported_alignments(unsigned long *alignments) if (has_transparent_hugepage()) { alignments[1] = HPAGE_PMD_SIZE; - if (IS_ENABLED(CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD)) + if (has_transparent_pud_hugepage()) alignments[2] = HPAGE_PUD_SIZE; } diff --git a/include/linux/pgtable.h b/include/linux/pgtable.h index 5063b482e34f..cf13f8d938a8 100644 --- a/include/linux/pgtable.h +++ b/include/linux/pgtable.h @@ -1499,6 +1499,9 @@ typedef unsigned int pgtbl_mod_mask; #define has_transparent_hugepage() IS_BUILTIN(CONFIG_TRANSPARENT_HUGEPAGE) #endif +#ifndef has_transparent_pud_hugepage +#define has_transparent_pud_hugepage() IS_BUILTIN(CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD) +#endif /* * On some architectures it depends on the mm if the p4d/pud or pmd * layer of the page table hierarchy is folded or not.