Re: [PATCH tip/core/rcu 11/13] rculist: Make list_entry_rcu() use lockless_dereference()

2015-10-28 Thread Tejun Heo
On Wed, Oct 28, 2015 at 05:00:30PM -0700, Paul E. McKenney wrote: > > >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 waitin

Re: [PATCH tip/core/rcu 11/13] rculist: Make list_entry_rcu() use lockless_dereference()

2015-10-28 Thread Paul E. McKenney
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

Re: [PATCH tip/core/rcu 11/13] rculist: Make list_entry_rcu() use lockless_dereference()

2015-10-28 Thread Patrick Marlier
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,

Re: [PATCH tip/core/rcu 11/13] rculist: Make list_entry_rcu() use lockless_dereference()

2015-10-28 Thread Ingo Molnar
* 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 calcula

Re: [PATCH tip/core/rcu 11/13] rculist: Make list_entry_rcu() use lockless_dereference()

2015-10-26 Thread Paul E. McKenney
On Tue, Oct 27, 2015 at 02:19:39PM +0900, Tejun Heo wrote: > Hello, > > On Tue, Oct 27, 2015 at 12:37:16PM +0900, Linus Torvalds wrote: > > > I believe that the above should instead be: > > > > > > struct bdi_writeback *wb = list_entry_rcu(bdi->wb_list.next, > > I should have just used li

Re: [PATCH tip/core/rcu 11/13] rculist: Make list_entry_rcu() use lockless_dereference()

2015-10-26 Thread Paul E. McKenney
On Tue, Oct 27, 2015 at 12:37:16PM +0900, Linus Torvalds wrote: > On Mon, Oct 26, 2015 at 11:55 PM, Paul E. McKenney > wrote: > >> struct bdi_writeback *last_wb = NULL; > >> struct bdi_writeback *wb = list_entry_rcu(&bdi->wb_list, > > > > I believe that the above should instead be:

Re: [PATCH tip/core/rcu 11/13] rculist: Make list_entry_rcu() use lockless_dereference()

2015-10-26 Thread Tejun Heo
Hello, On Tue, Oct 27, 2015 at 12:37:16PM +0900, Linus Torvalds wrote: > > I believe that the above should instead be: > > > > struct bdi_writeback *wb = list_entry_rcu(bdi->wb_list.next, I should have just used list_entry() here. It's just offseting the pointer to set up the initial ite

Re: [PATCH tip/core/rcu 11/13] rculist: Make list_entry_rcu() use lockless_dereference()

2015-10-26 Thread Linus Torvalds
On Mon, Oct 26, 2015 at 11:55 PM, Paul E. McKenney wrote: >> struct bdi_writeback *last_wb = NULL; >> struct bdi_writeback *wb = list_entry_rcu(&bdi->wb_list, > > I believe that the above should instead be: > > struct bdi_writeback *wb = list_entry_rcu(bdi->wb_list.next, I

Re: [PATCH tip/core/rcu 11/13] rculist: Make list_entry_rcu() use lockless_dereference()

2015-10-26 Thread Ingo Molnar
* Paul E. McKenney wrote: > > It's this new usage in fs/fs-writeback.c: > > > > static void bdi_split_work_to_wbs(struct backing_dev_info *bdi, > > struct wb_writeback_work *base_work, > > bool skip_if_busy) > > { > > s

Re: [PATCH tip/core/rcu 11/13] rculist: Make list_entry_rcu() use lockless_dereference()

2015-10-26 Thread Paul E. McKenney
On Mon, Oct 26, 2015 at 09:45:06AM +0100, Ingo Molnar wrote: > > * Paul E. McKenney wrote: > > > From: Patrick Marlier > > > > The current list_entry_rcu() implementation copies the pointer to a stack > > variable, then invokes rcu_dereference_raw() on it. This results in an > > additional st

Re: [PATCH tip/core/rcu 11/13] rculist: Make list_entry_rcu() use lockless_dereference()

2015-10-26 Thread Ingo Molnar
* Paul E. McKenney wrote: > From: Patrick Marlier > > The current list_entry_rcu() implementation copies the pointer to a stack > variable, then invokes rcu_dereference_raw() on it. This results in an > additional store-load pair. Now, most compilers will emit normal store > and load instruc

[PATCH tip/core/rcu 11/13] rculist: Make list_entry_rcu() use lockless_dereference()

2015-10-06 Thread Paul E. McKenney
From: Patrick Marlier The current list_entry_rcu() implementation copies the pointer to a stack variable, then invokes rcu_dereference_raw() on it. This results in an additional store-load pair. Now, most compilers will emit normal store and load instructions, which might seem to be of negligib