From mboxrd@z Thu Jan 1 00:00:00 1970 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 21451EB64DD for ; Tue, 11 Jul 2023 04:28:00 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A9F6A8E0001; Tue, 11 Jul 2023 00:27:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A4F208D0001; Tue, 11 Jul 2023 00:27:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8F0998E0001; Tue, 11 Jul 2023 00:27:59 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 7B0668D0001 for ; Tue, 11 Jul 2023 00:27:59 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 500DB120234 for ; Tue, 11 Jul 2023 04:27:59 +0000 (UTC) X-FDA: 80998048278.30.42D227A Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by imf24.hostedemail.com (Postfix) with ESMTP id E2C33180016 for ; Tue, 11 Jul 2023 04:27:56 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=QJAmxyqX; dmarc=pass (policy=none) header.from=ibm.com; spf=pass (imf24.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=1689049677; a=rsa-sha256; cv=none; b=nFsqUKkA5LMZQsS2ndT7C53DomSy9X7PWzmLf/WwAoJ5O9preHyCbyNhVTfYvuAZowbRnE Jl0s/IFIYYlSMQV4f05jb8ujgBgHxrhX4IsDuYI5DwnNkJurDLuhwWF4U7NgowDaLqk3bP 9BZerELXL/su9XSjcfmDKhJaMqA72zE= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=QJAmxyqX; dmarc=pass (policy=none) header.from=ibm.com; spf=pass (imf24.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=1689049677; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=DLxDXY64JqP8QA4+/ad2fdAWFnHSpvzOz4lYDO0GQkg=; b=fFSumAqvmKBBAhnrVVksrtkaA7xqdH27Jq2gyWM8DDEaQVU+HNPAviXcZWcQ3+SfTb797A gd3kRMFjPwH2pUYvpGEsJjxbEUqxbNeGhP2GqA4Y1HO/oIYr9dEAq6lYKlCMAyqgIof45g zNKeow3hgXoGSNWcU9D18XfFF9zwp7I= 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 36B4Hit9001784; Tue, 11 Jul 2023 04:27:45 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : in-reply-to : references : date : message-id : mime-version : content-type : content-transfer-encoding; s=pp1; bh=DLxDXY64JqP8QA4+/ad2fdAWFnHSpvzOz4lYDO0GQkg=; b=QJAmxyqXwTBztcO4g6d62Zsmnv5Aohhx1gaMPeBDDzvshyrIszFi7ucY3zaVy8wgbEmm K92R2l/9f6EcIRNs4Z6y9I3HT2CbgOLQGcnZ88b9aqTzpg4cfT4MWNal0hWvFelAH60T /ft5mmW929xS3QD064WwFHXOBF4QtwzwuTVPL5dJLFP/1GePgwW7I8eIWLZM9brLKnmi D5xli7x+mRVM5d5ZX68D75Wvoa6tepTZNFJZW+x/yE6FaZMm58H128PFSLGJSEStXpFV huXgFvSCwg5q5zHntQN7behSYJHK4bti0XCvbUZYTvgJ0Xgz8tJRZizydn13N+O0ALuT TQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3rrywv055d-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 11 Jul 2023 04:27:45 +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 36B4IEFU004801; Tue, 11 Jul 2023 04:27:44 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 3rrywv054w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 11 Jul 2023 04:27:44 +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 36B1P3Ao014024; Tue, 11 Jul 2023 04:27:42 GMT Received: from smtprelay04.dal12v.mail.ibm.com ([9.208.130.102]) by ppma05wdc.us.ibm.com (PPS) with ESMTPS id 3rpye5n1pd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 11 Jul 2023 04:27:42 +0000 Received: from smtpav01.wdc07v.mail.ibm.com (smtpav01.wdc07v.mail.ibm.com [10.39.53.228]) by smtprelay04.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 36B4Rf7S6947088 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 11 Jul 2023 04:27:41 GMT Received: from smtpav01.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 548225804B; Tue, 11 Jul 2023 04:27:41 +0000 (GMT) Received: from smtpav01.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5139F58055; Tue, 11 Jul 2023 04:27:35 +0000 (GMT) Received: from skywalker.linux.ibm.com (unknown [9.43.86.43]) by smtpav01.wdc07v.mail.ibm.com (Postfix) with ESMTP; Tue, 11 Jul 2023 04:27:34 +0000 (GMT) X-Mailer: emacs 29.0.91 (via feedmail 11-beta-1 I) From: "Aneesh Kumar K.V" To: Christophe Leroy , "linux-mm@kvack.org" , "akpm@linux-foundation.org" , "mpe@ellerman.id.au" , "linuxppc-dev@lists.ozlabs.org" , "npiggin@gmail.com" Cc: Oscar Salvador , Mike Kravetz , Dan Williams , Joao Martins , Catalin Marinas , Muchun Song , Will Deacon Subject: Re: [PATCH v4 04/13] mm/vmemmap: Allow architectures to override how vmemmap optimization works In-Reply-To: <444ec1b2-296e-fee1-bf24-d4e83c825518@csgroup.eu> References: <20230710160842.56300-1-aneesh.kumar@linux.ibm.com> <20230710160842.56300-5-aneesh.kumar@linux.ibm.com> <444ec1b2-296e-fee1-bf24-d4e83c825518@csgroup.eu> Date: Tue, 11 Jul 2023 09:57:32 +0530 Message-ID: <87h6qboyx7.fsf@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: m2R2_lKBPfx3jPCzuHV82SOmkkewG7AG X-Proofpoint-GUID: rOJ8KlkbGn0T03Qx2J9EwimvUZaQG3TB 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-11_01,2023-07-06_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 mlxscore=0 mlxlogscore=999 suspectscore=0 lowpriorityscore=0 adultscore=0 impostorscore=0 priorityscore=1501 malwarescore=0 clxscore=1015 spamscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2307110036 X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: E2C33180016 X-Stat-Signature: b5atihyq9i3pst1wwtcegkpo4kc3e67o X-HE-Tag: 1689049676-427741 X-HE-Meta: U2FsdGVkX1+L6w3DYnwdTkzKOzpE083LJgg89z3PKTl9wVtrffBGXaRlJDhOaS0bwzyaiLYis0XM+Ag6OBptkPeCmBgOITjtv72JQ09gGsV3Uq8UCSLLky+pgYGnzmb6u9dpzViyEHHUFAvHQVey9hqoLeQ5Aydna438QAA34QLtZ7kTiOonB1zEZLGGXAbV95esNr2RyHDqFAkuyPJ8EnSuMiXjhpXI+OmKIh/ylmI9CF7y6GvaR9pqCgVD4s1TRNtXBfvFJfSNIVt8L0F2H5t3lRW+017pO/7RpMX6RQsVdcx1vmexVcipZaE1JOxVANh6bfOm7R1aw66BGz2VZ3WZZFWW6p2Ewh6yiHxtflemLMYtie8IXF2eIwotLITGZLTFsxc768l9HLck4wJ75hPf+KG+e7KtxMW9ns7jgThkrsPRCynQC5TzJvzRPAWJTrs64Rj92Q281XHqnh5B/lRFSdwFKubPh/+c/yOCh1/cLVp5WSlle9k51D+gvkcQK7+1KpbNyr5zdHopJYJqaRxXhmPyD4fx/OHw9gFPhfxN3B4jI0dNCjhTENS2f/u2ep9lkBV+6qG08TLyPuk4lgiQfti3rsShxCqgbu8r3afOK0VgKGXDqu1KQEQBMrROszEWRVyf8Oi+IEODAivZfKcU+p0fqC54ZW8Hkm/vTvSAgOhQBneUlJXlju/YKZyCMN3H06ypIMf1TLAgX1Qf02NpSKtz8oasXjt/OKkr3sWD8bSnkLXLmwmiEwz64HXFTbLPVGCXNbpP50rrlRHD8HJ0ZbrSVQ7QlqSy/bszvnDhwKLmB1rsYyJKD/eZfaGgKiWGluRcxyve9dlrot59RAwh0Pv1E3uBW/r3pjhyuqlJaCxJPcVkIoWBAX33gv5SjwObBfWfD1kDKtw6i0NqTEPmN3TvWsX8q3wZtnmOE3psPvR18zHcw3RcDQ9Pa0SLNF5J4HWeybrhQ9q3Kt+ LD/pQ8VJ KupDwJHfmJAmq5z0nkm133Kjl3btKyNTSESx3RGHluUNjsK4k0ozgrVhzRCy7QKFSt4LGTztcqZslI+eMoIwscbenkFHpqfX27iEOa4EaZzSkDvBEASXmr9fn3JM0QKqfDjCp0M6hLdUwi+cymr2k+kRG3NIGPx+5qAyYeVyMfb8fAa/LgW7/J6krnvURh8MPebOgSQ/0oGQmhsEDWZ1Mlp8Nk3v2idt0Ear9X5U9KYTfxyw1G9W/WZDhe80VfTQ7mzJb 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: Christophe Leroy writes: > Le 10/07/2023 =C3=A0 18:08, Aneesh Kumar K.V a =C3=A9crit=C2=A0: >> Architectures like powerpc will like to use different page table allocat= ors >> and mapping mechanisms to implement vmemmap optimization. Similar to >> vmemmap_populate allow architectures to implement >> vmemap_populate_compound_pages >>=20 >> Signed-off-by: Aneesh Kumar K.V >> --- >> mm/sparse-vmemmap.c | 3 +++ >> 1 file changed, 3 insertions(+) >>=20 >> 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); >> } >>=20=20=20 >> +#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) > > Should vmemmap_pte_populate() be static ? > > It looks odd to exclude a non-static function based on a non related macr= o. > > There are several such function in the block being excluded here. Can=20 > you explain why it is correct to do that ? > Those functions can actually be made static. But I will do that as a part of different patch. I will update this patch and make sure the #ifdef will only override the vmemmap_populate_compound_pages. modified mm/sparse-vmemmap.c @@ -141,7 +141,6 @@ 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) @@ -359,6 +358,7 @@ int __meminit vmemmap_populate_hugepages(unsigned long = start, unsigned long end, return 0; } +#ifndef vmemmap_populate_compound_pages /* * For compound pages bigger than section size (e.g. x86 1G compound * pages with 2M subsection size) fill the rest of sections as tail -aneesh