Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp3959498rwd; Mon, 29 May 2023 20:58:50 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6jw02P3q9+olO4Asw9hyAZPGA5/KdMNZSMHK4RNcPRByeWWA5eCwg8I6o4+5gT5IsRVp9n X-Received: by 2002:a17:902:8c91:b0:1b0:2cca:a1e3 with SMTP id t17-20020a1709028c9100b001b02ccaa1e3mr1025826plo.56.1685419129706; Mon, 29 May 2023 20:58:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685419129; cv=none; d=google.com; s=arc-20160816; b=TjeB3rLq6nrYUpqQxG7OyVDDAEfwYJ90r9X3edZHv26DuM1LGGtTQgQKHG7UZ3i99R kwjbjmfhymdOaJenpHPczRyJVA2EavxqfuaBqQblLSGIQrryh86V0IB6crF8zphwWwuA 52X0j6Av/zv1wr++pWzjNY7BZP71F1O043rgg6ZbLS89buPkGNdQaE27Xdt0UiRQaCz2 zYceHo1/nxnoqV0OAQ4YWK/++vrc3czN08VoVPMcoXvaE+fRkfmVpL/BuGnMhKGc5Wz6 cdS8JGIwp7e5z3CNxvIpSV0XgnvUfokkTVwTmx6XuvntCrlSzFSm3to1NX05dWlxyged iTfw== 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=DdSfaMnDPST0yDYLJSRYlzRuDvLWC1Vb40RxZnWTJJg=; b=D+7u6Hu9sWBopjN6TaBFaUsFB3eJzEkVSWJQ1wj1asMX+vcQAvVpIryTliEAMjFuat iM815oodrl/T7MP+2kxvqshGEt4MA94oSnTjM8KIeSAfeUGou4l/OMJtO7NGG8LyQlPp HW/MJF/UhzcSXq+GAXCOBytwQXPepkFy9ugoxp2vhIW4HBpjqOduNoCVGLQe4vUhDBXX wMTkNTv/iQ/0aHkIFyRWVelGn0gQcvb8huPPdCmrhpK92qoQyHgUQAvMV7tiVbO2+Hr7 YqurGf/lfqoNZRRh35NKbVz1ZJ905+CWGePNPSGvCwmdLZKsma5Y+QWrmBcmNed0PZYk sMiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=sMB3GVXI; 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 k14-20020a170902c40e00b001a994803b1csi4962080plk.19.2023.05.29.20.58.36; Mon, 29 May 2023 20:58:49 -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=sMB3GVXI; 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 S229745AbjE3DvH (ORCPT + 99 others); Mon, 29 May 2023 23:51:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229712AbjE3DvF (ORCPT ); Mon, 29 May 2023 23:51:05 -0400 Received: from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com [IPv6:2607:f8b0:4864:20::1036]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 90548D9 for ; Mon, 29 May 2023 20:51:03 -0700 (PDT) Received: by mail-pj1-x1036.google.com with SMTP id 98e67ed59e1d1-256531ad335so2159541a91.0 for ; Mon, 29 May 2023 20:51:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685418663; x=1688010663; 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=DdSfaMnDPST0yDYLJSRYlzRuDvLWC1Vb40RxZnWTJJg=; b=sMB3GVXIvnhuv1DLz+sWWRPtx/uMxhQZ5eOPyTSUzLPgAzS0zrGCZvTZ7ZfZcKSfSL jozrTBPVK8ZdkPEGOTvB1zRJxeuFhaEUPE2h0YyhFRKlf+hqKKMJgn06y5kpNbiNNNP5 3kM1aGpXQbgBc7H3S6k3rTK7KOtWM8mPOqyUXF13XQLxOMTigWfVecURObLq//zHuQbN 2t+nAVfnlOqEBUTy8vCHE8Y/KkBOif7GxWmhV2awX29pn99ALYaM/RL3Szi2cNug/69G xHn6uz6fXluT7ct80gePDHXtY8OpvFfjbwsSm/hzVPD8I1/elZbvXj4abOqaerlE8rwJ jyVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685418663; x=1688010663; 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=DdSfaMnDPST0yDYLJSRYlzRuDvLWC1Vb40RxZnWTJJg=; b=LW9nR3CYI77Pa0iFimBbnjMcakOE+SAnWOF4Jr7APIkRHTJIU/8+lo7MP2Jpz/YnRJ bvqC1sxv41U7rjGZ8t4s7K4sko1xbgcQ08mMDXIujMhvlc8M+u5w22zFL7x+4r27yAhB YsC4ssnNRPjBb7JAZEu2aEREuabFLE1JoNpnohERUzThd+LWgOpgPFwRJ6V7RhIfBWuf tmPK9TUp0q6knv6MsAk5Zrhm6OQZGa5ZvC1KkgcrKghmWPv+jPmsquoZlN3lp278AO2E ZoLKhXEV2xCeC2RpEvkblqv13J9gm79+N74UAxhtvWFrX/cJjkScz5HBNOhHbA0/XVPE S1Sw== X-Gm-Message-State: AC+VfDxFKqeelCCUhSCw2CffezNijFRVdAqiyWqMGX0qCVFxQiRSN49y w8rPK+qaFigEMMq/2kaSvHEYyOqZXOQ= X-Received: by 2002:a17:902:ec8b:b0:1b0:4b65:79db with SMTP id x11-20020a170902ec8b00b001b04b6579dbmr1213007plg.63.1685418662981; Mon, 29 May 2023 20:51:02 -0700 (PDT) Received: from localhost ([156.236.96.165]) by smtp.gmail.com with ESMTPSA id v2-20020a170902d68200b001b03842ab78sm3825471ply.89.2023.05.29.20.51.01 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 29 May 2023 20:51:02 -0700 (PDT) Date: Tue, 30 May 2023 11:59:12 +0800 From: Yue Hu To: Gao Xiang Cc: linux-erofs@lists.ozlabs.org, LKML , huyue2@coolpad.com Subject: Re: [PATCH v3 5/6] erofs: use struct lockref to replace handcrafted approach Message-ID: <20230530115912.0000195a.zbestahu@gmail.com> In-Reply-To: <20230529123727.79943-1-hsiangkao@linux.alibaba.com> References: <2fa6114d-9de2-9a0d-ae89-c012914bf682@linux.alibaba.com> <20230529123727.79943-1-hsiangkao@linux.alibaba.com> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; i686-w64-mingw32) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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, 29 May 2023 20:37:27 +0800 Gao Xiang wrote: > Let's avoid the current handcrafted lockref although `struct lockref` > inclusion usually increases extra 4 bytes with an explicit spinlock if > CONFIG_DEBUG_SPINLOCK is off. > > Apart from the size difference, note that the meaning of refcount is > also changed to active users. IOWs, it doesn't take an extra refcount > for XArray tree insertion. > > I don't observe any significant performance difference at least on > our cloud compute server but the new one indeed simplifies the > overall codebase a bit. > > Signed-off-by: Gao Xiang Reviewed-by: Yue Hu