Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp4394382pxb; Thu, 14 Oct 2021 04:29:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxSbSK91hQo+CmByuXaVeNFtMmegYYUGscquhyfTpQ7kguaoRR4v3QNiUOvSQyBpgQMT/3o X-Received: by 2002:a17:906:d0d8:: with SMTP id bq24mr3238995ejb.402.1634210944117; Thu, 14 Oct 2021 04:29:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634210944; cv=none; d=google.com; s=arc-20160816; b=JM3kmnTsAXy98khhnXDesJJOeNvpfXG1DrQUN3+JJtLrvdG4TUS4TnqQpLe9x0rwIk 3Ed7FeKfD9ZI8q6X5vQqEozEw3FApEJPMwoxxFmtbWzlN0CPrz1Un4N26cHQcVSXxVcS +uknN3j1gS10Jws0T32wHLNpzReMUjzNqIwI79oeGf0BIpgTm5Umj/sAS29yyElH3j5F lRCx6rlpplANcIPG3Cvm0ZpJ4seoNfgvNzKTq03+zAWpuEeM7iawr2/iSCMY8huuUTct P7OM7D39HiJrONj4NfJbbM25XDel96GTX1ZN+ET9tSBrQiwCHKYGt9AbhdpIoiXK3/Ka M2xQ== 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=/5zUfFoaiFBe8rfbKfTgk8jA8kMuRwKwp9CkU8MGJHU=; b=Lvz0saygMRiDtOmlN5PfYNzogFNc/EMINmkVSwDvhJYEqcRx7GdLOjFfc1QeiBwfhC MadpWsAprtnoylrqnbotfcJZtm2xaEBrnUWShHp9K6gsQbzh8/KyjkKya8ulVR4M9wee lFry+aVIhVDZC67qauTi/1NEtPbQZy8GrZEGO8OyK47PLTsYE6gacWZmBDQSj7rPX8uv GASpm6QDY0gIjopPTIiCLYH4g06eRNREtgtgzKAgVOWy5io8p93H29NIvW1WY1BFqrma 0agYWabQKBmwPqOp98bmVkMN7gv8XOREEyeDY2CL0n4acwGaMSkPYbkUlw+IJ6GyaJ0W mX2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=P8qtkmiD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i12si5575859edc.272.2021.10.14.04.28.38; Thu, 14 Oct 2021 04:29:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=P8qtkmiD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230229AbhJNL2k (ORCPT + 99 others); Thu, 14 Oct 2021 07:28:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54388 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229994AbhJNL2k (ORCPT ); Thu, 14 Oct 2021 07:28:40 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 95AE0C061570 for ; Thu, 14 Oct 2021 04:26:35 -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=/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> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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?