Message ID | 20230801-vv-kmem_memmap-v3-0-406e9aaf5689@intel.com (mailing list archive) |
---|---|
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 77ABEC001DF for <linux-mm@archiver.kernel.org>; Wed, 2 Aug 2023 05:56:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A61D9280128; Wed, 2 Aug 2023 01:56:05 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A1323280112; Wed, 2 Aug 2023 01:56:05 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 900B6280128; Wed, 2 Aug 2023 01:56:05 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 8246F280112 for <linux-mm@kvack.org>; Wed, 2 Aug 2023 01:56:05 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 468D5B23BB for <linux-mm@kvack.org>; Wed, 2 Aug 2023 05:56:05 +0000 (UTC) X-FDA: 81078103890.02.3ADFF69 Received: from mgamail.intel.com (unknown [192.55.52.43]) by imf11.hostedemail.com (Postfix) with ESMTP id 5DA2340019 for <linux-mm@kvack.org>; Wed, 2 Aug 2023 05:56:01 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=HAEm5GTE; dmarc=pass (policy=none) header.from=intel.com; spf=pass (imf11.hostedemail.com: domain of vishal.l.verma@intel.com designates 192.55.52.43 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=1690955763; 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: references:dkim-signature; bh=oHuxwW2MWwkaW4NCGGq7B/AX7x1ErSjM2tkzCJT5djk=; b=Twho5iw/JDM1gMjcJxR2nQ3gox8AdyZLH+tqVOl333gpfO6NrkAq13MrjXh2CIaMsmCqSp 29aGPlH0jzCy/BVsq+dCv0veE23WRbC9yrQMt8NTQhB208QnnUwdt7Bqp/vNA+KBP7RTo5 gq3oTKuHeKDsR48Xc4nIO4BlPfmtzm8= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=HAEm5GTE; dmarc=pass (policy=none) header.from=intel.com; spf=pass (imf11.hostedemail.com: domain of vishal.l.verma@intel.com designates 192.55.52.43 as permitted sender) smtp.mailfrom=vishal.l.verma@intel.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1690955763; a=rsa-sha256; cv=none; b=E6JxNBUcuIIXpqIAvylPXBH5LxBS7tnKsPuWotJ5ogpE4sG8YhqnC3A0ViKk5V45j1nuM8 zU0V+1omCidKDtEz0+5UEIFyKm0OmFng/7QbuqHz3tUAPYNK3VL8eUNF/lq+GY0S3cXb08 4Yp4vUkXR1hLCYVvaOK6ysBayFQ9Qgg= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1690955762; x=1722491762; h=from:subject:date:message-id:mime-version: content-transfer-encoding:to:cc; bh=HwpJuUewgUm91iTLxWOXGqrJHkJjPxKSlGAl+Eindpk=; b=HAEm5GTEkr52YpDN05zNJcCiCrNNNjEM1UPLUZB3UVBXWDUvK1aZ7FVB z/EpKBaQS6oTR3V9ShfzZ07BXGettaVwt231v5PzqXYG2FzFt7U7+ix3Q ADO1bBvVUvZTOcgdzb4kG+biCARFVRqDmlpykMpF6v8IFuGbB3nxoTxxL Id25HGUACYIFRDCT9yw3/HXLIvnQefAOsHltSuapDNiZ7y94CcqGKdbDw R9RRM/fMlVyN3yFqMf0rfVK4lSje6wISH8tF3OohYbsQYj7l2Tie+v5Zb 3nA/IJXbZGSG7krhTHskpqphTv/p14wmxaHEan3d2sKFQ2/n6/SFE+MHa g==; X-IronPort-AV: E=McAfee;i="6600,9927,10789"; a="455857436" X-IronPort-AV: E=Sophos;i="6.01,248,1684825200"; d="scan'208";a="455857436" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Aug 2023 22:55:46 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10789"; a="852746656" X-IronPort-AV: E=Sophos;i="6.01,248,1684825200"; d="scan'208";a="852746656" Received: from hongrudi-mobl.amr.corp.intel.com (HELO [192.168.1.200]) ([10.209.173.200]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Aug 2023 22:55:45 -0700 From: Vishal Verma <vishal.l.verma@intel.com> Subject: [PATCH v3 0/2] mm: use memmap_on_memory semantics for dax/kmem Date: Tue, 01 Aug 2023 23:55:36 -0600 Message-Id: <20230801-vv-kmem_memmap-v3-0-406e9aaf5689@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIANjvyWQC/3WNTQ6CMBhEr0K6tqa0WIor72GM6c+HNNJCWmw0h Ltb2GhiXMziTfJmZhQhWIjoWMwoQLLRDj4D2xVId9LfAFuTGVFCGeElwynhuwN3zXFyxIdKMC0 MqWjdoCwpGQGrIL3usuYffZ/LMUBrn9vL+ZK5s3Eawms7TeXa/t1PJSa45QYazWVLNT9ZP0G/1 4ND61SiH72m5EenWRdCGSkVq5qGfevLsrwB4AmAGwABAAA= To: Andrew Morton <akpm@linux-foundation.org>, David Hildenbrand <david@redhat.com>, Oscar Salvador <osalvador@suse.de>, Dan Williams <dan.j.williams@intel.com>, Dave Jiang <dave.jiang@intel.com> Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, nvdimm@lists.linux.dev, linux-cxl@vger.kernel.org, Huang Ying <ying.huang@intel.com>, Dave Hansen <dave.hansen@linux.intel.com>, "Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>, Michal Hocko <mhocko@suse.com>, Jonathan Cameron <Jonathan.Cameron@Huawei.com>, Jeff Moyer <jmoyer@redhat.com>, Vishal Verma <vishal.l.verma@intel.com> X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=2577; i=vishal.l.verma@intel.com; h=from:subject:message-id; bh=HwpJuUewgUm91iTLxWOXGqrJHkJjPxKSlGAl+Eindpk=; b=owGbwMvMwCXGf25diOft7jLG02pJDCkn39+R5LpiFL9qncUi6SOmX/a+WCz5VLXH+v8fyyWP7 3Q0tj9U7ihlYRDjYpAVU2T5u+cj4zG57fk8gQmOMHNYmUCGMHBxCsBEupkY/geGR3T5WLH0dM+W WXiyXXn99mW/TD5+6jQ4xOd42M7k6F2Gv2LxUbPmzD6X3TtTRE+Gh32Ffu/sK/7LzglKmK/oN0o /zAcA X-Developer-Key: i=vishal.l.verma@intel.com; a=openpgp; fpr=F8682BE134C67A12332A2ED07AFA61BEA3B84DFF X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 5DA2340019 X-Stat-Signature: bn9cp54yut7rmxmxtjhz84asqwpk8ier X-HE-Tag: 1690955761-474918 X-HE-Meta: U2FsdGVkX19jsicxKZIeGQV903om+l1pYX56k1V3DWlES59+pKMXOneqBk9dua/7WhkTAOJC6RMkklsTWBGYBWxPQLaYpQoZi8iZnfwuFgPUp5T25KNFOLkU8eAVPC5oYKhgB2m3q0GqtWv8Ewu9rnhArMNdz3qCEmvz6Q0EVsgWXEm69lmm/D4uetz2nEM8/7Cjb3qL13DukC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szi/LsIkfITdugjScCTWh8OGii/g76g+zObWCqTbKEhc2yfr2GLJ20gZQbS 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: <linux-mm.kvack.org> |
Series |
mm: use memmap_on_memory semantics for dax/kmem
|
expand
|
The dax/kmem driver can potentially hot-add large amounts of memory originating from CXL memory expanders, or NVDIMMs, or other 'device memories'. There is a chance there isn't enough regular system memory available to fit the memmap for this new memory. It's therefore desirable, if all other conditions are met, for the kmem managed memory to place its memmap on the newly added memory itself. The main hurdle for accomplishing this for kmem is that memmap_on_memory can only be done if the memory being added is equal to the size of one memblock. To overcome this, allow the hotplug code to split an add_memory() request into memblock-sized chunks, and try_remove_memory() to also expect and handle such a scenario. Patch 1 teaches the memory_hotplug code to allow for splitting add_memory() and remove_memory() requests over memblock sized chunks. Patch 2 adds a sysfs control for the kmem driver that would allow an opt-out of using memmap_on_memory for the memory being added. Signed-off-by: Vishal Verma <vishal.l.verma@intel.com> --- Changes in v3: - Rebase on Aneesh's patches [1] - Drop Patch 1 - it is not needed since [1] allows for dynamic setting of the memmap_on_memory param (David) - Link to v2: https://lore.kernel.org/r/20230720-vv-kmem_memmap-v2-0-88bdaab34993@intel.com [1]: https://lore.kernel.org/r/20230801044116.10674-1-aneesh.kumar@linux.ibm.com Changes in v2: - Drop the patch to create an override path for the memmap_on_memory module param (David) - Move the chunking into memory_hotplug.c so that any caller of add_memory() can request this behavior. (David) - Handle remove_memory() too. (David, Ying) - Add a sysfs control in the kmem driver for memmap_on_memory semantics (David, Jonathan) - Add a #else case to define mhp_supports_memmap_on_memory() if CONFIG_MEMORY_HOTPLUG is unset. (0day report) - Link to v1: https://lore.kernel.org/r/20230613-vv-kmem_memmap-v1-0-f6de9c6af2c6@intel.com --- Vishal Verma (2): mm/memory_hotplug: split memmap_on_memory requests across memblocks dax/kmem: allow kmem to add memory with memmap_on_memory drivers/dax/dax-private.h | 1 + drivers/dax/bus.c | 42 +++++++++++++ drivers/dax/kmem.c | 8 ++- mm/memory_hotplug.c | 150 ++++++++++++++++++++++++++++------------------ 4 files changed, 143 insertions(+), 58 deletions(-) --- base-commit: 64caf0ab00a1fc954cbf0aa43d65ca70d71d614f change-id: 20230613-vv-kmem_memmap-5483c8d04279 Best regards,