From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756481AbbJ2AAa (ORCPT ); Wed, 28 Oct 2015 20:00:30 -0400 Received: from e33.co.us.ibm.com ([32.97.110.151]:52422 "EHLO e33.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750980AbbJ2AA2 (ORCPT ); Wed, 28 Oct 2015 20:00:28 -0400 X-IBM-Helo: d03dlp02.boulder.ibm.com X-IBM-MailFrom: paulmck@linux.vnet.ibm.com X-IBM-RcptTo: linux-kernel@vger.kernel.org Date: Wed, 28 Oct 2015 17:00:30 -0700 From: "Paul E. McKenney" To: Patrick Marlier Cc: Ingo Molnar , Tejun Heo , Linus Torvalds , Linux Kernel Mailing List , Lai Jiangshan , Dipankar Sarma , Andrew Morton , Mathieu Desnoyers , Josh Triplett , Thomas Gleixner , Peter Zijlstra , Steven Rostedt , David Howells , Eric Dumazet , Darren Hart , =?iso-8859-1?Q?Fr=E9d=E9ric?= Weisbecker , Oleg Nesterov , pranith kumar Subject: Re: [PATCH tip/core/rcu 11/13] rculist: Make list_entry_rcu() use lockless_dereference() Message-ID: <20151029000030.GB4122@linux.vnet.ibm.com> Reply-To: paulmck@linux.vnet.ibm.com References: <20151006161305.GA9799@linux.vnet.ibm.com> <1444148028-11551-1-git-send-email-paulmck@linux.vnet.ibm.com> <1444148028-11551-11-git-send-email-paulmck@linux.vnet.ibm.com> <20151026084506.GA28423@gmail.com> <20151026145552.GG5105@linux.vnet.ibm.com> <20151027051939.GA19355@mtj.duckdns.org> <20151028083353.GA824@gmail.com> <5631319E.5000606@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5631319E.5000606@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15102900-0009-0000-0000-00000F4F6032 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 28, 2015 at 09:35:42PM +0100, Patrick Marlier wrote: > > > On 10/28/2015 09:33 AM, Ingo Molnar wrote: > > > >* Tejun Heo wrote: > > > >>Subject: writeback: don't use list_entry_rcu() for pointer offsetting in bdi_split_work_to_wbs() > >> > >>bdi_split_work_to_wbs() uses list_for_each_entry_rcu_continue() to > >>walk @bdi->wb_list. To set up the initial iteration condition, it > >>uses list_entry_rcu() to calculate the entry pointer corresponding to > >>the list head; however, this isn't an actual RCU dereference and using > >>list_entry_rcu() for it ended up breaking a proposed list_entry_rcu() > >>change because it was feeding an non-lvalue pointer into the macro. > >> > >>Don't use the RCU variant for simple pointer offsetting. Use > >>list_entry() instead. > >> > >>Signed-off-by: Tejun Heo > >>--- > >> fs/fs-writeback.c | 4 ++-- > >> 1 file changed, 2 insertions(+), 2 deletions(-) > >> > >>diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c > >>index 29e4599..7378169 100644 > >>--- a/fs/fs-writeback.c > >>+++ b/fs/fs-writeback.c > >>@@ -779,8 +779,8 @@ static void bdi_split_work_to_wbs(struct backing_dev_info *bdi, > >> bool skip_if_busy) > >> { > >> struct bdi_writeback *last_wb = NULL; > >>- struct bdi_writeback *wb = list_entry_rcu(&bdi->wb_list, > >>- struct bdi_writeback, bdi_node); > >>+ struct bdi_writeback *wb = list_entry(&bdi->wb_list, > >>+ struct bdi_writeback, bdi_node); > >> > >> might_sleep(); > > > >Any objections against me applying this fix to tip:core/rcu so that I can push the > >recent RCU changes towards linux-next without triggering a build failure? > > No objection on my side but probably you are waiting for an ack from > somebody else. I am guessing that he was asking Tejun, but just for the record, I am OK with it as well: Acked-by: Paul E. McKenney Thanx, Paul