From patchwork Tue Jul 18 02:44:03 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: 13316688 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 46085EB64DC for ; Tue, 18 Jul 2023 02:44:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 611AD6B0074; Mon, 17 Jul 2023 22:44:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5C2126B0075; Mon, 17 Jul 2023 22:44:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 489998D0001; Mon, 17 Jul 2023 22:44:32 -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 38A356B0074 for ; Mon, 17 Jul 2023 22:44:32 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id EB519A06D5 for ; Tue, 18 Jul 2023 02:44:31 +0000 (UTC) X-FDA: 81023189142.07.A3DF7AD Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by imf08.hostedemail.com (Postfix) with ESMTP id 8A00016000E for ; Tue, 18 Jul 2023 02:44:28 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=iozN5aXr; spf=pass (imf08.hostedemail.com: domain of aneesh.kumar@linux.ibm.com designates 148.163.156.1 as permitted sender) smtp.mailfrom=aneesh.kumar@linux.ibm.com; dmarc=pass (policy=none) header.from=ibm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1689648268; 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=RtWBvfQ6kkIEPZWUvA777nY9iUweKwXHv4RQA1GNxFo=; b=GYjgDqkGto54+UM4siQQUZjB83SJdP/RrDg6tRMEBKYShIZ9m1kjgFS9c0SMbJASwKElK3 gE/VqW+2J/eT0QcSErd4+8u5osMKmCzkTZsYNqM/MtrkbUW8SqqXOUs37S3Gej8NyoeVS5 TutmFTiqZdLg94k1PjgnTZvMsLdENQA= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1689648268; a=rsa-sha256; cv=none; b=7XMnoFleDsYLfK/wPSggVFcNEcJKaY2M0qePe8z4ig47s3Wh2THSLjOIPmuXUFsPAiEgKp 77AWUzTQcrF6FNeac+ZQhjpSApsDc7ebmpJ3iZsBHN74oY76yaOAiuz2dbc/32cb4yNZEu MGFk2Bu9eNqNVVEG6QwAmmxYgfrupDo= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=iozN5aXr; spf=pass (imf08.hostedemail.com: domain of aneesh.kumar@linux.ibm.com designates 148.163.156.1 as permitted sender) smtp.mailfrom=aneesh.kumar@linux.ibm.com; dmarc=pass (policy=none) header.from=ibm.com 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 36I2gOHH010618; Tue, 18 Jul 2023 02:44:21 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=RtWBvfQ6kkIEPZWUvA777nY9iUweKwXHv4RQA1GNxFo=; b=iozN5aXrC6a2RfbhhWVOxVmRe/nG1WX31wJqJtImfzdlqdMdNT1T5P4edVkiZgkWs4mQ XvsLm22ud3Nsbh+atrlZpBE0VyfdiKRvaSJux0F/iYL5+22YfAmNQ000mw63FWvonZUQ Dl7DOZ8f6d23WAxtXbCHTuvBUrzuigGaM8TfhvkniYZnFAG2d70iU1n7xdHKC/bPRdzv 6jaO2gA3eHcvUniDaA9cV50kcLysualAqDLZHFuF4kcU3MdJ1t2E6tjX9cWy2lfdVF9s ByQYRkqADG1AcbxqXSQCeCIwHCQsI5zsr3hNAOBoRguiNi/UfRglK8IrvaCCjrX9f5vZ NA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3rwj6gr0p2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 18 Jul 2023 02:44:20 +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 36I2i5KO015392; Tue, 18 Jul 2023 02:44:19 GMT Received: from ppma13.dal12v.mail.ibm.com (dd.9e.1632.ip4.static.sl-reverse.com [50.22.158.221]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3rwj6gr0nu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 18 Jul 2023 02:44:19 +0000 Received: from pps.filterd (ppma13.dal12v.mail.ibm.com [127.0.0.1]) by ppma13.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 36HK0R9F009611; Tue, 18 Jul 2023 02:44:18 GMT Received: from smtprelay06.wdc07v.mail.ibm.com ([172.16.1.73]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 3rv80j1hf3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 18 Jul 2023 02:44:18 +0000 Received: from smtpav02.dal12v.mail.ibm.com (smtpav02.dal12v.mail.ibm.com [10.241.53.101]) by smtprelay06.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 36I2iHl92425456 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 18 Jul 2023 02:44:17 GMT Received: from smtpav02.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 87BE05805C; Tue, 18 Jul 2023 02:44:17 +0000 (GMT) Received: from smtpav02.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 826175805A; Tue, 18 Jul 2023 02:44:13 +0000 (GMT) Received: from skywalker.ibmuc.com (unknown [9.43.62.199]) by smtpav02.dal12v.mail.ibm.com (Postfix) with ESMTP; Tue, 18 Jul 2023 02:44:13 +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 v4 0/6] Add support for memmap on memory feature on ppc64 Date: Tue, 18 Jul 2023 08:14:03 +0530 Message-ID: <20230718024409.95742-1-aneesh.kumar@linux.ibm.com> X-Mailer: git-send-email 2.41.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: ryOY_6AoALwuZUkz7Mq3nckED12_Nblo X-Proofpoint-GUID: 0PyZN0drMhvgkarcI5Np4xizfMu-EHlQ 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-17_15,2023-07-13_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 mlxlogscore=976 impostorscore=0 suspectscore=0 spamscore=0 bulkscore=0 clxscore=1015 lowpriorityscore=0 priorityscore=1501 malwarescore=0 mlxscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2306200000 definitions=main-2307180022 X-Rspamd-Queue-Id: 8A00016000E X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: uifa5d44rmb3jjc7w7xkq3ifc1xg45a4 X-HE-Tag: 1689648268-291943 X-HE-Meta: U2FsdGVkX1/y80vcbZYH7UEReTaFwjIOWwAA+b2JJw2vJUGYYTLrGb7poFpk76aceONexsmkcpZUgysSqLI1vxEzWp8q4ewHptOEbPLmrcJ+CCU3+LeFfvqxGbaE/Rgui1qhCM6S/30rs1lW4BLlrqeaykG5r6QiorqJdk9mQwMypa5RQtDiJS33NljJaDxTe2kqdxqkdDd94IsPrzo/7wznL761ax3m2J3lrxPqWuHrvUoCgUE8uD8/+MSdhqNtghYCh05RyY6qcWi422ZZH09qWzTBMKQu0ueDtnj0rQa/zKUDQ/P365UcI04A6OvijRRkDO29wm+l/6I1bYGjArT/BOYKyNcFS8d3SOkFOmJ5seFGtgR1uo2uBntjUabQZCKemVHCeSAPfPWm7sl+K+pddULDLPkruuwc5fEy8oVeaMhdrHJ3J518Oh+xpBm9rPyJPav1v0eaONcYhbEjTo/bY86v4raaipaydEvO89LrO7BxwKblJ2vyjQHeuw+PCNIu3obecERNVBPA7e/crTesJEgZB+EXNcJIl4Yuqfdmt4gilXuXW1V0mzio++Ijel4G+hE46hRXcpSAo7JNTO1OmXRf0dnl8YoH6dfvTY/pKpzxv/Wmb3CH3rITMwOS7H8P8WpGVC6mNuf0Ms7nYvmwGzsFt08jXLxNoDgpPFc4fcU2HOfmqpCwnrSLBaBYPCMXvT9sluRV3uwT2oBXQgza6I1Q3Ac6vdUg+bHAGyiqmHBWIYYA9hmNgStrrmo4lW5fXJNEDhUlThkaDTDVmtgO6HHKCnxXbk1Vl/Kvh9ny7YlofJF0e6o9D6tlfvwf5duySgCHpj7L5kzXb5BkPWH5ylK26NPoUWLoxHsQgtNTe+vMb2nFIQVJUyTxJTRteMdN+i9ssJgzecYASCEi9aAUo9732ZGT09PsJAkfxG5yi0dym05KNd2BJcy7tMQ4m3yba9wGFQoFSnpkFU7 guf42XqX YI7tXMjT/6OAjrWue1UXcuwyWM2S20oO+FogpFqg0zD5UrJVNAsINNDTIyj17bjxsH89gbJs3NlxHkrFmGCOGG718P3lfUugAW79qtWs5mdZW43LrdKd31geZXYEIieZxTB8JanBjxJ3UScWeRMxs8vvH1V64i5pPizlA35+6hsntx6HiQD0eWZWbmN3X1sXd9Usw0i165LobGoXejIcZabIS+3lSgLsjNLdFCsLsKmcFx3bSfaJL2r0yQ9MIlq+4E7rkSKnaMV+t6xrd1e388IZvfXuv6sWvbLYYLWSHkHj6CAc= 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 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 (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 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 | 168 ++++++++++++++---- 11 files changed, 193 insertions(+), 60 deletions(-)