From patchwork Thu Jul 6 08:50:36 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: 13303367 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 5913AEB64D9 for ; Thu, 6 Jul 2023 08:51:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 77DE98D0002; Thu, 6 Jul 2023 04:51:14 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 706708D0001; Thu, 6 Jul 2023 04:51:14 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 580198D0002; Thu, 6 Jul 2023 04:51:14 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 4353F8D0001 for ; Thu, 6 Jul 2023 04:51:14 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 12CCA405CD for ; Thu, 6 Jul 2023 08:51:14 +0000 (UTC) X-FDA: 80980567668.13.27EF6BC Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by imf16.hostedemail.com (Postfix) with ESMTP id 506D6180007 for ; Thu, 6 Jul 2023 08:51:11 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=AfGnGYFl; dmarc=pass (policy=none) header.from=ibm.com; spf=pass (imf16.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=1688633471; 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=+CrbEjk6aTrtuJPRY83Ysydi7/qhn9mc/IfEFwTSyPw=; b=DKhC0m1YwQFuOQu13ZIh1PHiHPts1CFxat5W7Z5Z4AwAdkJC4KiVxZY4sxZ1eptx08dPpv zb1WLTnNlEK18sKC3bv8l5qMCbe5hKYjDT5SvT1I5dXMGslxEDe+w6qrnmXdrPxRNFT8t1 3atru0PXDlU3gUW0EVf8ZEZyELSl9wc= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=AfGnGYFl; dmarc=pass (policy=none) header.from=ibm.com; spf=pass (imf16.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=1688633471; a=rsa-sha256; cv=none; b=22GjzjCNSBNtHoqfLx66HV1Cu/pCGnuTP0R8btQG+zWCfnOKuHPkLCPFywiy/hmu7LPCLM e9rF7mAJ4TpDsr1U9s/GplVQI1OLTU5z1esGSimbcSAyDDo7LXJvsj1JaTr6vL4o/9Bx3j /VLFj5LSdL68bxn4SC2h/HfvZVkzIfg= 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 3668kiqZ018570; Thu, 6 Jul 2023 08:51:02 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=+CrbEjk6aTrtuJPRY83Ysydi7/qhn9mc/IfEFwTSyPw=; b=AfGnGYFlYml6N/peQNgxzPhTd7BQUuh7QEB/1JEYeI11xmN/SGofM+J5LQWBT6qtblzO MUwToXEmMJc7mtJoTLQx0OgbzgQgunheICP5zRRa4C6e51D6jfcweRLvQt3Jzp2oeXVv n9+UN+ZMO5v4LJnIZkqIXBuKl1f4lFkVZyS1ItSm2B5g7dMc98Lrp7uSO3an9P5yL8mI KTW656J+QPhS7vR4LKqAsv8YXb44SfSaJmw7rhup+SrEjVgdnAiVsrqmbVKgQoXQKxjM JhkEHgGin7lgPJKnNg3wmtBuhm6yfX+A/ZvEAAQ4hbL87f3vAhD7IS3MtG7iwM1xAfly hA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3rntd805dc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 06 Jul 2023 08:51:02 +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 3668l7wj019555; Thu, 6 Jul 2023 08:51:01 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 3rntd805ck-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 06 Jul 2023 08:51:01 +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 3668lE0O016351; Thu, 6 Jul 2023 08:51:00 GMT Received: from smtprelay05.dal12v.mail.ibm.com ([9.208.130.101]) by ppma02dal.us.ibm.com (PPS) with ESMTPS id 3rjbs6n055-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 06 Jul 2023 08:51:00 +0000 Received: from smtpav01.dal12v.mail.ibm.com (smtpav01.dal12v.mail.ibm.com [10.241.53.100]) by smtprelay05.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 3668oxig65470888 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 6 Jul 2023 08:50:59 GMT Received: from smtpav01.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id ABD685805D; Thu, 6 Jul 2023 08:50:59 +0000 (GMT) Received: from smtpav01.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C63B458057; Thu, 6 Jul 2023 08:50:55 +0000 (GMT) Received: from skywalker.in.ibm.com (unknown [9.109.212.144]) by smtpav01.dal12v.mail.ibm.com (Postfix) with ESMTP; Thu, 6 Jul 2023 08:50:55 +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 v2 0/5] Add support for memmap on memory feature on ppc64 Date: Thu, 6 Jul 2023 14:20:36 +0530 Message-ID: <20230706085041.826340-1-aneesh.kumar@linux.ibm.com> X-Mailer: git-send-email 2.41.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: t_b_UdVqW-6diCA99dqDAMzvQIYnC1_i X-Proofpoint-ORIG-GUID: u0Dsn1j6EXWDFSycSLkFpWahlgYnxA_A 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-06_05,2023-07-06_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 clxscore=1015 malwarescore=0 suspectscore=0 adultscore=0 spamscore=0 bulkscore=0 impostorscore=0 mlxscore=0 priorityscore=1501 mlxlogscore=999 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2307060075 X-Rspam-User: X-Stat-Signature: at96igy9d7gop4qjjjdza6z8a4n1sijz X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 506D6180007 X-HE-Tag: 1688633471-377342 X-HE-Meta: U2FsdGVkX19eD8XyJ169AOTDz906sl61FJwNoPwDg7CUcg8xgdOO7M+owLpbU5XrLibVjXN2+CosPupDHp+2VZuvsuaNWI1/fYt3Hk2cpGBSrk4tOorEl7OLK+s0qy330o57HssC2SVrAUfVyCK06IQqZJbtBlyLCrr1VSMED49jXEIqJg+OzU2E0EHLqe5al6r6hEsGVbo03Zs2MAa7037RXjcWzxfAlzaI+qoPBhQjemteQZh5T37DzS/0S6hYuMtUJxxtgT7Oc2Ih5g0y7UNys8UgkgQhQlRl2ch7lLyiqVr71Um4j4MpLSoXjMeoVt/eKQO9F3KT6oI779ZCN7AZmStT1OBfFB1CI6SDmTu2XZfWmFuyhd3GSP0XdT/yzJFa3CzhpYl18BRXg3DheW8GXGXig/R7WRrK1wvEJnuKtFBhxfnFMyVAw4lXXAE1mLoXOSUTzaZpG720nKQZRR5mo2M4g4xvCgkgkObhmH7d6v0q/7s4yuSAU8wEaAUm9Lgn1deehJ9iYxa7lwD1VeQQJfYrDgnpTmUlSOhGoltInKurULMNOWcMDgZxPnqgcxYQUZxoXmGC2r346zNJWdizsuTh9c8ujW7hsqh7e5plCkoQhpQCtd+zDIZ/0u3AAyYexV9/9SR5rSK2I1MhHcC5NFXv1OHh4dmrZ+Yzp3umhiBSPbI2VeiVe4SdJq9SBMBECZP4FLsIOq7pMECXWMohd84mEHaBExBCcJqFfEvdA1DmTT/Bw9MLzczB8Ia/pTuB+wAwANEX+5LcC+Me7fNqCH6V+g43LPaR5RCr5KICfY50A32IfMUqbL6CMIESwr0hmbeCCQluYbsEGBBMkMflPH7yXLJcTOZo++OEJla2FtglzMANAgZ4ttRUqXVpuzBkws71saFW+zLTTaeGwTqFaM80lmXi4IcxNJPow8XW3WmEFVUusGmbduM27z9VqbgNGFwTIlLbZJsMN1t E6ajWb4W JHygkKDjgccpm6g434f2RdHYLnexlfdrJEoYQEdGfvTvYGRV3cMscaNrex44NyJXbFFij3JXnmqE7Q0jMYqr8V4Khqh3yaS8o2grEsG2Wx6s9BK4GeWxHp460hx45EWNvOigoZe/2HQ+xOBhm749NGMDFZVCoIcLIaz6aitkhTwdYGFZ/3dxa+36pNL1eogmj3mQD+vNVihIc6cOlADJSCJpA1IB4zfRa69M53GZM0WpLUPt64SF6sxn6NYvf9Sl9LcZA9GgpH5IppVaHf3ZcmHjHcLN1Foul0gy/ 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/20230616110826.344417-1-aneesh.kumar@linux.ibm.com 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 (5): mm/hotplug: Embed vmem_altmap details in memory block mm/hotplug: Allow architecture override for memmap on memory feature mm/hotplug: Simplify the handling of MHP_MEMMAP_ON_MEMORY flag mm/hotplug: Simplify ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE kconfig powerpc/book3s64/memhotplug: Enable memmap on memory for radix arch/arm64/Kconfig | 4 +- arch/arm64/mm/mmu.c | 5 + arch/powerpc/Kconfig | 1 + arch/powerpc/mm/book3s64/radix_pgtable.c | 28 ++++++ .../platforms/pseries/hotplug-memory.c | 4 +- arch/x86/Kconfig | 4 +- arch/x86/mm/init_64.c | 6 ++ drivers/acpi/acpi_memhotplug.c | 3 +- drivers/base/memory.c | 28 ++++-- include/linux/memory.h | 25 +++-- include/linux/memory_hotplug.h | 17 +++- include/linux/memremap.h | 18 +--- mm/Kconfig | 3 + mm/memory_hotplug.c | 94 +++++++++---------- 14 files changed, 151 insertions(+), 89 deletions(-)