Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp3954429rwo; Mon, 24 Jul 2023 20:56:21 -0700 (PDT) X-Google-Smtp-Source: APBJJlFk6jfqgTOoKchk3MGtbf5/IanR5DXQbmPARxShbZ/6LnJkwrp2sKGjrfpvm9OAcPRjqyoH X-Received: by 2002:a81:5bd6:0:b0:57a:250:27ec with SMTP id p205-20020a815bd6000000b0057a025027ecmr7767346ywb.32.1690257380996; Mon, 24 Jul 2023 20:56:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690257380; cv=none; d=google.com; s=arc-20160816; b=DylIwOCk/P9yT8aJUg/tGdaLY7MJZ5fK1nxhcZ9uaIJiZwPK0ixK5DCu+MTvFAw4e2 71aq5qgp24VySZKIve5dpEofgEQwyN9m9j5WTLakvVB/y+LsNsLV7C/KRcT89EfiB1/R ASsO7A7wv8EWrMUNOGkDim+kAXNgqz83a6j9h7Is6OiRtzNSKc5SQOxLsn0rmXD2f68B bG+PFEGvyg3pagdKXzx8PpsX6WF2po9vgxZk+GE3cKHk+UhRw95yg2L4xjuxlNqR8yS5 inQv1vXViOW78xnaBVm5nNk2ceq1dLdSXKTVoWso7DyD3oOokw6US0UIca1qRhR2rE9x 2AeA== 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=6wY4cILkEhsrpRf+mNddP0nleKOSU9sayj8Z5h0ToXM=; fh=ix8/QHpaLbA7AMCXNSvQFfp41ULgmUYH98LEHGZeGVI=; b=xVw5RNmPJuRcdQ/fEHI6kekwyP4mGDI47vmawH39ACsm2sas9lGOCU66GPRbDO4geu E1xJTijM1+WJ/Z0TM2ABaiTIX2mrclHjl6L8uSzuFVIR+EMBTbBcjsiFVqpcGM8oXYoU ytiDyImnRPC7hvYSbCKk8ac3vcSAEni0vdhXodVRuNDeprXuUZUzHc9mD8iDPY2WmaI6 vPjrQ9BSX4YL3DKinmRvFoh2I17kvjLcjUBDQvkOlWZHhw9XwUVeh3h9xLZZtw4AF90f 9hUG6usGYcRsAESL+Ylc2sGyWaSKUGN9FUxxoMsA6NCeVJzkMvlRr8To0OfTPPrz9eOy xDqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b=PknHptOa; 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 y9-20020a17090264c900b001bb2093efb6si614246pli.45.2023.07.24.20.56.01; Mon, 24 Jul 2023 20:56:20 -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=PknHptOa; 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 S230049AbjGYD2P (ORCPT + 99 others); Mon, 24 Jul 2023 23:28:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36034 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229590AbjGYD2O (ORCPT ); Mon, 24 Jul 2023 23:28:14 -0400 Received: from mail-pf1-x42b.google.com (mail-pf1-x42b.google.com [IPv6:2607:f8b0:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E528F173D for ; Mon, 24 Jul 2023 20:28:10 -0700 (PDT) Received: by mail-pf1-x42b.google.com with SMTP id d2e1a72fcca58-66d6a9851f3so1183688b3a.0 for ; Mon, 24 Jul 2023 20:28:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1690255690; x=1690860490; 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=6wY4cILkEhsrpRf+mNddP0nleKOSU9sayj8Z5h0ToXM=; b=PknHptOa2Z8+2vaclzexjcjHcgGTKnQ0JRJ89LK+GvkJZyUzNmFYDaw4LaxhrbAB97 Qlt49eA21cgLfip1YkLzQvNHl9NRE1uu+H3yLMzr5GUQw2R94ASja3LKRc7K2/IuJ877 /rUQws3HOX4h/pSV0QLIC/txctttQBZDy4goWlpNGxYwzk8J6CttdGDNpskz9IiWFE6E W06R7YBvAlwN2Ll/k0WZ+e8J2UJKgy2rlagtK3lUaqPgpyCrwLsDTNoP/0MXBrAUaLK4 fe8VXE6m3BmotnBeZ7KmASyzpGnPX5FsNzpJdMUNn5TjD0dfcmx5lygJuqraNOT+sjor yB3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690255690; x=1690860490; 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=6wY4cILkEhsrpRf+mNddP0nleKOSU9sayj8Z5h0ToXM=; b=MozUzW42uhDKBcVGhWCRXuvGIrEMV4Y+l+bipwwOukpiFpfGc/ofWFdWFviLuWZ6I3 TokPbgAPxnKMy2fN2NNnX0ZsXFv2i+BeJ7vJBQdlqLwM51AuS1QNGFipqAbK1enrv0JW S5zWTC+v136CPcrU4rhlH4lkMPyMEfHz3fGiz5dGuylbvET+Pi4zQndUwuM6NP0j9QhU QyI5weVRrOB3l4GYb1ash5NwLUjBmBtl0Z7szX/x7aGIg2Fv8rGtnoeZIfx1ZH1ovrpA fuPAYCDSnvpYuBJjLtZLlvkKxpaVH10vMfUIPxIjeFQDc1LRQy9KPWPQxZEC2GbPWjzD TP8Q== X-Gm-Message-State: ABy/qLZrM/T88/eUgV2R8fGHB6j60WKpwjhgxotpcsiR4U4zgSc2tspr 1HNjUPJ9u9OHyZbR79l5mLnk9A== X-Received: by 2002:a05:6a00:cd1:b0:677:bb4c:c321 with SMTP id b17-20020a056a000cd100b00677bb4cc321mr15272930pfv.0.1690255690395; Mon, 24 Jul 2023 20:28:10 -0700 (PDT) Received: from ?IPV6:fdbd:ff1:ce00:1c25:884:3ed:e1db:b610? ([240e:694:e21:b::2]) by smtp.gmail.com with ESMTPSA id s3-20020aa78283000000b00682a9325ffcsm8407714pfm.5.2023.07.24.20.27.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 24 Jul 2023 20:28:10 -0700 (PDT) Message-ID: Date: Tue, 25 Jul 2023 11:27:55 +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> <6FE62F56-1B4E-4E2A-BEA9-0DA6907A2FA9@linux.dev> From: Qi Zheng In-Reply-To: <6FE62F56-1B4E-4E2A-BEA9-0DA6907A2FA9@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_NONE,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 11:23, Muchun Song wrote: > > >> On Jul 25, 2023, at 11:09, Qi Zheng wrote: >> >> >> >> 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? > > Either is fine to me. OK, will do in the next version. > >> >>> Thanks. > >