From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: MIME-Version: 1.0 In-Reply-To: References: <20180518130413.16997-1-roman.penyaev@profitbricks.com> <20180518130413.16997-2-roman.penyaev@profitbricks.com> From: Roman Penyaev Date: Sat, 19 May 2018 22:25:24 +0200 Message-ID: Subject: Re: [PATCH v2 01/26] rculist: introduce list_next_or_null_rr_rcu() To: Linus Torvalds Cc: linux-block , linux-rdma , Jens Axboe , Christoph Hellwig , Sagi Grimberg , Bart Van Assche , Or Gerlitz , Doug Ledford , "swapnil.ingle" , Danil Kipnis , Jinpu Wang , Paul McKenney , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" List-ID: On Fri, May 18, 2018 at 6:56 PM, Linus Torvalds wrote: > On Fri, May 18, 2018 at 6:07 AM Roman Pen > wrote: > >> Function is going to be used in transport over RDMA module >> in subsequent patches. > > Does this really merit its own helper macro in a generic header? > > It honestly smells more like "just have an inline helper function that is > specific to rdma" to me. Particularly since it's probably just one specific > list where you want this oddly specific behavior. > > Also, if we really want a round-robin list traversal macro, this isn't the > way it should be implemented, I suspect, and it probably shouldn't be > RCU-specific to begin with. Hi Linus, Another one list_for_each_entry_rcu()-like macro I am aware of is used in block/blk-mq-sched.c, is called list_for_each_entry_rcu_rr(): https://elixir.bootlin.com/linux/v4.17-rc5/source/block/blk-mq-sched.c#L370 Can we do something generic with -rr semantics to cover both cases? -- Roman > > Side note: I notice that I should already have been more critical of even > the much simpler "list_next_or_null_rcu()" macro. The "documentation" > comment above the macro is pure and utter cut-and-paste garbage. > > Paul, mind giving this a look? > > Linus