From patchwork Tue Jul 11 04:48:26 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: 13308119 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 C63CBEB64DC for ; Tue, 11 Jul 2023 04:49:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 603C28E0001; Tue, 11 Jul 2023 00:49:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5B3E08D0001; Tue, 11 Jul 2023 00:49:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 47BE28E0001; Tue, 11 Jul 2023 00:49:03 -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 392158D0001 for ; Tue, 11 Jul 2023 00:49:03 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 0E413140299 for ; Tue, 11 Jul 2023 04:49:03 +0000 (UTC) X-FDA: 80998101366.15.7A33CCF Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by imf27.hostedemail.com (Postfix) with ESMTP id 989C34000B for ; Tue, 11 Jul 2023 04:49:00 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=JizIsvwL; dmarc=pass (policy=none) header.from=ibm.com; spf=pass (imf27.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=1689050940; 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=AdTEmZt3Xizs1VYmPABQKhxgqOkLNZY0dVkVVsFQVwc=; b=EZJUmhANNGygx5qHyWRcQN5CGhNF1JOvmMdc2CalP6kZ9opQGXoaWUsob0Wy8McEsKh7p0 dRwKyjr6rMJTTcctD2YzbUvUw1MwAl+qjmL+plYswN8/GkVvRpSqPIcvmemldzq83nkjuL J+Ut8H8IaeJXQdPYczb1seCaM3tdpfQ= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=JizIsvwL; dmarc=pass (policy=none) header.from=ibm.com; spf=pass (imf27.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=1689050940; a=rsa-sha256; cv=none; b=UtpM34tQqJO81rz7/pl1TreNxUuMASaSB9gbYk99ZqL4lwj3nAZLJWrQl8apxjXxi60Fcs e/fvWr7Ymu6EsnILFA5L+wtSCwPTMWEGKln2atL4wQd6zCTGx2k/VSAMRCI84kIBWl0B4N zzNpYorF13sH/Y6OeeaQ9jn5DQFkBGw= Received: from pps.filterd (m0353726.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 36B4juJS014136; Tue, 11 Jul 2023 04:48:52 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=AdTEmZt3Xizs1VYmPABQKhxgqOkLNZY0dVkVVsFQVwc=; b=JizIsvwLRJMPxK1hXmWh19pEff5qpiX8qyWgF7ZoY2zWmg3wvSx6CHdfarqkb/D1jvDs CE5nbhe/IOBUyCKZGVAJE99GLIKsLTaIh2e5i/eNycx9WJG2DTb1mCHMity7Hpia0ScM zCtyE36S7mxX6rRxTcr8C4oubAl7hZ6qpqggmfqSSAN9B4Hafn3avfOzxpgJHJD6fkOZ +WgWF5ChJ12XDdaP+rYt0NW3kOtY1fvtNicggS54FuLfcBOh5wwz3jm/OMPHk//zS2Fd GvwyPgDMfKmcDV2VO/Bfnwa4e3sI5eUiFBYH+QgNisW25XGdpvNOTadbGN+0D+qH1ocz uQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3rryysgg37-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 11 Jul 2023 04:48:51 +0000 Received: from m0353726.ppops.net (m0353726.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 36B4d3i1019937; Tue, 11 Jul 2023 04:48:51 GMT Received: from ppma01dal.us.ibm.com (83.d6.3fa9.ip4.static.sl-reverse.com [169.63.214.131]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3rryysgg2t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 11 Jul 2023 04:48:51 +0000 Received: from pps.filterd (ppma01dal.us.ibm.com [127.0.0.1]) by ppma01dal.us.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 36B40KI6017127; Tue, 11 Jul 2023 04:48:50 GMT Received: from smtprelay03.wdc07v.mail.ibm.com ([9.208.129.113]) by ppma01dal.us.ibm.com (PPS) with ESMTPS id 3rpye6vebu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 11 Jul 2023 04:48:49 +0000 Received: from smtpav01.wdc07v.mail.ibm.com (smtpav01.wdc07v.mail.ibm.com [10.39.53.228]) by smtprelay03.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 36B4mmw21442530 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 11 Jul 2023 04:48:48 GMT Received: from smtpav01.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 88E7C58065; Tue, 11 Jul 2023 04:48:48 +0000 (GMT) Received: from smtpav01.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6B0B05805B; Tue, 11 Jul 2023 04:48:43 +0000 (GMT) Received: from skywalker.ibmuc.com (unknown [9.43.86.43]) by smtpav01.wdc07v.mail.ibm.com (Postfix) with ESMTP; Tue, 11 Jul 2023 04:48:43 +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 v3 0/7] Add support for memmap on memory feature on ppc64 Date: Tue, 11 Jul 2023 10:18:26 +0530 Message-ID: <20230711044834.72809-1-aneesh.kumar@linux.ibm.com> X-Mailer: git-send-email 2.41.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: 18BGlnMQtRbEn4zwAsoMIaFzuWWiQpaW X-Proofpoint-ORIG-GUID: sFClHmHEcuQxgCOLGP0dYTq4JzWQomQp 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-11_02,2023-07-06_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 lowpriorityscore=0 clxscore=1015 mlxlogscore=931 bulkscore=0 adultscore=0 spamscore=0 priorityscore=1501 malwarescore=0 impostorscore=0 phishscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2307110040 X-Rspamd-Queue-Id: 989C34000B X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: qth7yruh1kxy7ypabpzwebnzn1hksk9s X-HE-Tag: 1689050940-679831 X-HE-Meta: U2FsdGVkX18Tg9H5c/v5Tr6oNsyq0q1zAki1q7eGD0ow/VZz/ahYKj1nK42PtDpY8mLGL3/i16zaUKNSdgm49+bceldvuANAYkgWmgqJ5Ev/RBI/idfWqKQUMNzXAgOzCJY/Got3j3vYotHcNoW9NiEcyVeOeU01R4vFZDcQbTmk3Z3L/84/ftQ1MLHcZrizeMXikExmjcAV+oaHCXCndLyEjpy2ngiRBM6ry66vVDS3ugvVM6LfGFqk0Kj4j42d91j1THliFP7ww1a24khrSchOyAAJHQjZo2P1mq0EV3G9hT4E/rxZHJL2Cqgwrkk6f2gyBwIKKOSovK3dsmgflTF+x5B0/kf3K7uCCbwvmQlcayHRiJrHzNU7wTN1LM1I50V5dXOmEuji9KOL5ZWXfywW8ZiSEjarAZXH9YttDEtgip6JFTCZnn0tkHQtFnxP+CiJ+5VE6PQ6t1eZKOw8VZVsyhqg/EzmRzmdYIqwb6S29gIV+J8Gds8VYzHp3twvYI6ikCAWtft6A8GrzUE05jWcBLRz0GRGn2P/KugEwRHBioKosTwe4lD+1nCSJLuXCfl/p8yfYgDsHns7CP9qfHtsmQwfMWET2wZzEPql/uJWLXvQ2btNZNX2JfAe7plyTkQ49ASt/9CDjr3aJY7maPz6oXql8gsYlvKXws7bpLPfO+Fwrl2+FZF91w6QEK/ZYOV5cRWGBpCzPUczf6SHb4pkfoYVRdSAWt1GobRSG5pmO3WOm6fQzZ7MdhAN+OalNxX7ZWJA6HRhjmxxT9T/be+fW471Z2LvCk0Y4VOfmhcUBOaboq9TcirzTL3IXxkr0Trn/mu7p1pCMMmRw8Vjki1AOWVl9R1hni5y2s4jxRAU4zqpYlqwqY+5BqbR30Mv4XYf85IaifLQosPmTytjFjhxvr5j68eVsPMKXZ0sPkHzCKnFfIAFymXK40nt75gdlI4o+O5BNJwSek88Ujy yS5Lz42k 1mRWDKNXhvmss3LpzsEZKVSh1zd8yBj3MkWd1p9hjx24P1AcXWJOEFsIn83MvFsQMM+xn8juEnnrXjf9Wmj0Jpx1foUEvlPtQYIpvXasSkhjfEhn8dhcMb5kK4rKI20oj2dV7QUwkGRBCTWNqBDEMY7MvflaFJH7iN0vcWFSkk/GTCU+UNeMP0KeQmPgl2BYhAF4beBH7riNUHM8= 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/20230710160842.56300-1-aneesh.kumar@linux.ibm.com 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 (6): 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: Allow pageblock alignment via altmap reservation powerpc/book3s64/memhotplug: Enable memmap on memory for radix mm/hotplug: Embed vmem_altmap details in memory block Vishal Verma (1): dax/kmem: Always enroll hotplugged memory for memmap_on_memory arch/arm64/Kconfig | 4 +- arch/powerpc/Kconfig | 1 + arch/powerpc/include/asm/pgtable.h | 28 +++++ .../platforms/pseries/hotplug-memory.c | 3 +- arch/x86/Kconfig | 4 +- drivers/acpi/acpi_memhotplug.c | 3 +- drivers/base/memory.c | 35 ++++-- drivers/dax/kmem.c | 81 ++++++++++---- include/linux/memory.h | 8 +- include/linux/memory_hotplug.h | 1 - mm/Kconfig | 12 ++ mm/memory_hotplug.c | 103 ++++++++++++------ 12 files changed, 205 insertions(+), 78 deletions(-)