Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp2074009rwb; Thu, 27 Jul 2023 01:21:15 -0700 (PDT) X-Google-Smtp-Source: APBJJlEg4qr+zvVo3HArP6gP6S/8I3YRTkA+VRFdCKIt0vrIVxczxjPj21gGt6w/q7cQRmVyrlKY X-Received: by 2002:a05:6a20:3d12:b0:134:37bb:89be with SMTP id y18-20020a056a203d1200b0013437bb89bemr4341217pzi.57.1690446075115; Thu, 27 Jul 2023 01:21:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690446075; cv=none; d=google.com; s=arc-20160816; b=WaNH+60kdBrxEDBfeP1TJi73ytpywX72BC1QLqZL+aqtWEKdg0C+0FBfMi2/cpuMyy s/Y4TWlxbLQIK6YMyB+HhWUNx8o6tMM579eDTygK3a67SjVSVmYIqyXtXuCtmU1leO6a mxZFgUDkFm8TofSXd7OxMW4tMQDdv5+eu9MJEKLBUqzXDTXmQRyVC7NTJvfr+ochglbd ZmmJuwxaUMbAkNlgXH9oaVAzsW5kBQiA//+JoTSZugHyJ5gjJKItUxx8Gkv3KSsycy+v ZBjCte62rpWtAjxNNh9GjiasSglbwIEeyCi7+njQpYHXjkDFblLmQqE3vRgh1Ok9ZHcV /jyg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=hMz0NiXWW4aad/y0uXjwCFa/Ag/H17CXQFU4sIH/+zs=; fh=3lDHiAuENCYj3gWFb2bYij2cH/UC7c23rwbOpuSBNc8=; b=pOg6xx9BHAgpf145H88UvXcsImFmpt0MU++T5klxxdpPHWLChfLf7KWU9f3gllD1G8 arVwO6VfBvvyzVZyo1VDjTUdxxwF6BjjdRr1L7GORlQBRVxJrLL1c2/ZrUAD9roI9ehZ +rzPdh2dcY/kNJ+iXHE1RXNAi8XCSjD5efxVHNbPYDU7gIuE2XQL24UbYdyuBFGsUEbO pl7/aNJqusdNFYF6S2wZIDhE9pghvleWYRkd4+/F7w/Vk+tD7tqATocGOSxeKeNlP21w RIUsGcxYgKGV4dOHrO+pNOPQKljkt9EAsmHXYYof7UPCmbTLRq2CiHk/REgCkmafRjNE 2Sog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b=AHxGvLfH; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE 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 m9-20020a654389000000b00563adca5169si858959pgp.741.2023.07.27.01.21.02; Thu, 27 Jul 2023 01:21:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-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 header.s=google header.b=AHxGvLfH; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=bytedance.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233502AbjG0ILb (ORCPT + 99 others); Thu, 27 Jul 2023 04:11:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233800AbjG0IKe (ORCPT ); Thu, 27 Jul 2023 04:10:34 -0400 Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com [IPv6:2607:f8b0:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F2EBFE42 for ; Thu, 27 Jul 2023 01:07:11 -0700 (PDT) Received: by mail-pf1-x434.google.com with SMTP id d2e1a72fcca58-6748a616e17so182230b3a.1 for ; Thu, 27 Jul 2023 01:07:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1690445172; x=1691049972; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=hMz0NiXWW4aad/y0uXjwCFa/Ag/H17CXQFU4sIH/+zs=; b=AHxGvLfHLl40j8B2JJRU5s4VfBVIfkKAsI0cQEyx34RUKm+kvHJrB2iQzGzRnBcS3v 6USwrAVD49Q91VdWL412Beuc1lh9luLsvseTAfwZXNQFTlfXj/44XL3QSDLO3kE477UK PuQisTQDtaTenLhmz9UxJrWIk76t/9C2sGl3AoIFTG0F/GG2DtEXlZsFxPta58HNNxGh nuotqk/EcRuGp6B6DpQqHvzB1OaU8/LVfrpsdfcpoHM2+LjVOOXNlq+MDZzMAY0XeOby XoS1N9oa25ZJEGOvTPLqpEaa/2bkazEZHcopiam72Y0TXS5KlF1vjQrUn3lGIfR4Oiwn FzZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690445172; x=1691049972; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hMz0NiXWW4aad/y0uXjwCFa/Ag/H17CXQFU4sIH/+zs=; b=g6PnIk/lch9wlim2zVgs4AfFH2H+epooUj9AGDNDdKM7tw5e0z5BcBY4z2pKkuc0Qp uR3bH5de2ygth+9MXyIJllU6rVbm1oBEpQFV4oJQtiP4avbtFYi2Ot2ag9RlHLmQTr80 aXJDIB2hkmK3kDuuH883TOjzEIKmIjAjqQ3rCAMgFgAAPwLudUF4EjhKmPnEKWCdA3HX HSu6Q2X24K6X8bjisXPLjKtkhZvZqhNbn3VR5c4DPAyn/gEW5eeIllQ1q00DqQTJiR5H bWB4jqsg9w5x3XRE4TTDrfGEKb+a6YNytush100dNFBqVvac1RCXpYBmrbnt0uf0y8Mu onJQ== X-Gm-Message-State: ABy/qLbvNBoMocR+k19iUj/GQ/IuXYcs8b2msCjCFmg1Rxqe37aqjgRg rQZVWDAbxsmuIWOZJaiFTVQmkw== X-Received: by 2002:a05:6a00:4792:b0:668:834d:4bd with SMTP id dh18-20020a056a00479200b00668834d04bdmr4674312pfb.0.1690445172123; Thu, 27 Jul 2023 01:06:12 -0700 (PDT) Received: from C02DW0BEMD6R.bytedance.net ([203.208.167.147]) by smtp.gmail.com with ESMTPSA id j8-20020aa78d08000000b006828e49c04csm885872pfe.75.2023.07.27.01.06.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Jul 2023 01:06:11 -0700 (PDT) From: Qi Zheng To: akpm@linux-foundation.org, david@fromorbit.com, tkhai@ya.ru, vbabka@suse.cz, roman.gushchin@linux.dev, djwong@kernel.org, brauner@kernel.org, paulmck@kernel.org, tytso@mit.edu, steven.price@arm.com, cel@kernel.org, senozhatsky@chromium.org, yujie.liu@intel.com, gregkh@linuxfoundation.org, muchun.song@linux.dev Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, x86@kernel.org, kvm@vger.kernel.org, xen-devel@lists.xenproject.org, linux-erofs@lists.ozlabs.org, linux-f2fs-devel@lists.sourceforge.net, cluster-devel@redhat.com, linux-nfs@vger.kernel.org, linux-mtd@lists.infradead.org, rcu@vger.kernel.org, netdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, dm-devel@redhat.com, linux-raid@vger.kernel.org, linux-bcache@vger.kernel.org, virtualization@lists.linux-foundation.org, linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org, linux-btrfs@vger.kernel.org, Qi Zheng Subject: [PATCH v3 02/49] mm: move some shrinker-related function declarations to mm/internal.h Date: Thu, 27 Jul 2023 16:04:15 +0800 Message-Id: <20230727080502.77895-3-zhengqi.arch@bytedance.com> X-Mailer: git-send-email 2.24.3 (Apple Git-128) In-Reply-To: <20230727080502.77895-1-zhengqi.arch@bytedance.com> References: <20230727080502.77895-1-zhengqi.arch@bytedance.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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-nfs@vger.kernel.org The following functions are only used inside the mm subsystem, so it's better to move their declarations to the mm/internal.h file. 1. shrinker_debugfs_add() 2. shrinker_debugfs_detach() 3. shrinker_debugfs_remove() Signed-off-by: Qi Zheng --- include/linux/shrinker.h | 19 ------------------- mm/internal.h | 28 ++++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 19 deletions(-) diff --git a/include/linux/shrinker.h b/include/linux/shrinker.h index 224293b2dd06..8dc15aa37410 100644 --- a/include/linux/shrinker.h +++ b/include/linux/shrinker.h @@ -106,28 +106,9 @@ extern void free_prealloced_shrinker(struct shrinker *shrinker); extern void synchronize_shrinkers(void); #ifdef CONFIG_SHRINKER_DEBUG -extern int shrinker_debugfs_add(struct shrinker *shrinker); -extern struct dentry *shrinker_debugfs_detach(struct shrinker *shrinker, - int *debugfs_id); -extern void shrinker_debugfs_remove(struct dentry *debugfs_entry, - int debugfs_id); extern int __printf(2, 3) shrinker_debugfs_rename(struct shrinker *shrinker, const char *fmt, ...); #else /* CONFIG_SHRINKER_DEBUG */ -static inline int shrinker_debugfs_add(struct shrinker *shrinker) -{ - return 0; -} -static inline struct dentry *shrinker_debugfs_detach(struct shrinker *shrinker, - int *debugfs_id) -{ - *debugfs_id = -1; - return NULL; -} -static inline void shrinker_debugfs_remove(struct dentry *debugfs_entry, - int debugfs_id) -{ -} static inline __printf(2, 3) int shrinker_debugfs_rename(struct shrinker *shrinker, const char *fmt, ...) { diff --git a/mm/internal.h b/mm/internal.h index 5a03bc4782a2..8aeaf16ae039 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -1135,4 +1135,32 @@ struct vma_prepare { struct vm_area_struct *remove; struct vm_area_struct *remove2; }; + +/* + * shrinker related functions + */ + +#ifdef CONFIG_SHRINKER_DEBUG +extern int shrinker_debugfs_add(struct shrinker *shrinker); +extern struct dentry *shrinker_debugfs_detach(struct shrinker *shrinker, + int *debugfs_id); +extern void shrinker_debugfs_remove(struct dentry *debugfs_entry, + int debugfs_id); +#else /* CONFIG_SHRINKER_DEBUG */ +static inline int shrinker_debugfs_add(struct shrinker *shrinker) +{ + return 0; +} +static inline struct dentry *shrinker_debugfs_detach(struct shrinker *shrinker, + int *debugfs_id) +{ + *debugfs_id = -1; + return NULL; +} +static inline void shrinker_debugfs_remove(struct dentry *debugfs_entry, + int debugfs_id) +{ +} +#endif /* CONFIG_SHRINKER_DEBUG */ + #endif /* __MM_INTERNAL_H */ -- 2.30.2