From patchwork Thu Nov 24 07:39:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qi Zheng X-Patchwork-Id: 13054634 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 D5B8EC4332F for ; Thu, 24 Nov 2022 07:39:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 12E746B0071; Thu, 24 Nov 2022 02:39:21 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 0DEC56B0072; Thu, 24 Nov 2022 02:39:21 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EE71D6B0074; Thu, 24 Nov 2022 02:39:20 -0500 (EST) 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 DD01F6B0071 for ; Thu, 24 Nov 2022 02:39:20 -0500 (EST) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id B610AA08E0 for ; Thu, 24 Nov 2022 07:39:20 +0000 (UTC) X-FDA: 80167535280.08.CDB30E9 Received: from mail-pj1-f46.google.com (mail-pj1-f46.google.com [209.85.216.46]) by imf30.hostedemail.com (Postfix) with ESMTP id E88C080008 for ; Thu, 24 Nov 2022 07:39:19 +0000 (UTC) Received: by mail-pj1-f46.google.com with SMTP id b1-20020a17090a7ac100b00213fde52d49so898646pjl.3 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=dgdNGnLIIStMsCnheoJBgVGUZ5M5aXtxLjtBOIVWqZqhLvdaJN5Y6zWgGOeGOfGzWo ESYiJpF/vS6i+jC6xYcflTFvRRxXpTuDFugFyWA4JBcasyaLQTH1/X8Hz4Hn/bpCVOYS moGEoxqdPNb7RhdLKyqwB8flfwUxwDLnthhOBsBdtXrd5rdg5QutsPZUpFn1/lHbKXuX kdQKwUB8jyXlizZmu0F3GtHz5ymi2NkUw17bqDaK2AfW9Ljx05eAyYHIuOlCi0wbOcgE L5nSXTa5WqmRft0XVsVqyGxTOt0n2f1VRmr1t+4iuwIOr2+kfIVrJjNI5mW3Yr4uHlrD hNqQ== X-Gm-Message-State: ANoB5pn59GJiPw5ZtD66bKXPju+c91TPupVMsADsWeBQPk3EN6mHxGym 9+DzbTXCNwtjIAF9yOZX1UCSpg== X-Google-Smtp-Source: AA0mqf6LieQTxv4TzvKYyWHggvMNThPG0+krCHoy6rIfYkaS2QNm19YP/LmtqfBerLYrAL7swFXDfQ== 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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1669275560; 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=UA260AehhLAfEdYE8BrfOKBXPadjTQ0oWHspkp4L4Pc=; b=zPJVpr53ZlCs0+etryTjQovAQVpSOLn303ZEp4PtFCmUhhYJLHvFHS8LasZ5dFC4ZbxX/L vrKrIyjapyPvRVzhj3VuDvz0QP9T5+BcmHgiTb3mh4TlIUWHGX5jm6LmC6dT0m3vW/dUks qB2HsWpilIiTsr5rxw/FCEg3pXaNnn8= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=pass header.d=bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=THuBqC89; spf=pass (imf30.hostedemail.com: domain of zhengqi.arch@bytedance.com designates 209.85.216.46 as permitted sender) smtp.mailfrom=zhengqi.arch@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1669275560; a=rsa-sha256; cv=none; b=mi6Ssn3wd8VW7lg7DP00QgXKVTLy1QtpeVoclBYAp1zSVfLugfZhN/3Hs+lCR2LUPYyWYF PqlcN9voQ0+cCM8cmfQA5C3s0RFHcH52qdyQSi54+VKr2CZDhZuGtPH8OImV3BQk3ftza7 83XZCqUz3h+yITHg5+toG2VjUVUlXzQ= X-Rspamd-Queue-Id: E88C080008 Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=THuBqC89; spf=pass (imf30.hostedemail.com: domain of zhengqi.arch@bytedance.com designates 209.85.216.46 as permitted sender) smtp.mailfrom=zhengqi.arch@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: qxpn8gg9yngf5e3e1z84mdzehwc6db33 X-HE-Tag: 1669275559-232338 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 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