Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp3627859rwe; Mon, 17 Apr 2023 00:38:41 -0700 (PDT) X-Google-Smtp-Source: AKy350bV1df/mV719lYSz0iVJcO8zmIGMem/k0KwlZm/DZ/0Nq751L5nCbP+zQabBHMFmm2bwV9r X-Received: by 2002:a05:6a00:181d:b0:622:ec07:c6bc with SMTP id y29-20020a056a00181d00b00622ec07c6bcmr21406473pfa.15.1681717121359; Mon, 17 Apr 2023 00:38:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681717121; cv=none; d=google.com; s=arc-20160816; b=q/d3L7c+M6fBs6khV4sw7fief8WI2pVIo+HubDFDVYJODZMZIhDvy64zNjZqm4LHTW 0CkVGYRwecNFO6ZSn8J+oYv8u6vpYzy6xD+JTqGjm5slILqfeY2JEon4WMRKIvsJFCtW 9GULXzUeQOO7Tvv8UAAVLZ8/ZOMMSxkIXOSJaudBqOkZhis7B90I1N7G1UvTUx48Yzi4 07AzO71fzk0/8c1emmEnd6k9M0dsgjuT0bzFu4koH9bU6MqQ2YmcEk9GPIeHE559x4IP penTIokdwNut4q9rzmq6UTjRL8UTrD62Ok62m0rYK1IBWsJ2eP6Z4RJPBMlnPkNoqRnv Pizw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=ql0iTP179pIhS3D2wVviSQ4v43IiJJy5uQQWSApfMgw=; b=ggQn1+oy1V77gc7rStORmyMWUelUttHcCS2BFPlCCjVAdHVZlMZ9MEC1ndfzr2gixJ 2JwFGY7XeLq9iqfjZt6I+l+myZnzMqzYAjBtZW8tsYbwtT4y7WYeSKKfMgCcm6wzIwmr DyiSv7/mZmH64ALVNiMl/UE/PNagek9vz3LOwv2j6Aef9liitkWn3Q0WhjdMit4EBThJ ZOyf0KQJPqQY8W0Gl/RUG+sM72HO7OlEMuTZCfngaKKvhLeF2WDN4r+oJNdo1/ybURNH Qsnneu/l/5dlnv+yPyVIOqQXWm3i+y35arVI/Eky1pkw4nKUYOM+Bx5C+eIpoVP872Jl o6zA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=olHgJtXl; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w5-20020a626205000000b0063c7ed4cb0esi2123927pfb.170.2023.04.17.00.38.30; Mon, 17 Apr 2023 00:38:41 -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; dkim=pass header.i=@gmail.com header.s=20221208 header.b=olHgJtXl; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231179AbjDQHiL (ORCPT + 99 others); Mon, 17 Apr 2023 03:38:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50200 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230002AbjDQHho (ORCPT ); Mon, 17 Apr 2023 03:37:44 -0400 Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com [IPv6:2607:f8b0:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 788445BBE for ; Mon, 17 Apr 2023 00:37:03 -0700 (PDT) Received: by mail-pl1-x633.google.com with SMTP id y6so23611618plp.2 for ; Mon, 17 Apr 2023 00:37:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1681717022; x=1684309022; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=ql0iTP179pIhS3D2wVviSQ4v43IiJJy5uQQWSApfMgw=; b=olHgJtXl3xiBtP0Nv6bocud6SVVd0gwMTdXw8n/5ssQfoXMiSy2INA8TOLFP8Vp7TH Ku+SQ5nb+FwwYzAgVgF9hI7Q8ymhh4THiLGZMZJEIpXPaSdwr9d1Lu8hDifYSdXQFOV8 +3t8C1DEdGkqKzFvhoGptiQtZTfbg/CEMSZctRk81+Jie5sX9rxu39Rw4VsF+zwvn7vQ 1jA/ortoG/zVQWnuNBj+Cw9RGTW3KYlqOaLsYfb0T+/3ymr0rljTK73UcAWo0NjAQpJg 093o8n4v1IBIM4ZzQ6rErOtJLTBxEycDdQakKYwvQ+5LcsD54D4CJpHIctbI0yZxgbIn geIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681717022; x=1684309022; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ql0iTP179pIhS3D2wVviSQ4v43IiJJy5uQQWSApfMgw=; b=XFRuL1qE6Y/OxPGhorloWfWyPaVluXEkKn32bYpHoRhb3wTc931Q2tAfzpD6PrWh0d ADYqOqxWKAiRRrqjq4K0PMvh9NFaCkpclkoSSV7ADpq80hQarOIDeM8OnkTtFYGFp6vc O7PRFPH3IljS/rCyZU6C2EPprXUN5V985MBkEku1m5UONbEQkEVu6JE7ayo6rHplZXKs jUpA6o/Nr83nhsaSPZOQzouAgkwCy07qYUwVuvHw4PWjSLnol5fnp38Vz6jF7Ttlr6kP gyOmr4wz8AR61j1DUj2chORuFWUI+vvjgU6US/1iQ0zMeacnhN9toi/3ACXMfraEKNGy v/sg== X-Gm-Message-State: AAQBX9d5Q/2tV7gs983Km7847ptwCjNEmdETXYOGNdEbvG0fdE6eMBOt 3TBeYg3JfCBC0s3vpnR8TNU= X-Received: by 2002:a17:903:32c6:b0:1a6:566b:dd73 with SMTP id i6-20020a17090332c600b001a6566bdd73mr13990591plr.60.1681717022477; Mon, 17 Apr 2023 00:37:02 -0700 (PDT) Received: from localhost ([156.236.96.165]) by smtp.gmail.com with ESMTPSA id d22-20020a170902b71600b001a67759f9f8sm733233pls.106.2023.04.17.00.37.00 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 17 Apr 2023 00:37:02 -0700 (PDT) Date: Mon, 17 Apr 2023 15:44:15 +0800 From: Yue Hu To: Gao Xiang 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 Subject: Re: [PATCH] erofs: remove unneeded icur field from struct z_erofs_decompress_frontend Message-ID: <20230417154415.00006a18.zbestahu@gmail.com> In-Reply-To: References: <20230417064136.5890-1-zbestahu@gmail.com> <26cdf7b0-5d7d-68ba-da76-1ad800708946@linux.alibaba.com> <20230417151506.00006565.zbestahu@gmail.com> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; i686-w64-mingw32) MIME-Version: 1.0 Content-Type: text/plain; charset=GB18030 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Mon, 17 Apr 2023 15:12:31 +0800 Gao Xiang wrote: > 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. Yeah, i misread that, it should be global before submission, just ignore the change. > > 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 > >> > >>>> +?0?2?0?2?0?2 unsigned int icur = pcl->pclusterpages; > >>>> -?0?2?0?2?0?2 while (fe->icur > 0) { > >>>> -?0?2?0?2?0?2?0?2?0?2?0?2?0?2 if (!cmpxchg(&pcl->compressed_bvecs[--fe->icur].page, > >>>> +?0?2?0?2?0?2 while (icur > 0) { > >>>> +?0?2?0?2?0?2?0?2?0?2?0?2?0?2 if (!cmpxchg(&pcl->compressed_bvecs[--icur].page, > >>>> ?0?2?0?2?0?2?0?2?0?2?0?2?0?2?0?2?0?2?0?2?0?2?0?2?0?2?0?2?0?2?0?2?0?2?0?2 NULL, bvec->page)) { > >>>> -?0?2?0?2?0?2?0?2?0?2?0?2?0?2?0?2?0?2?0?2?0?2 pcl->compressed_bvecs[fe->icur] = *bvec; > >>>> +?0?2?0?2?0?2?0?2?0?2?0?2?0?2?0?2?0?2?0?2?0?2 pcl->compressed_bvecs[icur] = *bvec; > >>>> ?0?2?0?2?0?2?0?2?0?2?0?2?0?2?0?2?0?2?0?2?0?2?0?2?0?2 return true; > >>>> ?0?2?0?2?0?2?0?2?0?2?0?2?0?2?0?2?0?2 } > >>>> ?0?2?0?2?0?2?0?2?0?2 } > >>>> @@ -877,8 +876,6 @@ static int z_erofs_collector_begin(struct z_erofs_decompress_frontend *fe) > >>>> ?0?2?0?2?0?2?0?2?0?2 } > >>>> ?0?2?0?2?0?2?0?2?0?2 z_erofs_bvec_iter_begin(&fe->biter, &fe->pcl->bvset, > >>>> ?0?2?0?2?0?2?0?2?0?2?0?2?0?2?0?2?0?2?0?2?0?2?0?2?0?2?0?2?0?2?0?2?0?2 Z_EROFS_INLINE_BVECS, fe->pcl->vcnt); > >>>> -?0?2?0?2?0?2 /* since file-backed online pages are traversed in reverse order */ > >>>> -?0?2?0?2?0?2 fe->icur = z_erofs_pclusterpages(fe->pcl); > >>>> ?0?2?0?2?0?2?0?2?0?2 return 0; > >>>> ?0?2 }