From mboxrd@z Thu Jan 1 00:00:00 1970 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DABCCC433F5 for ; Thu, 14 Oct 2021 11:26:37 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 65CF16101E for ; Thu, 14 Oct 2021 11:26:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 65CF16101E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id C86126B006C; Thu, 14 Oct 2021 07:26:36 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C0D166B0071; Thu, 14 Oct 2021 07:26:36 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AADF2900002; Thu, 14 Oct 2021 07:26:36 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0118.hostedemail.com [216.40.44.118]) by kanga.kvack.org (Postfix) with ESMTP id 9982D6B006C for ; Thu, 14 Oct 2021 07:26:36 -0400 (EDT) Received: from smtpin29.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 51BCE18450987 for ; Thu, 14 Oct 2021 11:26:36 +0000 (UTC) X-FDA: 78694815192.29.D11D173 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf06.hostedemail.com (Postfix) with ESMTP id 95F80801A8A3 for ; Thu, 14 Oct 2021 11:26:35 +0000 (UTC) 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=/5zUfFoaiFBe8rfbKfTgk8jA8kMuRwKwp9CkU8MGJHU=; b=P8qtkmiD6MqHh/LdtaQwCNARXR 08F9cGCooJMOx/zzha05/ZgDG2fk7yy7SrlvtsHcYc95hxvuPZ5RoeCwNBiT3X/ejU4/X9BN9cwMc aBQoxt0D8poevpEtHYmRHSBBY1Sb9HRVT8V/Er9VNrSgUoZv1IDBECiWHilTOi8gD+BcM4mhRvlln s7sKDSnW8mPAnQePFcpcrqeiSZLVZJkezNAXlm8pMyH1r3whRbj2/AJZ3triprujtJYGNhShFGtWJ 55pQwsig5S4LUx+G+tyJ1C/kJLQBakLjAMZMhE5h/n52rGx4ZCW112uuy73tAHosI/kXlmVgHwALc NYdQ2cbw==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1mayqU-008Hx7-Pz; Thu, 14 Oct 2021 11:25:10 +0000 Date: Thu, 14 Oct 2021 12:24:22 +0100 From: Matthew Wilcox To: Zqiang Cc: akpm@linux-foundation.org, sunhao.th@gmail.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH] mm: backing-dev: use kfree_rcu() instead of synchronize_rcu_expedited() Message-ID: References: <20211014082433.30733-1-qiang.zhang1211@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211014082433.30733-1-qiang.zhang1211@gmail.com> X-Rspamd-Queue-Id: 95F80801A8A3 X-Stat-Signature: 6iqgp4sntzmuomqtdkurmd1ghqx15ma8 Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=P8qtkmiD; dmarc=none; spf=none (imf06.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org X-Rspamd-Server: rspam02 X-HE-Tag: 1634210795-563367 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, Oct 14, 2021 at 04:24:33PM +0800, Zqiang wrote: > The bdi_remove_from_list() is called in RCU softirq, however the > synchronize_rcu_expedited() will produce sleep action, use kfree_rcu() > instead of it. > > Reported-by: Hao Sun > Signed-off-by: Zqiang > --- > include/linux/backing-dev-defs.h | 1 + > mm/backing-dev.c | 4 +--- > 2 files changed, 2 insertions(+), 3 deletions(-) > > diff --git a/include/linux/backing-dev-defs.h b/include/linux/backing-dev-defs.h > index 33207004cfde..35a093384518 100644 > --- a/include/linux/backing-dev-defs.h > +++ b/include/linux/backing-dev-defs.h > @@ -202,6 +202,7 @@ struct backing_dev_info { > #ifdef CONFIG_DEBUG_FS > struct dentry *debug_dir; > #endif > + struct rcu_head rcu; > }; Instead of growing struct backing_dev_info, it seems to me this rcu_head could be placed in a union with rb_node, since it will have been removed from the bdi_tree by this point and the tree is never walked under RCU protection?