From patchwork Tue Aug 1 04:41:09 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: 13335760 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 DD069C0015E for ; Tue, 1 Aug 2023 04:41:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0A2662800DB; Tue, 1 Aug 2023 00:41:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 052E92800C8; Tue, 1 Aug 2023 00:41:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E5B5B2800DB; Tue, 1 Aug 2023 00:41:39 -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 D6A9B2800C8 for ; Tue, 1 Aug 2023 00:41:39 -0400 (EDT) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 9530C401E2 for ; Tue, 1 Aug 2023 04:41:39 +0000 (UTC) X-FDA: 81074287518.23.0B9FCA2 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by imf28.hostedemail.com (Postfix) with ESMTP id 27D14C0006 for ; Tue, 1 Aug 2023 04:41:36 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=qB2kemP5; dmarc=pass (policy=none) header.from=ibm.com; spf=pass (imf28.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=1690864897; 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=Mtn4X5ZSVnobTFeCNYVXXxf/bvO4qWkRqORnPXNG5cM=; b=0a/FeSXaqi6N+8s5BU3GxrXSxuDfkJDTml7vcbLaIdidiKjhh+zU29mNQDp64Vx7QatLRz brdFlZxcZl4r+9JsdRUQL3DGxRJ/AMUj0N54AAiktzpSI56cnGpx98pRRGPdQd4gOqgPh5 96nbhaFnFdb6oD8KSuleCX+meiYLYhQ= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=qB2kemP5; dmarc=pass (policy=none) header.from=ibm.com; spf=pass (imf28.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=1690864897; a=rsa-sha256; cv=none; b=slAcF3wgW15CuD6SMj249DeQh++daDJc/3DFg445rDCtPQdC0vu8qkxvtiejQDy4vWZ7Fp oA/fUlGUwDbOUlSPCINhxAkN2lPJitKHzaJBo3zXQqp/PKvuIChAKFMMYBfhUUmQ21i2kN Iwi5qlS22MpSHICZxTsGcVf5H1nH78E= 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 3714cb3S021159; Tue, 1 Aug 2023 04:41:28 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=Mtn4X5ZSVnobTFeCNYVXXxf/bvO4qWkRqORnPXNG5cM=; b=qB2kemP5K0wqEc7XZf9oPRU3oqMnl1TwMTqlN1/DuAUGG7gIl9Qq1ZKL52FAJK6/f9w7 Ltib0R/+zk0z4ji5deb8f4alGQMK9vpK6nmFA1hZo00KSJJCDVXK96DBUUAORl8gueOT Z/E+D1nD5DeyFa2QiMIl7Om2O49VDHNjgC8lBzea0prts8EbMetNPFXBRVEip6FbpMw8 1aNuOGaDgG56ibncN0iKXpUr4HRe+SsG6zVh0hgdU/dgG7IWXiAxYNyyVxzaHvtg2LJt loHHbla3nfl4WsL0RFfvK3SL22BLlgBwHsSE1nzqWDxvkXRhfWm0oOgBvPk9201tlZ9b 6g== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3s6tnarscw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 01 Aug 2023 04:41:27 +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 3714ctWI021989; Tue, 1 Aug 2023 04:41:27 GMT Received: from ppma11.dal12v.mail.ibm.com (db.9e.1632.ip4.static.sl-reverse.com [50.22.158.219]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3s6tnarsbg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 01 Aug 2023 04:41:27 +0000 Received: from pps.filterd (ppma11.dal12v.mail.ibm.com [127.0.0.1]) by ppma11.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 3713S1Gu014545; Tue, 1 Aug 2023 04:41:26 GMT Received: from smtprelay05.wdc07v.mail.ibm.com ([172.16.1.72]) by ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 3s5ft186tn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 01 Aug 2023 04:41:26 +0000 Received: from smtpav03.wdc07v.mail.ibm.com (smtpav03.wdc07v.mail.ibm.com [10.39.53.230]) by smtprelay05.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 3714fPbX5505750 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 1 Aug 2023 04:41:25 GMT Received: from smtpav03.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 697AF5805C; Tue, 1 Aug 2023 04:41:25 +0000 (GMT) Received: from smtpav03.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BB6365805D; Tue, 1 Aug 2023 04:41:21 +0000 (GMT) Received: from skywalker.in.ibm.com (unknown [9.109.212.144]) by smtpav03.wdc07v.mail.ibm.com (Postfix) with ESMTP; Tue, 1 Aug 2023 04:41:21 +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 v7 0/7] Add support for memmap on memory feature on ppc64 Date: Tue, 1 Aug 2023 10:11:09 +0530 Message-ID: <20230801044116.10674-1-aneesh.kumar@linux.ibm.com> X-Mailer: git-send-email 2.41.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: rQRQycIRrlylwnhjfrENjAMiRYPjybNP X-Proofpoint-ORIG-GUID: cio4raVlUtbwc4Hx4FLk2Rv0jN6zr7tw 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-08-01_02,2023-07-31_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 phishscore=0 bulkscore=0 malwarescore=0 mlxscore=0 lowpriorityscore=0 mlxlogscore=984 impostorscore=0 spamscore=0 adultscore=0 suspectscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2306200000 definitions=main-2308010041 X-Rspamd-Queue-Id: 27D14C0006 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: btbuguj68ncbptrncapcpbu7sjq3yr5y X-HE-Tag: 1690864896-178065 X-HE-Meta: U2FsdGVkX1+obdMlTiClrWToC0jCtBgYMFTVQkZMhIgtRi/cEivHfGdRnSe3jESMnp3bt8jaXPX0y6uCBuCasUp8UrgX3loc4e8QalRk2rSYAanmxXIhQiLa2H2slaPShq0fkRGuj0/Rf4HfaXgt9qoatO99Rk3JpDMat2TpCJlIXrXEUsMvuFDZ7k9UDKA8k8c9Iqy4PifjYQVGTI+4CXOvlTUYInpcTQHD4uqUEl115AM4D25a7LhGi0UGdSTnriKUpfOYmyJGqWF+HL/q7lgO1Gc6tJni3zAAixo3Iin5hmGn6R8nob81gJ44ROjxgBBbnQGAuG4i26GEhlQ5CGyXbDktFUZvPJgJ9LnnQC2Zkc5QXUSTVlD7Qm5QrpSH07racN1OAXZVANeQkQliRVEQ/QmJ7YC/K5uNDsdu5kQdADYn8nSg9+jyV989ONDJJt8azkJK1DIqwJT7qWtMqaAbZyNy4g+zDAJQfdsRD12VyycHMpsAu2FZYjcjwBJQPBsyJrLc3pPPSUguR/9HYnBZqtX8pSAzm13uSR7CKLk2+HT8fvE+JPX7GIcEsbMVaxtNElHpi5w/fD4Np5xNQ9O6mn3ZSsSK8P1oQCq+8qaZU8ZLEMsWGLe0hR3phriwHrT2fqVIgngA6RNKGvaV1I8GB6gDlLmWy3fliuths+Tdlw6A4n4DVXICIosSILCMmTYiFUQ6ms/FZrvrvzBxy6hcpYlO3qV7qR9awAF4obr5dbmfnsHpGntiNoInd5/Cdsf8EHaF9g9XYsqazJtBYXuZ8yWePTN1MquLbDw5qwmsqVAQPf2dZDkWXWlCjMrabt5QxSHdOHggU1tkAncoauJbXsm85lnheq5Q1h060G2dBrE+iBWUVFAf7i+lyLCJyUm3sYs//C8Yrlln07Vrp3nHwkEt6Q7iyn5EVHTe/19FWTZXt47Kvqmog4eQgr2OKVLvOtkWlkTVpaL0335 NABmJSjH YadtBvZn8QtxinZtlK3QJ8hpy6wzirUJ/AmoAzmSimsm0JidP/2F1K8Hap1OjJ61JF8dZ3yUv6NNH9hRsfrnC0TB/tzfl/WnLNxpAVYkdBA/Q5NieADe+ZYoxv7ItfQQxH/tDhM+0nIFyfqfkBsI0Xgy2Ut21UfGfT/kKIGFfWvz0hglAIgPSP7kPZ2dmx6Oh8e25rtUsIxJgCE/EnWgChJnBXbqwUl+VUSO0WWSYxMSBN0clOJoElPL9+WmZ5FA5pfCTjYfY74nzN2hqInk+jQaINys/Li8pdoaW 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 v6: * Update comments in the code * Update commit message for patch 7 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 | 27 ++- include/linux/memory.h | 8 +- include/linux/memory_hotplug.h | 3 +- mm/Kconfig | 3 + mm/memory_hotplug.c | 205 ++++++++++++++---- 12 files changed, 220 insertions(+), 73 deletions(-) Acked-by: Michal Hocko