Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp123567imw; Thu, 7 Jul 2022 22:59:19 -0700 (PDT) X-Google-Smtp-Source: AGRyM1s2ksOkka9Paio3Nwb+t/jsjcwwQuVvXbNuGFXlLcAbRpa6XBybtedoQgw69LFF1VkPr2mT X-Received: by 2002:a17:90a:73c5:b0:1ef:880f:fe95 with SMTP id n5-20020a17090a73c500b001ef880ffe95mr2080736pjk.95.1657259959401; Thu, 07 Jul 2022 22:59:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657259959; cv=none; d=google.com; s=arc-20160816; b=Uqi4jwsFDt7iCXD+INcWuqaOIX0HuLUov3MgS7P98Cm1LeIwt+VX5V35RCywaLmUlv cWf0hMx4lS1MJPd1p/vdkDFEVgBPYwo0eybsIlj87e+zUfWamT/zRWGyNOGVoDjQPS2/ h/cPUolGdcVLrqJOlBNfpK40JgvRGmiVKTULzJHmgzFccgEXcYeQprAQdtdkk+Q5dwmf 3ouHQmC7UbNqCmGAYEkqStLsmT2hzaYutBCjKLtPNAqUSqoK2T61d6GPRCX/3h7NqM01 zyrcD3KEtuVQA52qasevGEI3PfR4Bkzos/VHGnhdKkEgYWVvzabqsQ5EnZsYLqqfr5eT FZ5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=WkRfW/4uWm5rn89NsCmlbchdHEY/DiYOfsNzFLv7VyQ=; b=JEpa6eiQxjJnjy0HWKJLvOE+YK9/RgYR4yNWHq5YmfUxSgAMUvAaaY7LFJzxWDzMC3 UQUa+dERBs2CIrMVWOtCbMTJQB32VxOtH051AYVxqnxAml7GRDFsUcifNFNZ7yznJS0t XZ7hiPfUAhPkTwsRL8YUDzHGNgBiMbZmbl3lqjbmLalbrnt+ct1hXINHpuTpGWyqROXB EssLpoIDkmpnNhr7kAabqtY6LZFI1j1amiSl4vPCaU2eLWDTwA4p6iOAWk4cP9nUEFFR YsTCaK02sukyLU07dTHw3Wn8siR2LpoRNJWSGcK/Ymhvh2tsMhQWyfcoXASgEHOrCp7c 09Bg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ot12-20020a17090b3b4c00b001d996a5c5e4si1841185pjb.128.2022.07.07.22.59.03; Thu, 07 Jul 2022 22:59:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237200AbiGHFl6 (ORCPT + 99 others); Fri, 8 Jul 2022 01:41:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56218 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237190AbiGHFl4 (ORCPT ); Fri, 8 Jul 2022 01:41:56 -0400 Received: from out199-3.us.a.mail.aliyun.com (out199-3.us.a.mail.aliyun.com [47.90.199.3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 282D16308 for ; Thu, 7 Jul 2022 22:41:52 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R101e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018045168;MF=hsiangkao@linux.alibaba.com;NM=1;PH=DS;RN=6;SR=0;TI=SMTPD_---0VIiBeZe_1657258907; Received: from B-P7TQMD6M-0146.local(mailfrom:hsiangkao@linux.alibaba.com fp:SMTPD_---0VIiBeZe_1657258907) by smtp.aliyun-inc.com; Fri, 08 Jul 2022 13:41:49 +0800 Date: Fri, 8 Jul 2022 13:41:47 +0800 From: Gao Xiang To: guowei du Cc: xiang@kernel.org, Chao Yu , linux-erofs@lists.ozlabs.org, linux-kernel , duguowei Subject: Re: [PATCH 2/2] erofs: sequence each shrink task Message-ID: References: <20220708031155.21878-1-duguoweisz@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY,USER_IN_DEF_SPF_WL autolearn=ham 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-kernel@vger.kernel.org Hi, On Fri, Jul 08, 2022 at 12:49:07PM +0800, guowei du wrote: > hi, > I am sorry,there is only one patch. > > If two or more tasks are doing a shrinking job, there are different results > for each task. > That is to say, the status of each task is not persistent each time, > although they have > the same purpose to release memory. > > And, If two tasks are shrinking, the erofs_sb_list will become no order, > because each task will > move one sbi to tail, but sbi is random, so results are more complex. Thanks for the explanation. So it doesn't sound like a real issue but seems like an improvement? If it's more like this, you could patch this to the products first and beta for more time and see if it works well.. I'm more careful about such change to shrinker since it could impact downstream users... Yes, I know this behavior, but I'm not sure if it's needed to be treated as this way, because in principle shrinker can be processed by multiple tasks since otherwise it could be stuck by some low priority task (I remember it sometimes happens in Android.) > > Because of the use of the local variable 'run_no', it took me a long time > to understand the > procedure of each task when they are concurrent. > > There is the same issue for other fs, such as > fs/ubifs/shrink.c、fs/f2fs/shrink.c. > > If scan_objects cost a long time ,it will trigger a watchdog, shrinking > should > not make work time-consuming. It should be done ASAP. > So, I add a new spin lock to let tasks shrink fs sequentially, it will just > make all tasks shrink > one by one. Actually such shrinker is used for managed slots (sorry I needs more work to rename workgroup to such name). But currently one of my ongoing improvements is to remove pclusters immediately from managed slots if no compressed buffer is cached, so it's used for inflight I/Os (to merge decompression requests, including ongoing deduplication requests) and cached I/O only. So in that way objects will be more fewer than now. > > > Thanks very much. Thank you. Thanks, Gao Xiang