Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp2184557rwb; Thu, 27 Jul 2023 03:33:45 -0700 (PDT) X-Google-Smtp-Source: APBJJlGWSTnDn3Ii7cvyoKBrT2XS7mnT5tJ8vahlh6Jmmp0cErnsUliJGOExW6zhbZEDTIeUGXHV X-Received: by 2002:a50:ed84:0:b0:521:d1f0:300c with SMTP id h4-20020a50ed84000000b00521d1f0300cmr1409411edr.23.1690454025099; Thu, 27 Jul 2023 03:33:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690454025; cv=none; d=google.com; s=arc-20160816; b=0IFoajO9Oo21InhCUvuxWN92ttB9d8bjgxG7MXTdGY8bZJ7N1+OxmVjoHJVZyM2qFd 4Emi8ySpT7ovFfA1yWxGnBcd5JpaxfSS078TmBmPgGsR2WhUDl0EQFT0fHNbqLQ4vGXo +2xwjc25wiBLXKF23AnUZ7CPZhffEGcRwag7MtTSgSZGfDTl/occtg59C+0+48PuAQed neT0IjDocwa0EftOp9YJTBWEWEolnc1eGNIckPC21uegsE3ON0h0YCiCYejNij0Y2Fxc 1Ke+xF5YaDy5iZUcxG44+47nXy1c6vtTQyRvGY2pcNZCNBA89Fo6n6SF0pYyU0YhqXGy qAGA== 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=4VsKgOIlO7JTMbURB3u+V7Qr/QzOpc+0Bt56AjhAYAM=; fh=tszi7pL3Vv8REqhn5Bf0edtKNXU19d2Zujj0OUV+K0Y=; b=O8QFv403yQpuQb7+Xw3pSQevmxNdRdtOWWELjKL54QyF8jiY21U5FWXz3K3V8/NlMn ofTY+n9Ie7DzQnkwp58kstHBW446YKacgxkQpabtBCi4FtKD51XpSenEPmPLmTC/W3aG 0aryIn0Rbc5anjdxrCWpivA1Wvmal4TCWpIszqIJb/uyMHrMhSEMs/RzcI6MAddPOtAf dl4DjuByeFmOy7FXwM33OTSTBHugrCGPU7sECvx4LvwfRdzUp/kYAv7pQIcr3ase5c7f 96ahR1Wv3fVjNu35NC98g7pyiPQd3oUik30YlPmgP0OmbudQsgSGdX++bvMmQsPiBnnN X1HQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b="Zr/NhsMb"; 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 r19-20020a056402035300b00522584bb598si765211edw.135.2023.07.27.03.33.20; Thu, 27 Jul 2023 03:33:45 -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="Zr/NhsMb"; 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 S233969AbjG0Kcc (ORCPT + 99 others); Thu, 27 Jul 2023 06:32:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60290 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233923AbjG0Kcb (ORCPT ); Thu, 27 Jul 2023 06:32:31 -0400 Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C6EE1984 for ; Thu, 27 Jul 2023 03:32:26 -0700 (PDT) Received: by mail-pj1-x1034.google.com with SMTP id 98e67ed59e1d1-2680edb9767so163328a91.0 for ; Thu, 27 Jul 2023 03:32:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1690453945; x=1691058745; 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=4VsKgOIlO7JTMbURB3u+V7Qr/QzOpc+0Bt56AjhAYAM=; b=Zr/NhsMbDbdIdSqoueTQTw00LusmUmyLrdR7MeDx+ZO5Q+75jdmzv373GL0Ee5CtKr W6fluKiuFJCg5ZU3kW0Km101UvphMU1vBCY7hDEO6TFqab4XzqrIV8fVDPR2Owpqim7U N3OX4eAxVQVjc5z6Zvv7YweV9TAIgzv2mVUZoaytYD45Z4tHHiC7Kn023GaYmi5v6RKy g9n+r/2KPb5qfD2ZK/MDUQIwCLsfUVl7c4q/2XRu1uefpNinWMEwlZLohyik+zojbFUF urJtl81vW3ulTBjRT5ht+WLfC03kh8PaMNuzZ2kESl6uu5dT49u0KrVoAN4kKuQ8SPSD k2iA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690453945; x=1691058745; 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=4VsKgOIlO7JTMbURB3u+V7Qr/QzOpc+0Bt56AjhAYAM=; b=giAp87u3IU8T76bGPN8lot0RqFzvBeCOfr+VbvYHhF01210CP08VEEABfaEf4FLzI4 3YUDVS9ZNZYB0pd+nt6kM5kccsXvMom1rIQbD+PdxNtNxyT1gPae6/xaI3bbYWY1y1s8 POV74fTsnoRErxrh76eXQPldAEy1fvTBnwxtsMxe4mJjtpzHiIjr8AiJkJdqaLau5KDQ HXWOr5KMjBgF46YWSZPz3r9xlPjrvD+vMOfJJhN11dLywrGnrODJuqnI1Mhja8s3bfo9 XZqoLIXrvh9aYlRwisfkYOWck97B4jInFxeZDZApwnVpYMsyTnp7B8mcs9A6dSF+Byl3 QMJA== X-Gm-Message-State: ABy/qLbZ/Ox2hOpSOF1f9c9hTjmoVHN9rSbQyBJ6VyRz1xMMnZ3V4hX1 scgYWx8Ue2mFWN1Y4rQY+EFVUw== X-Received: by 2002:a17:90a:1b06:b0:263:2312:60c2 with SMTP id q6-20020a17090a1b0600b00263231260c2mr4299433pjq.3.1690453945653; Thu, 27 Jul 2023 03:32:25 -0700 (PDT) Received: from [10.70.252.135] ([203.208.167.147]) by smtp.gmail.com with ESMTPSA id 8-20020a17090a018800b0026309d57724sm2755058pjc.39.2023.07.27.03.32.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 27 Jul 2023 03:32:25 -0700 (PDT) Message-ID: Date: Thu, 27 Jul 2023 18:32:10 +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 v3 28/49] dm zoned: dynamically allocate the dm-zoned-meta shrinker Content-Language: en-US To: Damien Le Moal 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, Muchun Song , 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 References: <20230727080502.77895-1-zhengqi.arch@bytedance.com> <20230727080502.77895-29-zhengqi.arch@bytedance.com> <56ee1d92-28ee-81cb-9c41-6ca7ea6556b0@bytedance.com> From: Qi Zheng In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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 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/27 18:20, Damien Le Moal wrote: > On 7/27/23 17:55, Qi Zheng wrote: >>>>           goto err; >>>>       } >>>>   +    zmd->mblk_shrinker->count_objects = dmz_mblock_shrinker_count; >>>> +    zmd->mblk_shrinker->scan_objects = dmz_mblock_shrinker_scan; >>>> +    zmd->mblk_shrinker->seeks = DEFAULT_SEEKS; >>>> +    zmd->mblk_shrinker->private_data = zmd; >>>> + >>>> +    shrinker_register(zmd->mblk_shrinker); >>> >>> I fail to see how this new shrinker API is better... Why isn't there a >>> shrinker_alloc_and_register() function ? That would avoid adding all this code >>> all over the place as the new API call would be very similar to the current >>> shrinker_register() call with static allocation. >> >> In some registration scenarios, memory needs to be allocated in advance. >> So we continue to use the previous prealloc/register_prepared() >> algorithm. The shrinker_alloc_and_register() is just a helper function >> that combines the two, and this increases the number of APIs that >> shrinker exposes to the outside, so I choose not to add this helper. > > And that results in more code in many places instead of less code + a simple > inline helper in the shrinker header file... So not adding that super simple It also needs to be exported to the driver for use. > helper is not exactly the best choice in my opinion. Hm, either one is fine for me. If no one else objects, I can add this helper. ;) >