Re: [PATCH v2 01/26] rculist: introduce list_next_or_null_rr_rcu()

From: Linus Torvalds
Date: Sat May 19 2018 - 16:01:27 EST


On Sat, May 19, 2018 at 1:21 PM Roman Penyaev <
roman.penyaev@xxxxxxxxxxxxxxxx> wrote:

> I need -rr behaviour for doing IO load-balancing when I choose next RDMA
> connection from the list in order to send a request, i.e. my code is
> something like the following:
[ incomplete pseudoicode ]
> i.e. usage of the @next pointer is under an RCU critical section.

That's not enough. The whole chain to look up the pointer you are taking
'next' of needs to be under RCU, and that's not clear from your example.

It's *probably* the case, but basically you have to prove that the starting
point is still on the same RCU list. That wasn't clear from your example.

The above is (as Paul said) true of list_next_rcu() too, so it's not like
this is anything specific to the 'rr' version.

Linus