From patchwork Mon Jul 10 16:08:33 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: 13307365 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 BB2B0EB64DA for ; Mon, 10 Jul 2023 16:09:35 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 45F5B6B0078; Mon, 10 Jul 2023 12:09:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 435EA8D0001; Mon, 10 Jul 2023 12:09:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2D6836B007D; Mon, 10 Jul 2023 12:09:35 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 1AFCA6B0078 for ; Mon, 10 Jul 2023 12:09:35 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id E052A8017E for ; Mon, 10 Jul 2023 16:09:34 +0000 (UTC) X-FDA: 80996187468.26.CEE8309 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by imf20.hostedemail.com (Postfix) with ESMTP id 6A80F1C003B for ; Mon, 10 Jul 2023 16:09:31 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=pETylCo3; dmarc=pass (policy=none) header.from=ibm.com; spf=pass (imf20.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=1689005372; 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=au27mQkFBCX0j7yag6NPyyKfAD/tDcJxx1jGYEmeYuM=; b=mKf4FT2DXUBt72qTT0Jk1QMU1F+jyFrddh9RTUirPtOBYBZ86MKE2JfQgzeoPDG7HxCa6y 7bRGccv7CJkqKI54OX76rIe5389LqNjAnfURQm1AVVxI2gmyHdOvYZQT9UVvbc0yVvnwa8 LDegmosId9qEpb/rDSMkBo82x/AGZcI= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=pETylCo3; dmarc=pass (policy=none) header.from=ibm.com; spf=pass (imf20.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=1689005372; a=rsa-sha256; cv=none; b=RUXKjhF7JPx3HMRS7lfis2SVk9/nvIXnUQPQmUXJiqL7waJMh/Z0yAlDfj0UtbuX2cBuav W4WGEWiTGK6+RBsPa9Q/IWz6zEaP0pC7fTuOaJJurcUciaBaQdwu89l2h1+KYJdM+m8ZPH HISKJB89mUOu7Gx9tDx+zFAZQbX+9to= Received: from pps.filterd (m0360083.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 36AFx5Qb023924; Mon, 10 Jul 2023 16:09:21 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=au27mQkFBCX0j7yag6NPyyKfAD/tDcJxx1jGYEmeYuM=; b=pETylCo346mzxsSiBMhZIiNYOUhgwtzEdJK61Gdj59HhQaR8AxNPr3xbDDB+qOf3ihwz BRaXNWcsxAIL8HhGX7doCzsIkg/RM6PCtC+4UobeyNV8I4KGawey8M4SQKn0+mMMgPX8 5Jgw6qzKJmG02BSNZrzzVJ/d7qsyfFEeieaav7TJahOora7Aag0Ooq8gqQaewGmT9pWq BC0JsiQiC4+K55gGWIMRcPNZ2Riy0FWYcS1byN2VfWt+0QVLG0m7IQ46jKL5YnLdGVCQ NLXFVzm7Uppz0oelpnFmamK+hkxVbn5g/+ljIQTLL/UaIHOL24XSq7ogNkee67l+FN8i nQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3rrmyhrp90-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 10 Jul 2023 16:09:21 +0000 Received: from m0360083.ppops.net (m0360083.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 36AFooOQ028326; Mon, 10 Jul 2023 16:09:20 GMT Received: from ppma05wdc.us.ibm.com (1b.90.2fa9.ip4.static.sl-reverse.com [169.47.144.27]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3rrmyhrp86-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 10 Jul 2023 16:09:20 +0000 Received: from pps.filterd (ppma05wdc.us.ibm.com [127.0.0.1]) by ppma05wdc.us.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 36AG0Pts014032; Mon, 10 Jul 2023 16:09:18 GMT Received: from smtprelay02.dal12v.mail.ibm.com ([9.208.130.97]) by ppma05wdc.us.ibm.com (PPS) with ESMTPS id 3rpye5jnec-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 10 Jul 2023 16:09:18 +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 36AG9HEM32047546 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 10 Jul 2023 16:09:18 GMT Received: from smtpav03.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B930658060; Mon, 10 Jul 2023 16:09:17 +0000 (GMT) Received: from smtpav03.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 27CEE58056; Mon, 10 Jul 2023 16:09:12 +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:11 +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 04/13] mm/vmemmap: Allow architectures to override how vmemmap optimization works Date: Mon, 10 Jul 2023 21:38:33 +0530 Message-ID: <20230710160842.56300-5-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: dM5DL3hhhBtduq8RvnuKV3eVsFqycPq5 X-Proofpoint-ORIG-GUID: y_vdRo6apOzkb5rydDSrPDBitq_Nf2Ek 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 mlxlogscore=999 mlxscore=0 adultscore=0 clxscore=1015 malwarescore=0 suspectscore=0 priorityscore=1501 lowpriorityscore=0 impostorscore=0 spamscore=0 phishscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2307100145 X-Rspamd-Queue-Id: 6A80F1C003B X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: y4rfzpbx4u83ziy3m5159s9ki1ko6tyf X-HE-Tag: 1689005371-595800 X-HE-Meta: U2FsdGVkX1+rgkcaCMYXUxsWQeGRAFkRjKItm5tk0Z+yI64OE6kyouoFiwxb+OC58q2l6myNq+HIjOkVK2+qoAFSj37Lai1KIdXufJ2YpyPybPC1kYl/w1GZRUUoIn7GAAop/u0A7/Ihn+jaxbMOW8Lwmaw1+OrADQLvDgvVWUBtzGvlerY0I0DJx048uCfDO4QVHYzy8oVbXWKs1gQFJczvMhzcY6xRb49hZe3AGn5Jj1zWYUHJegydZ+kY+z57JQApYWFVCFTOKG8AuVG8VzHwK/WdQlqC9k1jVme6U4g8mimMFizGG9LozDQeM245AzYjRKsNenj67M1UIeXqovVq5SsrYcjT7n5p97lmI0npPn3AOXyY8eTbkfiyB/6hydlGcuD7NYA+cXop5qGQEMjWxqSpF1B2p1F4/q8Tms2eFd7NNgZHjcotTbQ8sCE0efKeCQIbC5PmYeKBBtGCnQIV30B5FqYYDBmTi5zGxO+vtMhXab70jtljqUFEprK+oEn1sMnzNAttBqkopD9+3NQ0JBbmlASb9STS1e18/htqKU12zbqRU1dVRtdTbPzqnV9cXGi6I6tIy03KlNblDED3Cp/xZjSSbto9b9VK7u1MWtxXsWsmQjhE/ev06IGYe3gnLHoKDexGeWTHAq8CmMKJxtaNiG0JcklZsRbzSub+MjcAHa30VM1TE/eVOz8ziJFBXEKVw7vpXsjoSSb2ARnXnbBBZlP2ybplU6XlAH4USpN/PJ+zwlZFZ01qvU8ypapR+DPMViVhSncfhCi7e97B285t+HUqgNgWtm3dJrHD4epEGhDrDLy8qmBCzhu9MYM59cw5ivCqRKwgHPsO3q2H+llILLgBbgUXeOyqpZQ/Mnlpm5q6sTH6SkEzcUkFAP9ZZMIT7rB2+Nzzj3IWVXUicITXirdweXPhQW77NRojAVNGZPLwZHJroi+sna7M+G82vv10zcvSpqBJ95t L16sSs9C nCuHzcds/BkmYst5e9+daKpwoLg4Rebo0f+VSMQ6CsQ22Gl2SvQaq93mOBtliPepd1f2nlaxkAy6A08ArRpqjSE4bRC6r95v4QTY+ZBa5Na9rf+w9lj4vbcA2qRlTx0v/v7HVCrHCIDsn+mw= 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 will like to use different page table allocators and mapping mechanisms to implement vmemmap optimization. Similar to vmemmap_populate allow architectures to implement vmemap_populate_compound_pages Signed-off-by: Aneesh Kumar K.V --- mm/sparse-vmemmap.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mm/sparse-vmemmap.c b/mm/sparse-vmemmap.c index a044a130405b..541b3f69a481 100644 --- a/mm/sparse-vmemmap.c +++ b/mm/sparse-vmemmap.c @@ -141,6 +141,7 @@ void __meminit vmemmap_verify(pte_t *pte, int node, start, end - 1); } +#ifndef vmemmap_populate_compound_pages pte_t * __meminit vmemmap_pte_populate(pmd_t *pmd, unsigned long addr, int node, struct vmem_altmap *altmap, struct page *reuse) @@ -446,6 +447,8 @@ static int __meminit vmemmap_populate_compound_pages(unsigned long start_pfn, return 0; } +#endif + struct page * __meminit __populate_section_memmap(unsigned long pfn, unsigned long nr_pages, int nid, struct vmem_altmap *altmap, struct dev_pagemap *pgmap)