From patchwork Thu Jul 27 08:02:25 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: 13329140 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 79900C001E0 for ; Thu, 27 Jul 2023 08:02:59 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D10016B0072; Thu, 27 Jul 2023 04:02:58 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CBF836B0074; Thu, 27 Jul 2023 04:02:58 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B60226B0075; Thu, 27 Jul 2023 04:02:58 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id A2E596B0072 for ; Thu, 27 Jul 2023 04:02:58 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 6CFD0C10A0 for ; Thu, 27 Jul 2023 08:02:58 +0000 (UTC) X-FDA: 81056650836.03.CF0E072 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by imf24.hostedemail.com (Postfix) with ESMTP id 71E81180004 for ; Thu, 27 Jul 2023 08:02:54 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=Ftq6XaF2; dmarc=pass (policy=none) header.from=ibm.com; spf=pass (imf24.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=1690444976; 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=acoQIpC22iktWHoO1qKwFrBvyYJISn1JRyiCYBRMlcY=; b=QPRSaUJcgdPuNxbogylNSVMA3EJK4Gdn0XDJeMGEsS+68mFKqQxIBanAw2/qxsJzS8hHdS kOG9PaD+nWU+ffZSLfNcCsFcaIzVCGxu2HAAxE7gMcdK8J8Ykg+ZRw5FLkrKVN6PAEEbkk jxVlXImt9xmaeOh8a8iJPlWibjntVII= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=Ftq6XaF2; dmarc=pass (policy=none) header.from=ibm.com; spf=pass (imf24.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=1690444976; a=rsa-sha256; cv=none; b=AWBalMsJXhg+6o5Xtngux+IcqoKbd7UV/bcMSxQX6HRAZXkW76GbWCTfIKCWWYX2I9eRGy qJQTCtlQCCXgF39+F9QY4P5FPbUikqKBzKoC3O3QEBBjSoBN5TT1u0FFQ13nU7OIQTjGtw nNXHhhbW7U6xrAxgEYeOjyzRKVNdK0A= Received: from pps.filterd (m0360072.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 36R7cYxp013747; Thu, 27 Jul 2023 08:02:46 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=acoQIpC22iktWHoO1qKwFrBvyYJISn1JRyiCYBRMlcY=; b=Ftq6XaF24OWtTkF4/0BqYTt8UVKyHkYWYOxLQXoW2MsNj+Mp3oS0t+J0DRfYRKcxz4DK gJz+q4uEdKp2RphHgGyFVpnzoS6eO3x5mMsHYeonjiY1vREaenBnqOUn6yKNGd8tg+m/ QsenMWF1HO5CBaP8Iz2lxnQrBTTb4bkxLqVi+aFaST5TIGcnLT9xUDdlw/lh6T5AHJNw sT/a3+96HkSJBlO+Hmy31h+6TuxgjwrVAVao3tV5UDvBhzKXBjhhiF7hvPcjKXH3Z6PU FuIDBSZQyOj3Ubld29Oug4/hJ3Hc8g+ago2tnDRqpwXEdOg+LvjET3P2Ol6/sEQoQMr2 XA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3s3k83jdrx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 27 Jul 2023 08:02:46 +0000 Received: from m0360072.ppops.net (m0360072.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 36R7cka0015256; Thu, 27 Jul 2023 08:02:45 GMT Received: from ppma22.wdc07v.mail.ibm.com (5c.69.3da9.ip4.static.sl-reverse.com [169.61.105.92]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3s3k83jdqv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 27 Jul 2023 08:02:45 +0000 Received: from pps.filterd (ppma22.wdc07v.mail.ibm.com [127.0.0.1]) by ppma22.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 36R7xj6L014373; Thu, 27 Jul 2023 08:02:43 GMT Received: from smtprelay07.wdc07v.mail.ibm.com ([172.16.1.74]) by ppma22.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3s0styc1yb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 27 Jul 2023 08:02:43 +0000 Received: from smtpav01.wdc07v.mail.ibm.com (smtpav01.wdc07v.mail.ibm.com [10.39.53.228]) by smtprelay07.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 36R82h5561407674 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 27 Jul 2023 08:02:43 GMT Received: from smtpav01.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 19B495804B; Thu, 27 Jul 2023 08:02:43 +0000 (GMT) Received: from smtpav01.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DD7DF58055; Thu, 27 Jul 2023 08:02:38 +0000 (GMT) Received: from skywalker.in.ibm.com (unknown [9.109.212.144]) by smtpav01.wdc07v.mail.ibm.com (Postfix) with ESMTP; Thu, 27 Jul 2023 08:02:38 +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 v6 0/7] Add support for memmap on memory feature on ppc64 Date: Thu, 27 Jul 2023 13:32:25 +0530 Message-ID: <20230727080232.667439-1-aneesh.kumar@linux.ibm.com> X-Mailer: git-send-email 2.41.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: d_EhixwvrdxnX2CK8uUXWPOD5xgkdCoK X-Proofpoint-GUID: KjwcBFeKLX2AG2OVgb8JiUsYqsZjg-IN 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-26_08,2023-07-26_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 spamscore=0 priorityscore=1501 mlxscore=0 bulkscore=0 phishscore=0 mlxlogscore=999 adultscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2306200000 definitions=main-2307270066 X-Rspamd-Queue-Id: 71E81180004 X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: aiud1dys7ytuucs9pi1me6ck8qhzse4y X-HE-Tag: 1690444974-654765 X-HE-Meta: U2FsdGVkX1/45M+7w/yf4TO1iJd1q//Af7FxedmZVKeGwtpoGted6JwW+QlGI1QfXTWgqtFBSmnFNoNdj+6OBWGPhRSefujN/6SMRZwmxQ/LlMN5WKApBNa8XjIni4reiJAyhCbyRg/QJ6VIlJ8Lltm6pCk2KyueAoWI+fpEGBVRHDYY3KItPg17uDldGwtIpaoTXoWb0ZIXkrF5u4a/cBsM8kr3KbCk7DXg9qu8ApZ2Hmcgqk+0C7dCb4bVbokZHjDs51o/HLO1E+FE/RycjgnDrLWdPiyjGSibAm8/cQx4m5ViYTQI4+hpWXQrg4elrZUcfAKnDCBhCN9HcyS1K8Kb0t6UQRNhZmjUgYo9dw9ZLEQPh+rCtUNouRl4JAkEfXr6EurMZAKGzmue1/uuzjYDe+FWxNlbmwdQzJWnKEzjGwua/POFjnAjasbxc47NRRZ6xU2sivaUrk9QSI/BLtpWKAtVYqaqAT4dJ+tOyE2S09SyDFLTva0F7Is9VpXt3iNhf1WFcyxA1TYaETl15+q3iqDuz2viUH0RpnV/eZdrq/bY93+9uBGSb7KBKWGmw3tK7TcE7/7jg6FtZIFKr3uG1KaGf41y9bI+iZ4elGwBg+82A6WEoHRpJl8U7O+M5DA5xBwprl4tNUwtuoNiPjDyuLASpX+/hgoO/NAhLmOtabmbDQagxdTpBzpadhKZ099spnuipJbzQR6TJ4H+ANwu7vEYDgGFaDiVSI4XgqkDfjUH6lxCaFJhd4xIWw5qa/6NeMBsgNOhYDK13VKIcyJMbjExf+Svk1OBYUzP/ANTDSgGMOMOo0LpiWQ0CTuwexN8yNLIJP+aJxFIKA9tcAsQhp2H1LqXNzffni8TXdh5XhDuEtw/3pMRqVk1tiw3pZ3QkZDd+r5uuu5eZEP9C5CpRhFBw5ccoJHb8hUbbS/wcstN72EA+/oz8U/jihmAaA10+aB9InUretANcZd DByb2L4F A9aub9UUiEGsXHRHCnb+mxK2CQuQUKJNYdZEwczRSaGcY9+6eU5Zga8IEv2UhBO6ockZyiYJ/uIY8a7IbZPyovwj9GQG8KXuofpLvxSX9k8JC1j5EcSE0gA/4c7mCJsOPCoYwBpI3t/iHAzG7xumR2t4uAHUTAd0V0LlcRBqA64q4kJuB4aC07+o97hBnRNXMOKVdYzJ1ooAr/JA= 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 v5: * Update commit message * Move memory alloc/free to the callers in patch 6 * Address review feedback w.r.t patch 4 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/memory_hotplug: Simplify ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE kconfig mm/memory_hotplug: Allow memmap on memory hotplug request to fallback mm/memory_hotplug: Allow architecture to override memmap on memory support check mm/memory_hotplug: Support memmap_on_memory when memmap is not aligned to pageblocks powerpc/book3s64/memhotplug: Enable memmap on memory for radix mm/memory_hotplug: Embed vmem_altmap details in memory block mm/memory_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 | 21 ++ .../platforms/pseries/hotplug-memory.c | 2 +- arch/x86/Kconfig | 4 +- drivers/acpi/acpi_memhotplug.c | 3 +- drivers/base/memory.c | 25 ++- include/linux/memory.h | 8 +- include/linux/memory_hotplug.h | 3 +- mm/Kconfig | 3 + mm/memory_hotplug.c | 210 ++++++++++++++---- 12 files changed, 224 insertions(+), 72 deletions(-)