Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp3609660rwe; Mon, 17 Apr 2023 00:16:18 -0700 (PDT) X-Google-Smtp-Source: AKy350Y1imU+evfEDiiC42NEA7WOLqemOE25NV5R53n9yfdwDeCfvs7z4XZaDAMr2+LwGp8I4Ie1 X-Received: by 2002:a05:6a21:3285:b0:ec:707f:7dc7 with SMTP id yt5-20020a056a21328500b000ec707f7dc7mr16739518pzb.33.1681715778660; Mon, 17 Apr 2023 00:16:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681715778; cv=none; d=google.com; s=arc-20160816; b=mY3jzTczR2hCx7Pu9f2bDKbKabeiOLaczUSIwjZme0jEpD/FJXrje0Hb/0o7dGuVFP M2QpRR4VUmE7ari35xk+6nJaZhvQMtJiwneT03a8ta5bs1lbrmvUqMZhH5odOztu4rwG iGbd/TT1G14RNIaByZ85cTAbn3JSBvOSIoUEJ705wiVISO94QkssXJywz7iqsAJxQLVj iAOU09VVnXyhyAUQR7eYFMqdF+PnnOVG0NeTEVLDQqV4YF6lP8o57cukENRLMsroRgWC sylXAVKuBPlG3aTsmxac8ytCDkhTRqWFiph2KjCItGU2PTyf+XtFmsAXjtiL0p89aFPg DEJg== 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:subject:user-agent:mime-version:date:message-id; bh=sXHmAp2WCLt5A0s+cm8M94UQJGM6csEkXG+lofkAXyw=; b=HsC8gehdcIda2oKJrqiQlqCn+ACW8GlIgKuQfWPRLzYqxFy/SpJ2YEOQDRpJCb2+0m I37Me/by88gMcQIS2fd3ryxomvVWLuMSH4m/AXmUmB21DbsTQYi6MzQp6cU4EsjDYCsO rfA9kTm7GmONqaXIZXtaUWwznSr92mvlCaUPXS52ki6XZRAU5zR0UsPrIdbYTSop5aOs NYvMztNoOtzuZP/hToZyORnZ3It+kGJQxkRTq09TqK1FjyC6N8YOZJKw9ub2idkQH+CM iOaI3ieEm7IwMz7JCAsiFKdDbzpyGxzFhn6hLZc64OsNltOfqnZ4t1rkhkgdHcjl4EaC Vn0A== 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 a21-20020a63e855000000b0051b5256a3fdsi11168117pgk.305.2023.04.17.00.16.04; Mon, 17 Apr 2023 00:16:18 -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 S229915AbjDQHMm (ORCPT + 99 others); Mon, 17 Apr 2023 03:12:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57654 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229925AbjDQHMj (ORCPT ); Mon, 17 Apr 2023 03:12:39 -0400 Received: from out30-110.freemail.mail.aliyun.com (out30-110.freemail.mail.aliyun.com [115.124.30.110]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 501ED40E3 for ; Mon, 17 Apr 2023 00:12:35 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R151e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046050;MF=hsiangkao@linux.alibaba.com;NM=1;PH=DS;RN=8;SR=0;TI=SMTPD_---0VgFMACV_1681715551; Received: from 30.97.49.3(mailfrom:hsiangkao@linux.alibaba.com fp:SMTPD_---0VgFMACV_1681715551) by smtp.aliyun-inc.com; Mon, 17 Apr 2023 15:12:32 +0800 Message-ID: Date: Mon, 17 Apr 2023 15:12:31 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.9.1 Subject: Re: [PATCH] erofs: remove unneeded icur field from struct z_erofs_decompress_frontend To: Yue Hu Cc: xiang@kernel.org, chao@kernel.org, linux-erofs@lists.ozlabs.org, jefflexu@linux.alibaba.com, linux-kernel@vger.kernel.org, huyue2@coolpad.com, zhangwen@coolpad.com References: <20230417064136.5890-1-zbestahu@gmail.com> <26cdf7b0-5d7d-68ba-da76-1ad800708946@linux.alibaba.com> <20230417151506.00006565.zbestahu@gmail.com> From: Gao Xiang In-Reply-To: <20230417151506.00006565.zbestahu@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-10.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,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 On 2023/4/17 15:15, Yue Hu wrote: > On Mon, 17 Apr 2023 15:00:25 +0800 > Gao Xiang wrote: > .. >> >> Although please help refine the comment below: >> >> /* scan & fill inplace I/O pages in the reverse order */ > > Ok, will refine it in v2. I rethink this, I don't want to go far in this way, and this makes a O(n) scan into O(n^2) when a single inplace I/O page is added. So sorry, I don't think it's a good way, although I also don't think `icur` is a good name and we might need to find a better name. Thanks, Gao Xiang > >> >> Thanks, >> Gao Xiang >> >>>> +    unsigned int icur = pcl->pclusterpages; >>>> -    while (fe->icur > 0) { >>>> -        if (!cmpxchg(&pcl->compressed_bvecs[--fe->icur].page, >>>> +    while (icur > 0) { >>>> +        if (!cmpxchg(&pcl->compressed_bvecs[--icur].page, >>>>                    NULL, bvec->page)) { >>>> -            pcl->compressed_bvecs[fe->icur] = *bvec; >>>> +            pcl->compressed_bvecs[icur] = *bvec; >>>>               return true; >>>>           } >>>>       } >>>> @@ -877,8 +876,6 @@ static int z_erofs_collector_begin(struct z_erofs_decompress_frontend *fe) >>>>       } >>>>       z_erofs_bvec_iter_begin(&fe->biter, &fe->pcl->bvset, >>>>                   Z_EROFS_INLINE_BVECS, fe->pcl->vcnt); >>>> -    /* since file-backed online pages are traversed in reverse order */ >>>> -    fe->icur = z_erofs_pclusterpages(fe->pcl); >>>>       return 0; >>>>   }