Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp8556302rwb; Thu, 24 Nov 2022 00:52:18 -0800 (PST) X-Google-Smtp-Source: AA0mqf56P8In8LFsCw89UHnK6TthOxn8aRAAbcW2gPelcRZnfK4qSER5OXtN7ayVWN+lNVJry5iV X-Received: by 2002:a63:5b1f:0:b0:477:1126:f2d2 with SMTP id p31-20020a635b1f000000b004771126f2d2mr28275976pgb.100.1669279938553; Thu, 24 Nov 2022 00:52:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669279938; cv=none; d=google.com; s=arc-20160816; b=lKHUwt6o9i5p4XPlVi4ouYLuTRCFReDroDphBjzzRI8hQkB9t8QzcaGui82psATkWa FsINYz8JMRCmx5vasuZaRteV356AMXpADYJ6khqcBitI1K8PC7bGlbLHsIsTo4bL9S0O 5A/f/rhRSRTqdSsDn9vNFI/3jW9WUAGcfvuD/MqzF6t0ew8Fkme2GiDqZ7AuqrM2MnZS XeinkYSnh0mVxiKBbV+sSrq3kEXlMQ3VOG57n3Aqm/uf4mJl0q2olPbxiTQ1FL00buC8 Nx7+uvLIUyKAzPhmbE518Z27xm7q95MOASFBLKRdOq55YCHOV+zqGLaq+dbu6pdBib6V 7Iaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=UA260AehhLAfEdYE8BrfOKBXPadjTQ0oWHspkp4L4Pc=; b=SRTME17UbK4td9JXmSsb6RgbeON7Nq5qIqVl/rIxYTx0dozKMJzZDGjGILDUfrLQ7f mtS9KarIeR4jK023bgIR1luGU0Yi12ouhtAUX0xA646L44z8pSQopAeiSZnfuD5b9YpZ UQzXhcy/xR7PriJAR63k+f/HnZrf+Gi+cJC1sWnH9FQZ0sboUS2nLldAHlX2lzt/rE34 GKzLPS6M7y6/uGjLhd1s6Xsvz4lTdvNCpydbpk/Hbvr/KGGHCHv4GHwNJUPjttCeLNHn UaI5nrbTLkaq+eyDv5P6wiv8NyA7QPxQQq6vVQ/2/liQPgSp9NfvNoucOzsCR8YTedh1 Dh5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=THuBqC89; 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=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id pq8-20020a17090b3d8800b0021859b5fe8asi718977pjb.145.2022.11.24.00.52.07; Thu, 24 Nov 2022 00:52:18 -0800 (PST) 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=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=THuBqC89; 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=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229576AbiKXHjX (ORCPT + 87 others); Thu, 24 Nov 2022 02:39:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229500AbiKXHjW (ORCPT ); Thu, 24 Nov 2022 02:39:22 -0500 Received: from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com [IPv6:2607:f8b0:4864:20::1030]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2AF4A8F3D5 for ; Wed, 23 Nov 2022 23:39:19 -0800 (PST) Received: by mail-pj1-x1030.google.com with SMTP id x13-20020a17090a46cd00b00218f611b6e9so912297pjg.1 for ; Wed, 23 Nov 2022 23:39:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=UA260AehhLAfEdYE8BrfOKBXPadjTQ0oWHspkp4L4Pc=; b=THuBqC89Jfusdgra3SZeu6/RBNnEtIs/tTKvTH8yxdB18c9vUDS+zRq6xrOyWqh4hS xGE4Z1fM91uGAk3sufgV/Q9eUlIm8FIfA/Rflnldf2N4xF23JrUfcoVEMeGS/8kY+d5O lrJCf3pvvFPqEiz2WWTCZu1wS1IeVOgasgx0LGdw5+osuoqdusRDC566uvIu16h+VEZp 649/HfnJLyJkpFKwysz9c7sBh94ZMe7XSvN25TVrYTrSTDmKQHbYkDOCJ6IGvOMIH2SS ZauloVy1YaoQIMYT4GklJ+lb4Vp3I/92qvaHBLiX1hDKpQ35LxBFe92kuYTdNhWknTzI /iAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=UA260AehhLAfEdYE8BrfOKBXPadjTQ0oWHspkp4L4Pc=; b=sC4xzL0iRw8rx2UrjXgc2kf6q8gZ6R5swFuLkACK4CHFJh8AdVDuiZTgELGgTa/xI8 Lfz3Xw8GMxmDgT6/8NJyaYBxpF2cfvh6AayZ4MHBxFU2ji0mh8LoHLLx7NKdl5OU5mFa e8KeQP/lSQDO3LTdMx6BxJY4p+2rDRFA3yQlkBrCczfFlGTYca8n8F0B91yf6NAXJ/my +krVHyTjfeGuMCbiTBZiWJtKbemA0SJ+Yl4VMp0aMB3G5o4qEU4qVzM2su0Qqgk7VIZV 7U0dRHd0K/NVpFn8xvb4L1KbmEJ7GvRkPXvVWHTpuXVKBSKIL+9i1Ntx6dkCY6gCWPCA 46zw== X-Gm-Message-State: ANoB5pm+18UV7cCd76CbrWS40epH46p/vMfBIcT1/h41/HPdboH1udb8 rAQbMmOmesI+zTMcxqOMzDlm1A== X-Received: by 2002:a17:90a:db52:b0:212:d2c2:8e1a with SMTP id u18-20020a17090adb5200b00212d2c28e1amr40767868pjx.54.1669275558683; Wed, 23 Nov 2022 23:39:18 -0800 (PST) Received: from C02DW0BEMD6R.bytedance.net ([139.177.225.245]) by smtp.gmail.com with ESMTPSA id m7-20020a170902db0700b0018862b7f8besm503510plx.160.2022.11.23.23.39.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Nov 2022 23:39:18 -0800 (PST) From: Qi Zheng To: dan.j.williams@intel.com, akpm@linux-foundation.org Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Qi Zheng Subject: [PATCH linux-next] mm: memremap: delete static key devmap_managed_key Date: Thu, 24 Nov 2022 15:39:09 +0800 Message-Id: <20221124073909.15489-1-zhengqi.arch@bytedance.com> X-Mailer: git-send-email 2.24.3 (Apple Git-128) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 The static key devmap_managed_key has no users since we deleted put_devmap_managed_page_refs(). So delete it too. Signed-off-by: Qi Zheng --- mm/memremap.c | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/mm/memremap.c b/mm/memremap.c index 0d714adadbfb..67749f74be4e 100644 --- a/mm/memremap.c +++ b/mm/memremap.c @@ -38,30 +38,6 @@ unsigned long memremap_compat_align(void) EXPORT_SYMBOL_GPL(memremap_compat_align); #endif -#ifdef CONFIG_FS_DAX -DEFINE_STATIC_KEY_FALSE(devmap_managed_key); -EXPORT_SYMBOL(devmap_managed_key); - -static void devmap_managed_enable_put(struct dev_pagemap *pgmap) -{ - if (pgmap->type == MEMORY_DEVICE_FS_DAX) - static_branch_dec(&devmap_managed_key); -} - -static void devmap_managed_enable_get(struct dev_pagemap *pgmap) -{ - if (pgmap->type == MEMORY_DEVICE_FS_DAX) - static_branch_inc(&devmap_managed_key); -} -#else -static void devmap_managed_enable_get(struct dev_pagemap *pgmap) -{ -} -static void devmap_managed_enable_put(struct dev_pagemap *pgmap) -{ -} -#endif /* CONFIG_FS_DAX */ - static void pgmap_array_delete(struct range *range) { xa_store_range(&pgmap_array, PHYS_PFN(range->start), PHYS_PFN(range->end), @@ -133,7 +109,6 @@ void memunmap_pages(struct dev_pagemap *pgmap) percpu_ref_exit(&pgmap->ref); WARN_ONCE(pgmap->altmap.alloc, "failed to free all reserved pages\n"); - devmap_managed_enable_put(pgmap); } EXPORT_SYMBOL_GPL(memunmap_pages); @@ -333,8 +308,6 @@ void *memremap_pages(struct dev_pagemap *pgmap, int nid) if (error) return ERR_PTR(error); - devmap_managed_enable_get(pgmap); - /* * Clear the pgmap nr_range as it will be incremented for each * successfully processed range. This communicates how many -- 2.20.1