From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2BAF4C00528 for ; Tue, 25 Jul 2023 03:09:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230164AbjGYDJ1 (ORCPT ); Mon, 24 Jul 2023 23:09:27 -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-Google-Smtp-Source: APBJJlEruF0WFFXXZAOwcLJKfTF/P8Yek4Wx/bwgxp4VRr2IRHJr9OEk7izXq54CPTEEiNehAqKYyg== 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 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. >