Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp3940420rwo; Mon, 24 Jul 2023 20:34:40 -0700 (PDT) X-Google-Smtp-Source: APBJJlGRzScd/f0gUxJ5ImwSZgdfHP9sF+CScWHqZXXznPIt59Ut/trTNi53nQHeszyGOEf53LM2 X-Received: by 2002:a05:6a20:1018:b0:137:48cc:9cfa with SMTP id gs24-20020a056a20101800b0013748cc9cfamr8209992pzc.24.1690256080152; Mon, 24 Jul 2023 20:34:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690256080; cv=none; d=google.com; s=arc-20160816; b=f0ps6sJrbPHGqgrhZQxEYJpmDqO9TfXs6lmOtqa+V5eqKIDNsGipDVxzG1IjKt23EZ rSB5dZM6U2Ms9Fua6MHEMzlvCEfGU2Yc6Od/8jCOw0z/aYlreiKJ01yNrpNqTDJtia7N N9aK4uIZ7Deh9W0wVWyzG5roCHRmSMC0fH+o/UTfnKjBSSj52VbmLtpas5rCjwE+GJuR CVmh+gJzkOTRrGcExRKOAFvO/b5F9t9llLUaMUInjf0Sqj9iT5HAtmybZ39UYt2+HinQ jF3icNpBgYdZd9EazRQAWK/ercQGoRDUDYbFAKl4xy3m3haKYxpQumQwTkXBxrgTAMdq Cfkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=ZLkcXzJjvvDBLgu5DbJbwRAKtejO8FK7VlKqBEYpGhg=; fh=ix8/QHpaLbA7AMCXNSvQFfp41ULgmUYH98LEHGZeGVI=; b=fnzd409gd10RNgPtqZJWjXOcOC8eTDwiS+tMPTc2qT64aeMgTuDmrpuNnLisr2Jc76 Rd8M3RM5zRq4eqbb5ICNHV1q/96DYnFROq2LPb4BJKfLjEIY0dODsbFnAB+Hj+FyS9Hv gjqi9CzXwGc1z87qjtD0/aL7tNEjET7tPyQaZytfUX0l2xd0ISSPvKgEmIPE4KrO8oB2 Q3Sj0ZKEmr2AzAvDM+UJe7Is4dittQyZEArRCVitqqKXwzWLQXDmvoOp5xMewqi8DUja 5iB0n37LhI2Ao1cbrPf6gE0hYu5XiUqbKfyGERCVUfSNI7KHMZpK+FxB/NL+LWPXvitR USSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b=T37460kh; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-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 ca25-20020a056a00419900b006813b381be3si10510476pfb.41.2023.07.24.20.34.27; Mon, 24 Jul 2023 20:34:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-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=T37460kh; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-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 S230099AbjGYDJ0 (ORCPT + 99 others); Mon, 24 Jul 2023 23:09:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59580 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229800AbjGYDJZ (ORCPT ); Mon, 24 Jul 2023 23:09:25 -0400 Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 96BDF1720 for ; Mon, 24 Jul 2023 20:09:22 -0700 (PDT) Received: by mail-pj1-x102c.google.com with SMTP id 98e67ed59e1d1-267711d2b43so714285a91.0 for ; Mon, 24 Jul 2023 20:09:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1690254562; x=1690859362; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=ZLkcXzJjvvDBLgu5DbJbwRAKtejO8FK7VlKqBEYpGhg=; b=T37460khNMPot0VVWdDz4lB6VWzVdicUBxVfz7CttLqrgD8g0MkXpwdKxm81+5qM3E yM+KFmnDFeQa0ZY5ZeNvvyumpxFJqPDg3oixgT5YKKGKOt9qmtbXs6vK0nUKy4kqsaDS iJ3utK1jXEfJapBrHYjK+SRbiAPBWHkzR4mO0jKk+qC4Stl39POzbhCCP4MwAtpmSso5 ynGZ9erR4hLoA8pCdH+sRZpUbw1kMvKh2ycfFI2IzmOqd8Zq8Q0hlgUcK6mejCeashGS UzcYSPHM74qvjYTTAriMRhyDbW62IR+NfEc7uD2qj/U2RIYLpDl8fGFG28yoLGatJrqh GkTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690254562; x=1690859362; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ZLkcXzJjvvDBLgu5DbJbwRAKtejO8FK7VlKqBEYpGhg=; b=RRgTJ9ChuS5lvlxIdyR1j/6Qp8VeZfLdCiUFvo2XqJkVUnfZxEQbH1gEq9kl8MZzde jczc9xHSaTRlsn+sWQPN9WOOXYBPd7aAYKb1NoUtwtttTTRA8498hJZl+MteuDYwMLu6 jKDebhsBZYOTaM633u5rFouCVhnL+OBokHaUukWVAN8l8GaJzHV3u+AQivPihKzeLkir tvSG9f2MnH5tRGxITyvka1paCh+UrBpydoD3+EzTB3unYvovldIesfRcp11pnQRkJt9z 2cYxB1m6cVfcMm05LfjB+2sGfkaSKioisFcexHSbBhaHjyb77hlxjRM6cs7uIcDz0gxN EPDg== X-Gm-Message-State: ABy/qLZuMIOwj8Jc3ON3mPs9i3dP9FSZvfxzHMc+sJp2yKU3k7ydnEtP CXOfqchvbExxiCByZx+gkVApXA== X-Received: by 2002:a17:90a:50f:b0:263:730b:f568 with SMTP id h15-20020a17090a050f00b00263730bf568mr10246975pjh.3.1690254562043; Mon, 24 Jul 2023 20:09:22 -0700 (PDT) Received: from [10.70.252.135] ([203.208.167.147]) by smtp.gmail.com with ESMTPSA id 21-20020a17090a199500b002633fa95ac2sm9540001pji.13.2023.07.24.20.09.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 24 Jul 2023 20:09:21 -0700 (PDT) Message-ID: Date: Tue, 25 Jul 2023 11:09:07 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PATCH v2 01/47] mm: vmscan: move shrinker-related code into a separate file Content-Language: en-US To: Muchun Song Cc: Andrew Morton , david@fromorbit.com, tkhai@ya.ru, Vlastimil Babka , Roman Gushchin , djwong@kernel.org, Christian Brauner , "Paul E. McKenney" , tytso@mit.edu, steven.price@arm.com, cel@kernel.org, Sergey Senozhatsky , yujie.liu@intel.com, Greg KH , LKML , Linux Memory Management List , 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 , 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 References: <20230724094354.90817-1-zhengqi.arch@bytedance.com> <20230724094354.90817-2-zhengqi.arch@bytedance.com> <97E80C37-8872-4C5A-A027-A0B35F39152A@linux.dev> From: Qi Zheng In-Reply-To: <97E80C37-8872-4C5A-A027-A0B35F39152A@linux.dev> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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-ext4@vger.kernel.org On 2023/7/25 10:35, Muchun Song wrote: > > >> On Jul 24, 2023, at 17:43, Qi Zheng wrote: >> >> The mm/vmscan.c file is too large, so separate the shrinker-related >> code from it into a separate file. No functional changes. >> >> Signed-off-by: Qi Zheng >> --- >> include/linux/shrinker.h | 3 + >> mm/Makefile | 4 +- >> mm/shrinker.c | 707 +++++++++++++++++++++++++++++++++++++++ >> mm/vmscan.c | 701 -------------------------------------- >> 4 files changed, 712 insertions(+), 703 deletions(-) >> create mode 100644 mm/shrinker.c >> >> diff --git a/include/linux/shrinker.h b/include/linux/shrinker.h >> index 224293b2dd06..961cb84e51f5 100644 >> --- a/include/linux/shrinker.h >> +++ b/include/linux/shrinker.h >> @@ -96,6 +96,9 @@ struct shrinker { >> */ >> #define SHRINKER_NONSLAB (1 << 3) >> >> +unsigned long shrink_slab(gfp_t gfp_mask, int nid, struct mem_cgroup *memcg, >> + int priority); > > A good cleanup, vmscan.c is so huge. > > I'd like to introduce a new header in mm/ directory and contains those > declarations of functions (like this and other debug function in > shrinker_debug.c) since they are used internally across mm. How about putting them in the mm/internal.h file? > > Thanks. >