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: 123064 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp2958777vqt; Thu, 20 Jul 2023 01:05:53 -0700 (PDT) X-Google-Smtp-Source: APBJJlEa3FIR0+U57CSj0y+EcwsGjH6fTU8c+JovaV+4vYWUgJHo/XRZqtbAG4PKzVilrt9//7kN X-Received: by 2002:a05:6808:f02:b0:3a4:3192:1627 with SMTP id m2-20020a0568080f0200b003a431921627mr1187050oiw.42.1689840353301; Thu, 20 Jul 2023 01:05:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689840353; cv=none; d=google.com; s=arc-20160816; b=HCdNEyP5+swOK4x4mG8APZGPelT/KDnYgusHkbZVbGb8IJQCLHOiCZQ+Y1madUBoGd 897ctrGOPVpFh5177YqfvYdYnToS7XcWq6muETdTGDhGgaDRUzToS396VoSkc1cl2+Cl kL5EnSnhd1klqMfiPJ1Mm67k6IV4QvxEtrGTPHVZLiFhcxAroPjuk9oYNnSS+GFWNe3M KSlgNrYWE2RoYpFlE6tuLMXTRV+FDTDK0FKTZFLbueMAsrXK02pzYQSgB3mnU6so3XAZ qC/QOad+VVwiIK1Nq8phM0qwpmVjTZ6dFo2zw+FzqP/SGxGR9g6BQIZ7TpWvW72qBzjm yuMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=W0lOkgpc+9SzpjV4Ig0AXo/m0HIEEdmCnill7tcYX7I=; fh=7sg09A/ZyZw9Obnf6Dkq54A6dwwn4CoMA5QN9sOg78o=; b=QoeeyW79QHB1rj3aE4tD1jpWfv4LaV+5eCpt7Ydv75aR1qLw+9dBOqD+MUm2Dt8U18 wl5tmvGn19EdRf/wcB9ViGYloEUy4p1ud9Z8bcPKwdhdCP6IzH/XvMMwIClQd1X52APv bt8ldB7IzrFQEwkWlGkdOIdUVnrouCgw0IOz+M55zIuWpUNm6+lhL/6XHhsV0intyUCn 2hPzL1vUIMFP15Mvn69+dVt2u1rb3CnV+KDmV4Fl0l953tJg+zsQMjU1EGVIYWzxJWcH GxHZ3SX2wxsbAnC4Sk9JKAIs8d1OPi/SbHwxRwaTx3sQJUkyA8ChBjBrNce2arzLvuAU Yc8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=kpmCCJmO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h70-20020a638349000000b005573740ea33si324830pge.534.2023.07.20.01.05.40; Thu, 20 Jul 2023 01:05:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=kpmCCJmO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230150AbjGTHOg (ORCPT + 99 others); Thu, 20 Jul 2023 03:14:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229902AbjGTHOc (ORCPT ); Thu, 20 Jul 2023 03:14:32 -0400 Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3306A2121; Thu, 20 Jul 2023 00:14:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1689837271; x=1721373271; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=Xs/UipfGvLxTajC0Rm3FutNPJhFtxOc43qHe7lqOerY=; b=kpmCCJmOWxKQzgANJGlyLS2yNsn+8Tz6qafqPRQ6FwlsIOCg3QD93p6E 9N2FYCuShB/vjPsx2UwAUE1+5C6G5B3oyabceb4LB0wES9CoGS5RB1SF3 7nI/yKnzPumQb6DnMdF90LbAFcoelD1BhH6gC9xizqijRjKVvLII/GlwI WHiroOuje6LHXRauUV1WvElvR3FyDjyo/WizOqW83FOHQr+5hXOtaGr2b uESCE0QDKUeOC1k3CQ0cyZ5OP+YHXdxtkCM67QK+belbp0h5pYNmXAxMZ aoUE2Kdb9Q5AVxlj7EvQsiokAShciecCw2QnXTbEfwFE97MieKtoOad5T g==; X-IronPort-AV: E=McAfee;i="6600,9927,10776"; a="430423994" X-IronPort-AV: E=Sophos;i="6.01,218,1684825200"; d="scan'208";a="430423994" 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-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771926038138150139 X-GMAIL-MSGID: 1771926038138150139 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