Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2248462pxp; Mon, 21 Mar 2022 14:57:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxtBWnGsS0S8UwYnu/I4K0JNbs2MX+Csyh9SUyJ0yItXLa5sG3DMvIAxdf2V5C+npHYy72u X-Received: by 2002:a17:903:1c7:b0:154:1831:1f76 with SMTP id e7-20020a17090301c700b0015418311f76mr15161678plh.0.1647899838496; Mon, 21 Mar 2022 14:57:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647899838; cv=none; d=google.com; s=arc-20160816; b=BH9VBS/c56hT5t+fOcOgor1oafj7j6LeJi3nXLB8X3JUEIkPzv/p1Nnv6oOHeBci4Z PQVBfu07VOgPpPgroRZX1Rdtwm+V3FbDwC+aRwaWBojV5lDSuOnY/HIPZTtrHol8hu9O ovBFYx51yKr6UwHKyxoOLNpx3u6sXzHRsqaMpOLuvA7ztT79CZgeGloLBe9bZoe72OT/ jTRco6odBaVYm1wfnGXRRSPXSe/1jIZx1hjQh+r3jwleNe529J2nDLwgpuwYh/2860Lx vyZlyfRRxGxqFr/Og16a66AdVDmU4tiYOoTF30v+O04qjbjgP5C8CyaCLJ2/oGvtxNt9 SkLA== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=A5pIWGpAlCpmoXO/m/tQzGXHU5kEsQj3f9sYGkjo+tw=; b=w8KUp4de1+FcAPK//FlyzPUumNwo1jP1+teUXvSE5xwEeZ5QMLfoWnhjmhsafJ3LfQ 7ruDirBq2oWpNtSdD1Jqnm2UHvJyD+Jpl1kwbyi7YkBIzlQzaqY/I3tgLjTz8DCkWeF1 5/CwAaNsSjvONuboNHqRIanFhSsAlzFgk7pJL8U+QBnPwWbdnwz4RVWh4Ra7lvS5hb1R wbYP9g1AiZZTvRFTscKVFiWrA4QQE4SJOUDBDoEVdY2GWJDCbQR0qW2qL/8DtOXEBZV5 QVXG6rqPyfgIX7lYDE8ZlA1Gquw1LSxFWNM/yW8TMIwQ3aRIsoj9beTd23d0MRLCRMcW N8CQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=gDa4hOdW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id o12-20020a056a001bcc00b004fa77b45e77si7934730pfw.41.2022.03.21.14.57.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Mar 2022 14:57:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=gDa4hOdW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id DC4993076C6; Mon, 21 Mar 2022 14:23:23 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347961AbiCUNmW (ORCPT + 99 others); Mon, 21 Mar 2022 09:42:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52692 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239990AbiCUNmV (ORCPT ); Mon, 21 Mar 2022 09:42:21 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0FA8870071; Mon, 21 Mar 2022 06:40:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=A5pIWGpAlCpmoXO/m/tQzGXHU5kEsQj3f9sYGkjo+tw=; b=gDa4hOdWqKAvf/Z2G+BXMo9fDJ awDh71+oGBKuK2GtiNS0Bm6vNc3vODkCarJJOJNd0U+6kPxpFSLz/TNPERV3p6KDWys1hUBuyP111 jaOqD+rF8Oh8tEErWlBCoqf8nu8kjqkedeovDbL25fIpUO0nzHM8D3uR3rBTfK/WzSNl4K8JZ1XDO Sdoqfbe3jUnOjltxe81qwd9VhUmcXzXcLHdkmtygg+uZo4IIYk/xFP0o6hhT0oOry28KA0oy97UFy HjQKcsVb/XGN7TP6uN1yi5rZMEjSpN2RlO99fUy4cIjmnfuUk2vVtaSsPAg9BQm1bDlpPhchFiacF UCa7zrKQ==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nWIGz-00Aba8-IG; Mon, 21 Mar 2022 13:40:37 +0000 Date: Mon, 21 Mar 2022 13:40:37 +0000 From: Matthew Wilcox To: Jeffle Xu Cc: dhowells@redhat.com, linux-cachefs@redhat.com, xiang@kernel.org, chao@kernel.org, linux-erofs@lists.ozlabs.org, torvalds@linux-foundation.org, gregkh@linuxfoundation.org, linux-fsdevel@vger.kernel.org, joseph.qi@linux.alibaba.com, bo.liu@linux.alibaba.com, tao.peng@linux.alibaba.com, gerry@linux.alibaba.com, eguan@linux.alibaba.com, linux-kernel@vger.kernel.org, luodaowen.backend@bytedance.com Subject: Re: [PATCH v5 03/22] cachefiles: introduce on-demand read mode Message-ID: References: <20220316131723.111553-1-jefflexu@linux.alibaba.com> <20220316131723.111553-4-jefflexu@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220316131723.111553-4-jefflexu@linux.alibaba.com> X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Wed, Mar 16, 2022 at 09:17:04PM +0800, Jeffle Xu wrote: > +#ifdef CONFIG_CACHEFILES_ONDEMAND > + struct xarray reqs; /* xarray of pending on-demand requests */ > + rwlock_t reqs_lock; /* Lock for reqs xarray */ Why do you have a separate rwlock when the xarray already has its own spinlock? This is usually a really bad idea.