From patchwork Tue Jul 25 10:02:05 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: 13326252 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 E494DC001DF for ; Tue, 25 Jul 2023 10:02:38 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 71ABB6B0074; Tue, 25 Jul 2023 06:02:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6CB5A6B0075; Tue, 25 Jul 2023 06:02:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 594186B0078; Tue, 25 Jul 2023 06:02:38 -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 4A6256B0074 for ; Tue, 25 Jul 2023 06:02:38 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 1249D80CFB for ; Tue, 25 Jul 2023 10:02:38 +0000 (UTC) X-FDA: 81049694796.25.86AAAA5 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by imf23.hostedemail.com (Postfix) with ESMTP id 4CD4E140030 for ; Tue, 25 Jul 2023 10:02:34 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=nBGlVP7V; dmarc=pass (policy=none) header.from=ibm.com; spf=pass (imf23.hostedemail.com: domain of aneesh.kumar@linux.ibm.com designates 148.163.158.5 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=1690279354; 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:references:dkim-signature; bh=CGUlAJvMCS6sRK63SjAzMj2NTm5JvG6HgFTGq1Auw2w=; b=Tvy9adKzOnRNFy96tIyReZmGcJUzuxwNvvKYb2uXqg5dWlqpHuQm0XpvglyLpcAFYpduq+ yT3k4tSbLqoLlwl/Lsj64cmA96zfUi0bY8GYHrLTDOtzLOfai2Y5NyxMg8RXtFIhMtrpEa aWAmv6lsdmkbmfK+eDbgRhX1ALK2xtA= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=nBGlVP7V; dmarc=pass (policy=none) header.from=ibm.com; spf=pass (imf23.hostedemail.com: domain of aneesh.kumar@linux.ibm.com designates 148.163.158.5 as permitted sender) smtp.mailfrom=aneesh.kumar@linux.ibm.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1690279354; a=rsa-sha256; cv=none; b=r0rZcugw4J5rE3XOzLn+sFDer/hlZ1Zz84WHHRMoP2JxcuA+K+CabQaKObUYAa+lGQygCo WHdO4Nujulby/8ZOYr/nnBn9D7LCgEwaZsBCRXGF/j2t/4J5US40BQ4tJT1R4KisrKEaAg RXGgoVojTmBomT6VKHZg8zlk+OGdE48= Received: from pps.filterd (m0356516.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 36P9bfoC025395; Tue, 25 Jul 2023 10:02:25 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : content-transfer-encoding : mime-version; s=pp1; bh=CGUlAJvMCS6sRK63SjAzMj2NTm5JvG6HgFTGq1Auw2w=; b=nBGlVP7VHM4nVm/6uR7hqnDOQTeCnLBCmsyydXRzJV3mOwelc45TaPlBSEYmgN8IyiNb g2AUcB3uQgi1EPvZsx8Z/cWySMWHuK+oHTucIQQq9CnsjiOx5Ju2Z3vvmINvnS0LU6HX kn3oYg+WuuDJU5t3OaaKmWAMtFD6rV4nOUMOhIBca3yd8Gq9McpQCVvgYNr7d1u4r+ja J+xPwINqoOLON2qEnPfZkAJ93h5owBCJMxf07I/AGNcKkzaf4AE7cjLa0YLr8Z22Ue1t cFn6YWQXqQVyAHmp6PDfkcOkHAyJEBNFKXPfPaCCAIuQIjsxCeDHWyhgcSiWmDL8lDbP xg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3s24q1smn0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 25 Jul 2023 10:02:24 +0000 Received: from m0356516.ppops.net (m0356516.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 36P9dC87004109; Tue, 25 Jul 2023 10:02:23 GMT Received: from ppma23.wdc07v.mail.ibm.com (5d.69.3da9.ip4.static.sl-reverse.com [169.61.105.93]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3s24q1smm0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 25 Jul 2023 10:02:23 +0000 Received: from pps.filterd (ppma23.wdc07v.mail.ibm.com [127.0.0.1]) by ppma23.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 36P8da4f003714; Tue, 25 Jul 2023 10:02:22 GMT Received: from smtprelay07.dal12v.mail.ibm.com ([172.16.1.9]) by ppma23.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3s0txjtup7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 25 Jul 2023 10:02:22 +0000 Received: from smtpav02.dal12v.mail.ibm.com (smtpav02.dal12v.mail.ibm.com [10.241.53.101]) by smtprelay07.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 36PA2Lt520250964 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 25 Jul 2023 10:02:21 GMT Received: from smtpav02.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8A3D45805E; Tue, 25 Jul 2023 10:02:21 +0000 (GMT) Received: from smtpav02.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BDEF458051; Tue, 25 Jul 2023 10:02:17 +0000 (GMT) Received: from skywalker.in.ibm.com (unknown [9.109.212.144]) by smtpav02.dal12v.mail.ibm.com (Postfix) with ESMTP; Tue, 25 Jul 2023 10:02:17 +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 , David Hildenbrand , Michal Hocko , Vishal Verma , "Aneesh Kumar K.V" Subject: [PATCH v5 0/7] Add support for memmap on memory feature on ppc64 Date: Tue, 25 Jul 2023 15:32:05 +0530 Message-ID: <20230725100212.531277-1-aneesh.kumar@linux.ibm.com> X-Mailer: git-send-email 2.41.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: hYYhVq_v3ldVfVg9O8nZ4Y6bVjpj7Jfw X-Proofpoint-GUID: 4rdXYET5no1eKQZpAJoDZjspjMf6sU7u X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 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-25_04,2023-07-24_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 lowpriorityscore=0 impostorscore=0 bulkscore=0 mlxscore=0 spamscore=0 suspectscore=0 adultscore=0 phishscore=0 mlxlogscore=999 malwarescore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2306200000 definitions=main-2307250082 X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 4CD4E140030 X-Stat-Signature: jiezgrjh6roztpka4xmxju1gx7hrtrc6 X-HE-Tag: 1690279354-804463 X-HE-Meta: U2FsdGVkX19YxiiWOH3v8euwnsPmrW0rKoN2InBEQ6rNU96+05K3OsGRwSjyazzhk5kg/w7tNvzZVyEv4jKJFoQD6MSaRMhe94byzyTOs2TWSvrPrMYSCxYu9CIJQgCHTMJ3GuNv8KJJoMf/LM4/ZiQqzCpNPABKdRLvP+sVD18t/IgG/gb0hvw4G1QXLH2AoVv7vTthIBrhTMxCgLJJ2/euTBlgYE2L0dBSJNCIACjA6dH47s/J7xfENM3VcGW2yc/Zh0vJ1gnYzMmwBMiRSzqkekunZMeLpT3vr0hppkopubU9t5Uatos28X4f4PsfM5JkrXfalwz5IgLo6/O1DuWiouTGS7P3laz29VGb3/PVSJ7VWzi3l1tslBk2dZRdeoeeyhvwCB/9XStxCF4QMdvfBAwtYmaqbSy7HuiBPlI5gkd4jiF8Zl6NcQHpig+IBOKNN6y7sQwuvQkNIQOMQaojNzaA+CeH2sVE2OV8ICRkPfZo5c8eP/eKPI3INerZN6BB9NoYq+aW6kUS46Vh5kiNdodQuoOHGBtWXgtsO6oVIHY+DstNA2XjR84LEsTkeoYVm1bmOotB76G1um7t/na+fXsSAks4PgLLpM2qy/VxWnHb5yyKfcImt3mzbILgAr/e3/tMrh3+LInODo/nNcj9D3uamPp7cO5Tx4dM6t22oOwdSrGPNIlKus41x0BkvuWhW8R8cbQlVPJRDHDuMDHEIhdHRbK9EZAyxyFJ0EbjtFz+Iwxd5VcUKzuygGTYQQ/T6f3HC1jWB1oD7SAM2DgkzQV0D6bEKox/VIND7Z76lep0ut1IjsT2ZNNSUI0QB75teWQ3AairCT3992EKGJd1zoIfrNsE744q5oDXaZ+ddYgMbTHm/e68iKj7r2pINxB94j3ddodvB9GaTi72fH5zkhv+HAYDIfAno7iW0kFhFvVWlySAG49ZJPHd5u+JyirXWn73gDZZImpsu85 TSW5Cijz ednkxauYB8+2WZ1goCE/Rel05JyIKaKbx5eXhS86pGEjEvoBT3k6z+6wOI56D9/HvoY0KIYlYN+uEAbdueuScKQ9azuXAgvUCDBG8h69dAQAdkbopfo849/gF+ia71RhmrPHUPKI01/+IlZlgvucMlaopsZcD0I4JRwDyczqiCu/0GIvVytZfmOLHqODXJPilYjCRSC5vMMZAop4= 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: This patch series update memmap on memory feature to fall back to memmap allocation outside the memory block if the alignment rules are not met. This makes the feature more useful on architectures like ppc64 where alignment rules are different with 64K page size. This patch series is dependent on dax vmemmap optimization series posted here https://lore.kernel.org/linux-mm/20230718022934.90447-1-aneesh.kumar@linux.ibm.com/ Changes from v4: * Use altmap.free instead of altmap.reserve * Address review feedback Changes from v3: * Extend the module parameter memmap_on_memory to force allocation even though we can waste hotplug memory. Changes from v2: * Rebase to latest linus tree * Redo the series based on review feedback. Multiple changes to the patchset. Changes from v1: * update the memblock to store vmemmap_altmap details. This is required so that when we remove the memory we can find the altmap details which is needed on some architectures. * rebase to latest linus tree Aneesh Kumar K.V (7): mm/hotplug: Simplify ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE kconfig mm/hotplug: Allow memmap on memory hotplug request to fallback mm/hotplug: Allow architecture to override memmap on memory support check mm/hotplug: Support memmap_on_memory when memmap is not aligned to pageblocks powerpc/book3s64/memhotplug: Enable memmap on memory for radix mm/hotplug: Embed vmem_altmap details in memory block mm/hotplug: Enable runtime update of memmap_on_memory parameter .../admin-guide/mm/memory-hotplug.rst | 12 ++ arch/arm64/Kconfig | 4 +- arch/powerpc/Kconfig | 1 + arch/powerpc/include/asm/pgtable.h | 24 +++ .../platforms/pseries/hotplug-memory.c | 3 +- arch/x86/Kconfig | 4 +- drivers/acpi/acpi_memhotplug.c | 3 +- drivers/base/memory.c | 32 ++- include/linux/memory.h | 8 +- include/linux/memory_hotplug.h | 3 +- mm/Kconfig | 3 + mm/memory_hotplug.c | 201 ++++++++++++++---- 12 files changed, 229 insertions(+), 69 deletions(-)