From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: MIME-Version: 1.0 References: <20180518130413.16997-1-roman.penyaev@profitbricks.com> <20180518130413.16997-2-roman.penyaev@profitbricks.com> <20180519163735.GX3803@linux.vnet.ibm.com> <20180520004318.GY3803@linux.vnet.ibm.com> In-Reply-To: From: Linus Torvalds Date: Mon, 21 May 2018 08:16:59 -0700 Message-ID: Subject: Re: [PATCH v2 01/26] rculist: introduce list_next_or_null_rr_rcu() To: Roman Pen Cc: Paul McKenney , linux-block , linux-rdma , Jens Axboe , Christoph Hellwig , Sagi Grimberg , Bart Van Assche , Or Gerlitz , Doug Ledford , swapnil.ingle@profitbricks.com, danil.kipnis@profitbricks.com, Jinpu Wang , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" List-ID: On Mon, May 21, 2018 at 6:51 AM Roman Penyaev < roman.penyaev@profitbricks.com> wrote: > No, I continue from the pointer, which I assigned on the previous IO > in order to send IO fairly and keep load balanced. Right. And that's exactly what has both me and Paul nervous. You're no longer in the RCU domain. You're using a pointer where the lifetime has nothing to do with RCU any more. Can it be done? Sure. But you need *other* locking for it (that you haven't explained), and it's fragile as hell. It's probably best to not use RCU for it at all, but depend on that "other locking" that you have to have anyway, to keep the pointer valid over the non-RCU region. Linus