Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 352FBC433EF for ; Mon, 27 Dec 2021 15:36:58 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4JN1xN5lpbz2yph for ; Tue, 28 Dec 2021 02:36:56 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=casper.20170209 header.b=NTwFV35D; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=infradead.org (client-ip=2001:8b0:10b:1236::1; helo=casper.infradead.org; envelope-from=willy@infradead.org; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=casper.20170209 header.b=NTwFV35D; dkim-atps=neutral Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4JN1xF0ldSz2xtp for ; Tue, 28 Dec 2021 02:36:48 +1100 (AEDT) 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=KlY3YEK6X0uARULPz6Pxb8wpNr9w7Alv1AW3+GE6wi0=; b=NTwFV35Ds0212Hy14VKCVxtteg tiwTvimcAs9C+0EGaNbW2nia5scWc6yhNXSQbWefr7tqq+Go984HsodIUOA1ksMQTnl/FiGlUnE4p f+36AxQsKEcOt/cq9yvb6DEX9JCc1KD0mk2sWl/yN3vXo+7b5vVpsWb7Hsi0osh4kUDqQNUHBojqP w4KCzd7W+CvKb/k/+SN+a9AlkXqLDlklQmE4WBAtTI7LQ2AGXWSSABN788LqTHEZFgi6WnIBS9HEc /R8dw6gW/qs1MhBwIT6FWgO86OvfTRl1WdqRPhIzyswUP5J0kklCXEqIW590Qqw8vC9J1LBfpNH3f BvW90qtQ==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1n1s37-007V8t-4r; Mon, 27 Dec 2021 15:36:33 +0000 Date: Mon, 27 Dec 2021 15:36:33 +0000 From: Matthew Wilcox To: Jeffle Xu Subject: Re: [PATCH v1 19/23] cachefiles: implement .demand_read() for demand read Message-ID: References: <20211227125444.21187-1-jefflexu@linux.alibaba.com> <20211227125444.21187-20-jefflexu@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211227125444.21187-20-jefflexu@linux.alibaba.com> X-BeenThere: linux-erofs@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development of Linux EROFS file system List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: tao.peng@linux.alibaba.com, linux-kernel@vger.kernel.org, dhowells@redhat.com, joseph.qi@linux.alibaba.com, linux-cachefs@redhat.com, bo.liu@linux.alibaba.com, linux-fsdevel@vger.kernel.org, gerry@linux.alibaba.com, linux-erofs@lists.ozlabs.org, eguan@linux.alibaba.com Errors-To: linux-erofs-bounces+linux-erofs=archiver.kernel.org@lists.ozlabs.org Sender: "Linux-erofs" On Mon, Dec 27, 2021 at 08:54:40PM +0800, Jeffle Xu wrote: > + spin_lock(&cache->reqs_lock); > + ret = idr_alloc(&cache->reqs, req, 0, 0, GFP_KERNEL); GFP_KERNEL while holding a spinlock? You should be using an XArray instead of an IDR in new code anyway.