From patchwork Thu Jul 20 07:14:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Verma, Vishal L" X-Patchwork-Id: 13319892 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 80963C00528 for ; Thu, 20 Jul 2023 07:14:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EBE2F2800C5; Thu, 20 Jul 2023 03:14:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E1F5728004C; Thu, 20 Jul 2023 03:14:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C72632800C5; Thu, 20 Jul 2023 03:14:35 -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 AEE6828004C for ; Thu, 20 Jul 2023 03:14:35 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 8A55A1A01AF for ; Thu, 20 Jul 2023 07:14:35 +0000 (UTC) X-FDA: 81031127310.19.CEDB2A3 Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by imf18.hostedemail.com (Postfix) with ESMTP id 5CA741C0008 for ; Thu, 20 Jul 2023 07:14:33 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b="Z/8/BjyL"; dmarc=pass (policy=none) header.from=intel.com; spf=pass (imf18.hostedemail.com: domain of vishal.l.verma@intel.com designates 134.134.136.31 as permitted sender) smtp.mailfrom=vishal.l.verma@intel.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1689837273; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=W0lOkgpc+9SzpjV4Ig0AXo/m0HIEEdmCnill7tcYX7I=; b=QkIZ3MuWYemsq7mQU4MVH5HeSXG8QmDq7aNF2veYLs2+sJDM2/5zp+tHXKZHXGxX0ncfWj kYGPsoL4Xo+18eyYl4xp4D5UNI2MwhWLUl8DxzkF5UUeqs8lggk8YxlkzvDls8xMCoSCw+ mZL9bgMX2eLHOA0VOWvKLkvKBSR7wXo= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b="Z/8/BjyL"; dmarc=pass (policy=none) header.from=intel.com; spf=pass (imf18.hostedemail.com: domain of vishal.l.verma@intel.com designates 134.134.136.31 as permitted sender) smtp.mailfrom=vishal.l.verma@intel.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1689837273; a=rsa-sha256; cv=none; b=5VTorf75kVf7zTvzAGlfkJ1UTxdvd7IwstDa3Ov576MdSG5q42DZSA434t9EuOX6tgsG7G BOEEBxY9Maja16ryZqfYAgQUdSYde8XAulefJT4eQlAvOnl04JohUofUhz2DqBzd98pbxs R5/6sym9EAKzxaoMbVtf7++yrtoPRVI= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1689837273; x=1721373273; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=Xs/UipfGvLxTajC0Rm3FutNPJhFtxOc43qHe7lqOerY=; b=Z/8/BjyLJT+Wlm1Jz4Wk26od2ojUukMKW3punlfjm9AY6UpjmwHf0qUP TbbhmXuYil3Mtq9q6oMSg/e96c31k6YdBIZMpeR5HXCtzXLmyyp4oZ/mW VO2+TBDiszhf8Vq9KIAJiD6/V5uQa7l5t4TBS+uxACmBURAvnM9R+gzm+ BMZQCqgW1v9s9oiQiRjfxd00zMh+yYDHqlV0eqpJ4ce2pY1t1Ro1Mr2/P DQ2HusryWrxbAChPLAkHjKjcsO/wKbqq8QoBT57uEu0+UXEcwwI1+tspu hgr3AXdIW5hk4WZZujfJom1UP2d+BAEa8NY2g1gSGi4dZeUglgF6u2SfF Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10776"; a="430423999" X-IronPort-AV: E=Sophos;i="6.01,218,1684825200"; d="scan'208";a="430423999" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jul 2023 00:14:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10776"; a="794334963" X-IronPort-AV: E=Sophos;i="6.01,218,1684825200"; d="scan'208";a="794334963" Received: from mfgalan-mobl1.amr.corp.intel.com (HELO [192.168.1.200]) ([10.213.172.204]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jul 2023 00:14:29 -0700 From: Vishal Verma Date: Thu, 20 Jul 2023 01:14:22 -0600 Subject: [PATCH v2 1/3] mm/memory_hotplug: Export symbol mhp_supports_memmap_on_memory() MIME-Version: 1.0 Message-Id: <20230720-vv-kmem_memmap-v2-1-88bdaab34993@intel.com> References: <20230720-vv-kmem_memmap-v2-0-88bdaab34993@intel.com> In-Reply-To: <20230720-vv-kmem_memmap-v2-0-88bdaab34993@intel.com> To: Andrew Morton , David Hildenbrand , Oscar Salvador , Dan Williams , Dave Jiang Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, nvdimm@lists.linux.dev, linux-cxl@vger.kernel.org, Huang Ying , Dave Hansen , "Aneesh Kumar K.V" , Jonathan Cameron , Jeff Moyer , Vishal Verma X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=1866; i=vishal.l.verma@intel.com; h=from:subject:message-id; bh=Xs/UipfGvLxTajC0Rm3FutNPJhFtxOc43qHe7lqOerY=; b=owGbwMvMwCXGf25diOft7jLG02pJDCk77l05/3bRlO0HRGt3l/1Y+qNe3Wzlkv+flP2CnC4d+ 27Ly+NwoaOUhUGMi0FWTJHl756PjMfktufzBCY4wsxhZQIZwsDFKQATub2SkaFxwmNetUNtifs0 jJyK+GWuXObfuVZ0f0vNtFhNozqZlQyMDPfzRPRPe0x/19WUOsF+g+UCnWtP3jSX3VjY1NJxc8p rIzYA X-Developer-Key: i=vishal.l.verma@intel.com; a=openpgp; fpr=F8682BE134C67A12332A2ED07AFA61BEA3B84DFF X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 5CA741C0008 X-Stat-Signature: 16fgyxy7yyk3ui7qbxqjuth7n7wteysc X-Rspam-User: X-HE-Tag: 1689837273-115402 X-HE-Meta: U2FsdGVkX1/cTP2AMV3DxqxlUyTzkqXdlC9GON4Fqkg+C38cV+cJMG3f//KGMPFuJZAQhSzrj/91Jmany8u+yNHx0Lw7naAazexS66uYI6DczwlpzxFIZP+wPV/3FSfloBQM1xvN4YxyQ2hh2j4oUXz14kXlnmBu4TlHNnwdtI1JPYx4Sav6br7tzgAdOS65xAGdKw8DzUyq6MDGMFkgFhKp7r4gZ0/z0F5jKe49mY+SOQQ/WBv+6OuVGgyxbVLXEuZgLkxIK7VJhr7kW1n8O7QS17KdhNb6IDzk01kZvyizJRP3gZOM5pp8mSYQAP9fHchmJATA+ItDSjTgbLTBTbtyXYVVH7Nka3R+L+lq+MlG0AUjzhNpWABHIbO3vDlVAqW/1Wi2fwgDCY31bNCpSN+rnLbtTLQ3opCRG02dNKhjWtusRR9rDAn6XZDBXWBWBNbsH8tXD5pujNlfLVJvwzCD0mVcC8rtK7HcrCL9KwFiJqfrhI2ZJvwShmns7zBQ4OPrvBsSws1xgfjLHNFZpCwH7JQ827kmR16WX3pxRBJnAJEDuKcC8t83kl0YD+ASLhzgi9C8H6yiHCvETXSACqdoz35J8mnXVseCKLqN4hxyAShZNbfOkWMDG9f6SRATE4nWjBK5pCgiS0mycT1a159a2GETG5XYPUtJE1H8xJgP7tMMswQP0zL2J+QjvT55sPWqIlTyqhqb2tK58CA3j+P4jUyKoSJNUPFVz4DK2qRYEF3bJ16HXtSDqZjpB2iZuRRk+u/lw35SUevlUxROz9igo2xRK9ZMZ7vwQq6eBkybSx9wMPDryTqfrSTjil0mMcv/C3nDib43kHATYMrYISXCWXT6aVw1vAHI0hZcEY1Xy57rxOopIK12ZooEN1cexcfnIrDxlQs5bouqdDcMKeloNTXEM55H3xaL6fWAKkNa78ViQtqqWYNnoK1DZiIS2qeZAkdfYhnMw9owq3Y h6jGuunn d+FqskMxhGCCZ9s48ZX0O+7eVPV0qv2GjW70hNr7D7SJwm0KRk5Sw/mE7z6ty1Pfd8hfdeIqj8mvLWeB2BLCjdZs9BVAOopQfLR763XdV5fCbD1GA8i5F2BcufQEevUKK1KOPeemukbjoIykDQ//YWg9F/B+OBMdoNfXLQK0H7thV/gj0WB1HPp78c3WtUXPdW9i6WNWc1oA78E6ETbqdbQqIgxNyFJF+KZ3yEbY+MkPMyMfzjz9w0bfdAUuvlqu9XL2qYukKwjGnb3b8yYv/rDF+sd+u0BeGrr+niyvljQ9F7/0= 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: In preparation for dax drivers, which can be built as modules, to use this interface, export it with EXPORT_SYMBOL_GPL(). Add a #else case for the symbol for builds without CONFIG_MEMORY_HOTPLUG. Cc: Andrew Morton Cc: David Hildenbrand Cc: Oscar Salvador Cc: Dan Williams Cc: Dave Jiang Cc: Dave Hansen Cc: Huang Ying Reviewed-by: David Hildenbrand Signed-off-by: Vishal Verma --- include/linux/memory_hotplug.h | 5 +++++ mm/memory_hotplug.c | 1 + 2 files changed, 6 insertions(+) diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h index 013c69753c91..fc5da07ad011 100644 --- a/include/linux/memory_hotplug.h +++ b/include/linux/memory_hotplug.h @@ -355,6 +355,11 @@ extern int arch_create_linear_mapping(int nid, u64 start, u64 size, struct mhp_params *params); void arch_remove_linear_mapping(u64 start, u64 size); extern bool mhp_supports_memmap_on_memory(unsigned long size); +#else +static inline bool mhp_supports_memmap_on_memory(unsigned long size) +{ + return false; +} #endif /* CONFIG_MEMORY_HOTPLUG */ #endif /* __LINUX_MEMORY_HOTPLUG_H */ diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index 3f231cf1b410..e9bcacbcbae2 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c @@ -1284,6 +1284,7 @@ bool mhp_supports_memmap_on_memory(unsigned long size) IS_ALIGNED(vmemmap_size, PMD_SIZE) && IS_ALIGNED(remaining_size, (pageblock_nr_pages << PAGE_SHIFT)); } +EXPORT_SYMBOL_GPL(mhp_supports_memmap_on_memory); /* * NOTE: The caller must call lock_device_hotplug() to serialize hotplug From patchwork Thu Jul 20 07:14:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Verma, Vishal L" X-Patchwork-Id: 13319893 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 EA128C04A6A for ; Thu, 20 Jul 2023 07:14:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5965C2800C6; Thu, 20 Jul 2023 03:14:37 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 546C628004C; Thu, 20 Jul 2023 03:14:37 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 372C72800C6; Thu, 20 Jul 2023 03:14:37 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 26F7A28004C for ; Thu, 20 Jul 2023 03:14:37 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id D53F91C8282 for ; Thu, 20 Jul 2023 07:14:36 +0000 (UTC) X-FDA: 81031127352.06.E7E7E6B Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by imf06.hostedemail.com (Postfix) with ESMTP id 93FEA180005 for ; Thu, 20 Jul 2023 07:14:34 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=hU+rBqga; dmarc=pass (policy=none) header.from=intel.com; spf=pass (imf06.hostedemail.com: domain of vishal.l.verma@intel.com designates 134.134.136.31 as permitted sender) smtp.mailfrom=vishal.l.verma@intel.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1689837274; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=Phx0ByrluJXhHMzZbbDlUg7LgXPVxrz+0rZQDu1OtAI=; b=kEd1zuqElXanRI2n4YKs23kGy4FSt8MtCF0O2NH5aDjY6/hLs0t3Mh0FNDYUroeySaTTKf YfUvA3txV1fyS1ZuAd+uqQtlySZO7c5YSK5gE7MpwMamjIsgDgB8fDJ/KwzZawLNWl/yqN rUc+bPHtdmITd1yBsW0JXiA65HRGwpI= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=hU+rBqga; dmarc=pass (policy=none) header.from=intel.com; spf=pass (imf06.hostedemail.com: domain of vishal.l.verma@intel.com designates 134.134.136.31 as permitted sender) smtp.mailfrom=vishal.l.verma@intel.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1689837274; a=rsa-sha256; cv=none; b=58/E8NzJMmp+A1GGn4+tJRY2Ow4GDD8gDsSa0n95BzqYP9Pa+zfPD6AHjm2t0usZU+Kkzh ycUmu3uJfA1auxSsKKGWG37w+3jFAK42+4vcpKufzfYGakkBG90HFhGTv5+xg1wWReWHOd pD5Ej2Rdnb3AcKl0VIepACj1HHqvZ2g= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1689837274; x=1721373274; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=k4XpCfq0ZxU/xUvbPf7nQuvL2vPIJUVSa8ob3/AsbKg=; b=hU+rBqgaHD0nUZeOaiIpI9nD4WhLpJQro7RkpBo5KvWwN2jDaAkh/Eai /panqwW5ypHU4sSHushZMkX8smCR1fuQjMxhGtC1q0QW+vPzC78IThjAp RYb+95Qt9Z1xumhRiptQzXthP/Dp4edk10q1LQlPXiWA+5TTKeqOt6QVg 10FVjZ0Raq29txBt2UYdSKbF9PrBlE+cNrANJMp0uBWQWKuS9/aHA5Vnk cbaKliwI/jzGzR1TqWxIX9XacWIJiu97GSC9dW4c27bcGrUMwIYOWSia1 4umBct2hQnUwpVfq/Ju7grSkNnxqcIV3Dzr0SYvYB0zqna5NLOAA/9MyX w==; X-IronPort-AV: E=McAfee;i="6600,9927,10776"; a="430424012" X-IronPort-AV: E=Sophos;i="6.01,218,1684825200"; d="scan'208";a="430424012" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jul 2023 00:14:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10776"; a="794334967" X-IronPort-AV: E=Sophos;i="6.01,218,1684825200"; d="scan'208";a="794334967" Received: from mfgalan-mobl1.amr.corp.intel.com (HELO [192.168.1.200]) ([10.213.172.204]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jul 2023 00:14:29 -0700 From: Vishal Verma Date: Thu, 20 Jul 2023 01:14:23 -0600 Subject: [PATCH v2 2/3] mm/memory_hotplug: split memmap_on_memory requests across memblocks MIME-Version: 1.0 Message-Id: <20230720-vv-kmem_memmap-v2-2-88bdaab34993@intel.com> References: <20230720-vv-kmem_memmap-v2-0-88bdaab34993@intel.com> In-Reply-To: <20230720-vv-kmem_memmap-v2-0-88bdaab34993@intel.com> To: Andrew Morton , David Hildenbrand , Oscar Salvador , Dan Williams , Dave Jiang Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, nvdimm@lists.linux.dev, linux-cxl@vger.kernel.org, Huang Ying , Dave Hansen , "Aneesh Kumar K.V" , Jonathan Cameron , Jeff Moyer , Vishal Verma X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=7769; i=vishal.l.verma@intel.com; h=from:subject:message-id; bh=k4XpCfq0ZxU/xUvbPf7nQuvL2vPIJUVSa8ob3/AsbKg=; b=owGbwMvMwCXGf25diOft7jLG02pJDCk77l1RLYhbXWCzitdb+8Lhnk2Tb7DpHwm7w/ZyWs22J ZYZZ1KEO0pZGMS4GGTFFFn+7vnIeExuez5PYIIjzBxWJpAhDFycAjCRdbcY/ueUHputFtleKatx u6V+w0y1WofLhnM4luy4NinkuyBXswXDX9FDsx8wlRm5XmgKW2f8xVBd7s+bqcw/30wwLHTduvi AJBMA X-Developer-Key: i=vishal.l.verma@intel.com; a=openpgp; fpr=F8682BE134C67A12332A2ED07AFA61BEA3B84DFF X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 93FEA180005 X-Stat-Signature: bbda8b3bhbpmx5i7jzio751xy9nh98eu X-Rspam-User: X-HE-Tag: 1689837274-875416 X-HE-Meta: U2FsdGVkX1+cecPl36Umso4NKuRGHLwrpng80ghfF2R31wiN7dsEnU4q5nFcSeRU/5HNG77n3x05HDIoGGkleU6Nu9ohEKp1jgTV9NiKAAORZ6xNodI3WVRUGjAbVVZeHneoVjROOkC/IG60ea6W6SrkhDMKTywK5jguy+yRFMc0b7IDeKP+1YLBdzc5iUTZ2ikXJXftcIhURUzZA70c1RjBD3Jl8R/wB34MzGM5ME58u5Z1p84iAxJiRRLBUFiDX2b8ZQ5XVQFLL6i89L/NAkVlO5vNMZMQvnENUFxQaf/nUEjTjllo0Wxgd+kzxY4W0wzR9s3SMBTV1Su9Z1vP/mG8xH9sHPU8qc+W06e89cjsgaTLhhgfwMpA0Q76nE4XQKwiWTCjk2r14gVpXmRtFe9LfTwANMOaz6yx4HxOSk1YlLMvXXIVltQ2zDcOCD9sXwsbZSl24wn7GtLYk64qBbtYfnoY0hXYwA4CIUrNyNUw4dMWHQFz7qGC9f6d8xxljynV/YGW71RsuePA1EIoTC57yBD0MfWIt4Et/Cyx991hem9M5OVcFRBUBX/AiwK/ARRC8TgTeLKoxj9k0bGZZs7ky/4cdu8T4TAHRne/FAPmvq4c1Pr6Ie2BLCGWM77ffZ9R6MERaLDSHv5DXFLsNPpkha9GBWJaJHAx5/wtv8B+o9+hNggIrvDQYJ6gDKusSuyzgJQVxmUNbtaSmA6V5AcF4dgWOt/F+YGW7ly666jUAvGLJq6gM08dG/1mJM9AZeflXnCiq8lz++ZpY2ZapW8rSKfqZ8kVPu0cxW8bTuI2bT/QjWinyhzVWQNX9aAYMccufWBvbQXx4dCmWaRmNzMbS5y2l+B+2CpRgkFdV8NFsdm8e7grkdrDU5GkWrZjdZfqANbvpFjuwlzemYgednxfm7fSbO8WXhFytlZtxeRpS+EB7zXO4fVj4WiFMBN7W9eUter9bTMklxohWyA hWsHgSPh LtgUjF4tAPrqXdEiyf1axxmtn2jrnm9Gr0C96uP5b2yN5ODTXyWxR0SZJJPHxweL6B1M+I/N5judF1AiwcDoJvIdz4GVU5oiYUUIkZ6ZmWWYpAoC6gbOoul60EcJDuUc70ONgEjdPSmQ+MuDkWoynIMaCev5yHnnFUqzrG8z6FApjHbCmQ+d1644HYCeRm8yQ1LPeZO/tTKegzGPg57ri2qKhWJBiLNO+FivM93FH5/09/em/2xj2bLBzrZASUypDFV9jJSHGSkGq4XvDgDT7QW62hyYskGKk4oXKxKKk+CgMsF+2OLyFmjIk0g== 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: The MHP_MEMMAP_ON_MEMORY flag for hotplugged memory is currently restricted to 'memblock_size' chunks of memory being added. Adding a larger span of memory precludes memmap_on_memory semantics. For users of hotplug such as kmem, large amounts of memory might get added from the CXL subsystem. In some cases, this amount may exceed the available 'main memory' to store the memmap for the memory being added. In this case, it is useful to have a way to place the memmap on the memory being added, even if it means splitting the addition into memblock-sized chunks. Change add_memory_resource() to loop over memblock-sized chunks of memory if caller requested memmap_on_memory, and if other conditions for it are met,. Teach try_remove_memory() to also expect that a memory range being removed might have been split up into memblock sized chunks, and to loop through those as needed. Cc: Andrew Morton Cc: David Hildenbrand Cc: Oscar Salvador Cc: Dan Williams Cc: Dave Jiang Cc: Dave Hansen Cc: Huang Ying Suggested-by: David Hildenbrand Signed-off-by: Vishal Verma --- mm/memory_hotplug.c | 154 +++++++++++++++++++++++++++++++--------------------- 1 file changed, 91 insertions(+), 63 deletions(-) diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index e9bcacbcbae2..20456f0d28e6 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c @@ -1286,6 +1286,35 @@ bool mhp_supports_memmap_on_memory(unsigned long size) } EXPORT_SYMBOL_GPL(mhp_supports_memmap_on_memory); +static int add_memory_create_devices(int nid, struct memory_group *group, + u64 start, u64 size, mhp_t mhp_flags) +{ + struct mhp_params params = { .pgprot = pgprot_mhp(PAGE_KERNEL) }; + struct vmem_altmap mhp_altmap = {}; + int ret; + + if ((mhp_flags & MHP_MEMMAP_ON_MEMORY)) { + mhp_altmap.free = PHYS_PFN(size); + mhp_altmap.base_pfn = PHYS_PFN(start); + params.altmap = &mhp_altmap; + } + + /* call arch's memory hotadd */ + ret = arch_add_memory(nid, start, size, ¶ms); + if (ret < 0) + return ret; + + /* create memory block devices after memory was added */ + ret = create_memory_block_devices(start, size, mhp_altmap.alloc, + group); + if (ret) { + arch_remove_memory(start, size, NULL); + return ret; + } + + return 0; +} + /* * NOTE: The caller must call lock_device_hotplug() to serialize hotplug * and online/offline operations (triggered e.g. by sysfs). @@ -1294,11 +1323,10 @@ EXPORT_SYMBOL_GPL(mhp_supports_memmap_on_memory); */ int __ref add_memory_resource(int nid, struct resource *res, mhp_t mhp_flags) { - struct mhp_params params = { .pgprot = pgprot_mhp(PAGE_KERNEL) }; + unsigned long memblock_size = memory_block_size_bytes(); enum memblock_flags memblock_flags = MEMBLOCK_NONE; - struct vmem_altmap mhp_altmap = {}; struct memory_group *group = NULL; - u64 start, size; + u64 start, size, cur_start; bool new_node = false; int ret; @@ -1339,27 +1367,20 @@ int __ref add_memory_resource(int nid, struct resource *res, mhp_t mhp_flags) /* * Self hosted memmap array */ - if (mhp_flags & MHP_MEMMAP_ON_MEMORY) { - if (!mhp_supports_memmap_on_memory(size)) { - ret = -EINVAL; + if ((mhp_flags & MHP_MEMMAP_ON_MEMORY) && + mhp_supports_memmap_on_memory(memblock_size)) { + for (cur_start = start; cur_start < start + size; + cur_start += memblock_size) { + ret = add_memory_create_devices(nid, group, cur_start, + memblock_size, + mhp_flags); + if (ret) + goto error; + } + } else { + ret = add_memory_create_devices(nid, group, start, size, mhp_flags); + if (ret) goto error; - } - mhp_altmap.free = PHYS_PFN(size); - mhp_altmap.base_pfn = PHYS_PFN(start); - params.altmap = &mhp_altmap; - } - - /* call arch's memory hotadd */ - ret = arch_add_memory(nid, start, size, ¶ms); - if (ret < 0) - goto error; - - /* create memory block devices after memory was added */ - ret = create_memory_block_devices(start, size, mhp_altmap.alloc, - group); - if (ret) { - arch_remove_memory(start, size, NULL); - goto error; } if (new_node) { @@ -2035,12 +2056,38 @@ void try_offline_node(int nid) } EXPORT_SYMBOL(try_offline_node); -static int __ref try_remove_memory(u64 start, u64 size) +static void __ref __try_remove_memory(int nid, u64 start, u64 size, + struct vmem_altmap *altmap) { - struct vmem_altmap mhp_altmap = {}; - struct vmem_altmap *altmap = NULL; - unsigned long nr_vmemmap_pages; - int rc = 0, nid = NUMA_NO_NODE; + /* remove memmap entry */ + firmware_map_remove(start, start + size, "System RAM"); + + /* + * Memory block device removal under the device_hotplug_lock is + * a barrier against racing online attempts. + */ + remove_memory_block_devices(start, size); + + mem_hotplug_begin(); + + arch_remove_memory(start, size, altmap); + + if (IS_ENABLED(CONFIG_ARCH_KEEP_MEMBLOCK)) { + memblock_phys_free(start, size); + memblock_remove(start, size); + } + + release_mem_region_adjustable(start, size); + + if (nid != NUMA_NO_NODE) + try_offline_node(nid); + + mem_hotplug_done(); +} + +static int try_remove_memory(u64 start, u64 size) +{ + int rc, nid = NUMA_NO_NODE; BUG_ON(check_hotplug_memory_range(start, size)); @@ -2058,20 +2105,21 @@ static int __ref try_remove_memory(u64 start, u64 size) return rc; /* - * We only support removing memory added with MHP_MEMMAP_ON_MEMORY in - * the same granularity it was added - a single memory block. + * For memmap_on_memory, the altmaps could have been added on + * a per-memblock basis. Loop through the entire range if so, + * and remove each memblock and its altmap */ if (mhp_memmap_on_memory()) { - nr_vmemmap_pages = walk_memory_blocks(start, size, NULL, - get_nr_vmemmap_pages_cb); - if (nr_vmemmap_pages) { - if (size != memory_block_size_bytes()) { - pr_warn("Refuse to remove %#llx - %#llx," - "wrong granularity\n", - start, start + size); - return -EINVAL; - } + unsigned long memblock_size = memory_block_size_bytes(); + struct vmem_altmap mhp_altmap = {}; + struct vmem_altmap *altmap; + u64 cur_start; + for (cur_start = start; cur_start < start + size; + cur_start += memblock_size) { + unsigned long nr_vmemmap_pages = + walk_memory_blocks(start, memblock_size, NULL, + get_nr_vmemmap_pages_cb); /* * Let remove_pmd_table->free_hugepage_table do the * right thing if we used vmem_altmap when hot-adding @@ -2079,33 +2127,13 @@ static int __ref try_remove_memory(u64 start, u64 size) */ mhp_altmap.alloc = nr_vmemmap_pages; altmap = &mhp_altmap; + __try_remove_memory(nid, cur_start, memblock_size, + altmap); } + } else { + __try_remove_memory(nid, start, size, NULL); } - /* remove memmap entry */ - firmware_map_remove(start, start + size, "System RAM"); - - /* - * Memory block device removal under the device_hotplug_lock is - * a barrier against racing online attempts. - */ - remove_memory_block_devices(start, size); - - mem_hotplug_begin(); - - arch_remove_memory(start, size, altmap); - - if (IS_ENABLED(CONFIG_ARCH_KEEP_MEMBLOCK)) { - memblock_phys_free(start, size); - memblock_remove(start, size); - } - - release_mem_region_adjustable(start, size); - - if (nid != NUMA_NO_NODE) - try_offline_node(nid); - - mem_hotplug_done(); return 0; } From patchwork Thu Jul 20 07:14:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Verma, Vishal L" X-Patchwork-Id: 13319894 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 03236EB64DC for ; Thu, 20 Jul 2023 07:14:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DD3682800C7; Thu, 20 Jul 2023 03:14:37 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D855228004C; Thu, 20 Jul 2023 03:14:37 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BFC922800C7; Thu, 20 Jul 2023 03:14:37 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id AD18228004C for ; Thu, 20 Jul 2023 03:14:37 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 7A50414019D for ; Thu, 20 Jul 2023 07:14:37 +0000 (UTC) X-FDA: 81031127394.03.7016FF7 Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by imf24.hostedemail.com (Postfix) with ESMTP id 4DA01180008 for ; Thu, 20 Jul 2023 07:14:35 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=f9BaE0uY; dmarc=pass (policy=none) header.from=intel.com; spf=pass (imf24.hostedemail.com: domain of vishal.l.verma@intel.com designates 134.134.136.31 as permitted sender) smtp.mailfrom=vishal.l.verma@intel.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1689837275; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=2lb74J4vq0tnX93fJOShs+tqDeVLsOiO9xPRGdqXRcs=; b=qewThroB8Xr2LD1PKY3E8yWI5tVCRvKBNhN4Jcv1uWPHK9Q8ByWuEl0XcoNC+W/M0+eg5A zgOYBe8/Zvrn1/71H0DMcLqL41NRDK27aOMGneNlnhI1RYBHRycOa7d4yyVxOToVCbhO+j rqc55mqUa9QU4T5FYQgZkBev7H976EU= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=f9BaE0uY; dmarc=pass (policy=none) header.from=intel.com; spf=pass (imf24.hostedemail.com: domain of vishal.l.verma@intel.com designates 134.134.136.31 as permitted sender) smtp.mailfrom=vishal.l.verma@intel.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1689837275; a=rsa-sha256; cv=none; b=vgWTrA5C24JKsAAcrbkaOrNH2MCPTI27voarQlIQco66ahX7J4TtHFwhmkI3R8jUPwi93K MikDuCD7gfsPLxdsz5TNuAwprG6O9su2/X/s+4w8M6QFBf8RNIdfkgfZSSUa7O44xxTWH8 1bMvD7FLBJo5z72GWiOBJQ/D0TX/H28= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1689837275; x=1721373275; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=t5Tx1xjKMmZzJYwXq10A5dhCDPrE7RYDBM8wVBgMdO0=; b=f9BaE0uYOJBDkiY4BUzeAEL2xT6pbw3TFt7ikGHp/m2LkcqhsIPeqAb4 ECU/WwHCLuFjiBr/r8U+QzXCEQuaVDJen0T0uWEtbNNro5JMPlfI7q1p8 9zjAb8c6ZNDoAmeluztXF5WJd0gWgCmODZXnZrXeSv0++lXbrdCRc+Y7m 0EiBmNomqnYaB9HzK0ZZLp3WGC667687aK4F6ctpsGjdTRJZ72QevaQyY pV1iuPDmRZb2h0q1Vv1uWyvdIlNFXENFutv5cGVhCyw+l47s1FwG1lscr MGD2aDrUGPpowfgReIh3EUFVJHkMrbRPvHk16/7l7T090ACRE4kRxD20E w==; X-IronPort-AV: E=McAfee;i="6600,9927,10776"; a="430424020" X-IronPort-AV: E=Sophos;i="6.01,218,1684825200"; d="scan'208";a="430424020" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jul 2023 00:14:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10776"; a="794334971" X-IronPort-AV: E=Sophos;i="6.01,218,1684825200"; d="scan'208";a="794334971" Received: from mfgalan-mobl1.amr.corp.intel.com (HELO [192.168.1.200]) ([10.213.172.204]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jul 2023 00:14:30 -0700 From: Vishal Verma Date: Thu, 20 Jul 2023 01:14:24 -0600 Subject: [PATCH v2 3/3] dax/kmem: allow kmem to add memory with memmap_on_memory MIME-Version: 1.0 Message-Id: <20230720-vv-kmem_memmap-v2-3-88bdaab34993@intel.com> References: <20230720-vv-kmem_memmap-v2-0-88bdaab34993@intel.com> In-Reply-To: <20230720-vv-kmem_memmap-v2-0-88bdaab34993@intel.com> To: Andrew Morton , David Hildenbrand , Oscar Salvador , Dan Williams , Dave Jiang Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, nvdimm@lists.linux.dev, linux-cxl@vger.kernel.org, Huang Ying , Dave Hansen , "Aneesh Kumar K.V" , Jonathan Cameron , Jeff Moyer , Vishal Verma X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=4666; i=vishal.l.verma@intel.com; h=from:subject:message-id; bh=t5Tx1xjKMmZzJYwXq10A5dhCDPrE7RYDBM8wVBgMdO0=; b=owGbwMvMwCXGf25diOft7jLG02pJDCk77l35ZGnE8/cqw/EfF2OW2vyb9m391imrjrKf35uns 3TSlR0d5zpKWRjEuBhkxRRZ/u75yHhMbns+T2CCI8wcViaQIQxcnAIwkVMJDP/U/uSYVR7RlF/V lsH2ziKjUffFKtY0pZKjzGzthpadntcY/gcnRfPsPtXH5hbMads97c9Ve8UJTBPzXX+mPOJaE5D 5hQEA X-Developer-Key: i=vishal.l.verma@intel.com; a=openpgp; fpr=F8682BE134C67A12332A2ED07AFA61BEA3B84DFF X-Rspam-User: X-Stat-Signature: 9rhxx4e99wkb97ccc1hxazkgp49ju6yh X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 4DA01180008 X-HE-Tag: 1689837275-241042 X-HE-Meta: U2FsdGVkX1+mdZhnXU92Pv+PmXDNOg1wihiuxNcY1pkJDuMc0ro8+TyPp9yIyK41Wr4KBJDVJoEMCZbitFWMMk0VQi8DJYpv4BDAatuqF6UXKaBM48Cbo8VurRkOarOtZBE9G+v8eoR4aWi3U/cfPRpnioOUlgUGkDKzqENxkYLKow05Mw1ER2vIZDFjPeEauMijm1oNh8QQjmdjRI2/WQ6LglxVlswGcR+geAuyvaYfZgxEQnpFpppfnzLprR7OWQ+nldoe292oY+eUCdJ2103gFiWeXjunYR5LjVEfzia5W3VK1gaKRtKL2NC8HxL/2DPonwU6TKPcWEGXdYtrYCsucW2gUq+w0BDHYTcfjIV+EsQwgAB/1Pq2RFcfPLl0+9k/h5YW8JPey1YAJDy+UoTlXGvtXInoEFa+RCagWPK8N9bQQGa8h86FufJZ8WKu78SSS+h6QrDnAX9Lm7V8GInyQ/8dpP5a2klgf56x4TrWtU9ClGVo8OeyqKZ4XHep4tfwbqgnRXKvYCuBr8lxmsR0lq6hKv2EeP3TQXw4t1D3aULokhYFdF/AYQDUQFGgoHqOcrJOGQLkoiMwIHDKdKDybLLBwk3iX7tdevhVfUbCvCVhZoRJphhTIk9xjQ4pzs3RiuXFMpmNYlBBYLJ7jCaMb8rHQnMLAiVvIs+hdQV0L/H4Yj0SVBYoCK7q3gpnIutBG7ebj3Zvxk3rJJG0OCD3U6TUYdGuTJ2pWjUAIwwEWJo533jHRpP29MHkfl6OWwOftdGcGL5KZA1Sj+1jQSuVPiVQ+s57FwL0lRgSVAeF2MYuS5RkOmf7HrPRTqpBw3eHUmAbZhUcYRje14/gU6RCpiaTZ7/PnTd4Dv4yC++IYCs33Y/+ZVJ5VlPgBXlk/9S0D+t9KWSgMSdj+KnvnGgpDcF6sefbp48rsOWULlLnW+0edqX1Q44SLnN16tDopwYrTDpf7igj0yEwXAG nVlyrmlZ NCJRpx7IIXnSJKnWnlx49AtRWaVUws2gKVZh4PTk7msSQdsgS3lQPOTZhP7Y+/25r6hans3T4xCC8mdZdJkuo1hUCxfxNtTBP5jdmcYp5ofUUVhqtJmYHNu+ThdHh9uEBKZ+LSSoMB+N6U+mxShEGR/8aNC5WxMTB8EYCz2vZAYcyUWzdHlgod40JquovIiDbo4KHUXfFx8pFRKLECYIJdqpIscjEfmFThLxDz5InvyT4BBkPshzKt06pKEZbyBUL8mQLUavweIU2MAIb8+HRVLf38Dj+ScvY8wSp4IT7QCfvkVjuHRWZNyzPWAdguVqAZXJsNQq2yE2Yj3I= 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: Large amounts of memory managed by the kmem driver may come in via CXL, and it is often desirable to have the memmap for this memory on the new memory itself. Enroll kmem-managed memory for memmap_on_memory semantics as a default if other requirements for it are met. Add a sysfs override under the dax device to opt out of this behavior. Cc: Andrew Morton Cc: David Hildenbrand Cc: Oscar Salvador Cc: Dan Williams Cc: Dave Jiang Cc: Dave Hansen Cc: Huang Ying Signed-off-by: Vishal Verma --- drivers/dax/dax-private.h | 1 + drivers/dax/bus.c | 48 +++++++++++++++++++++++++++++++++++++++++++++++ drivers/dax/kmem.c | 7 ++++++- 3 files changed, 55 insertions(+), 1 deletion(-) diff --git a/drivers/dax/dax-private.h b/drivers/dax/dax-private.h index 27cf2daaaa79..446617b73aea 100644 --- a/drivers/dax/dax-private.h +++ b/drivers/dax/dax-private.h @@ -70,6 +70,7 @@ struct dev_dax { struct ida ida; struct device dev; struct dev_pagemap *pgmap; + bool memmap_on_memory; int nr_range; struct dev_dax_range { unsigned long pgoff; diff --git a/drivers/dax/bus.c b/drivers/dax/bus.c index 0ee96e6fc426..c8e3ea7c674d 100644 --- a/drivers/dax/bus.c +++ b/drivers/dax/bus.c @@ -1,6 +1,8 @@ // SPDX-License-Identifier: GPL-2.0 /* Copyright(c) 2017-2018 Intel Corporation. All rights reserved. */ +#include #include +#include #include #include #include @@ -1269,6 +1271,43 @@ static ssize_t numa_node_show(struct device *dev, } static DEVICE_ATTR_RO(numa_node); +static ssize_t memmap_on_memory_show(struct device *dev, + struct device_attribute *attr, char *buf) +{ + struct dev_dax *dev_dax = to_dev_dax(dev); + + return sprintf(buf, "%d\n", dev_dax->memmap_on_memory); +} + +static ssize_t memmap_on_memory_store(struct device *dev, + struct device_attribute *attr, + const char *buf, size_t len) +{ + struct dev_dax *dev_dax = to_dev_dax(dev); + struct dax_region *dax_region = dev_dax->region; + ssize_t rc; + bool val; + + rc = kstrtobool(buf, &val); + if (rc) + return rc; + + device_lock(dax_region->dev); + if (!dax_region->dev->driver) { + device_unlock(dax_region->dev); + return -ENXIO; + } + + if (mhp_supports_memmap_on_memory(memory_block_size_bytes())) + dev_dax->memmap_on_memory = val; + else + rc = -ENXIO; + + device_unlock(dax_region->dev); + return rc == 0 ? len : rc; +} +static DEVICE_ATTR_RW(memmap_on_memory); + static umode_t dev_dax_visible(struct kobject *kobj, struct attribute *a, int n) { struct device *dev = container_of(kobj, struct device, kobj); @@ -1295,6 +1334,7 @@ static struct attribute *dev_dax_attributes[] = { &dev_attr_align.attr, &dev_attr_resource.attr, &dev_attr_numa_node.attr, + &dev_attr_memmap_on_memory.attr, NULL, }; @@ -1400,6 +1440,14 @@ struct dev_dax *devm_create_dev_dax(struct dev_dax_data *data) dev_dax->align = dax_region->align; ida_init(&dev_dax->ida); + /* + * If supported by memory_hotplug, allow memmap_on_memory behavior by + * default. This can be overridden via sysfs before handing the memory + * over to kmem if desired. + */ + if (mhp_supports_memmap_on_memory(memory_block_size_bytes())) + dev_dax->memmap_on_memory = true; + inode = dax_inode(dax_dev); dev->devt = inode->i_rdev; dev->bus = &dax_bus_type; diff --git a/drivers/dax/kmem.c b/drivers/dax/kmem.c index 898ca9505754..e6976a79093d 100644 --- a/drivers/dax/kmem.c +++ b/drivers/dax/kmem.c @@ -56,6 +56,7 @@ static int dev_dax_kmem_probe(struct dev_dax *dev_dax) unsigned long total_len = 0; struct dax_kmem_data *data; int i, rc, mapped = 0; + mhp_t mhp_flags; int numa_node; /* @@ -136,12 +137,16 @@ static int dev_dax_kmem_probe(struct dev_dax *dev_dax) */ res->flags = IORESOURCE_SYSTEM_RAM; + mhp_flags = MHP_NID_IS_MGID; + if (dev_dax->memmap_on_memory) + mhp_flags |= MHP_MEMMAP_ON_MEMORY; + /* * Ensure that future kexec'd kernels will not treat * this as RAM automatically. */ rc = add_memory_driver_managed(data->mgid, range.start, - range_len(&range), kmem_name, MHP_NID_IS_MGID); + range_len(&range), kmem_name, mhp_flags); if (rc) { dev_warn(dev, "mapping%d: %#llx-%#llx memory add failed\n",