Re: [PATCH 7/7] RCU, workqueue: Implement rcu_work

2018-03-09 Thread Tejun Heo
Hello, On Thu, Mar 08, 2018 at 08:29:53AM +0800, Lai Jiangshan wrote: > I mentioned a subtle use case that user would think it is supported > since the comment doesn't disallow it. > > It is clear that the user expects >the work must be called at least once after the API returns >the

Re: [PATCH 7/7] RCU, workqueue: Implement rcu_work

2018-03-09 Thread Tejun Heo
Hello, On Thu, Mar 08, 2018 at 08:29:53AM +0800, Lai Jiangshan wrote: > I mentioned a subtle use case that user would think it is supported > since the comment doesn't disallow it. > > It is clear that the user expects >the work must be called at least once after the API returns >the

Re: [PATCH 7/7] RCU, workqueue: Implement rcu_work

2018-03-09 Thread Tejun Heo
Hello, Linus. On Tue, Mar 06, 2018 at 10:30:29AM -0800, Linus Torvalds wrote: > - can we split this patch up, so that if somebody bisects a problem > to it, we'll see if it's cgroup or aio that triggers it? Will do. > So I'd like to either just make the thing always just use >

Re: [PATCH 7/7] RCU, workqueue: Implement rcu_work

2018-03-09 Thread Tejun Heo
Hello, Linus. On Tue, Mar 06, 2018 at 10:30:29AM -0800, Linus Torvalds wrote: > - can we split this patch up, so that if somebody bisects a problem > to it, we'll see if it's cgroup or aio that triggers it? Will do. > So I'd like to either just make the thing always just use >

Re: [PATCH 7/7] RCU, workqueue: Implement rcu_work

2018-03-08 Thread Paul E. McKenney
On Thu, Mar 08, 2018 at 08:29:53AM +0800, Lai Jiangshan wrote: > On Wed, Mar 7, 2018 at 10:54 PM, Paul E. McKenney > wrote: > > On Wed, Mar 07, 2018 at 10:49:49AM +0800, Lai Jiangshan wrote: > >> On Wed, Mar 7, 2018 at 1:33 AM, Tejun Heo wrote: > >> >

Re: [PATCH 7/7] RCU, workqueue: Implement rcu_work

2018-03-08 Thread Paul E. McKenney
On Thu, Mar 08, 2018 at 08:29:53AM +0800, Lai Jiangshan wrote: > On Wed, Mar 7, 2018 at 10:54 PM, Paul E. McKenney > wrote: > > On Wed, Mar 07, 2018 at 10:49:49AM +0800, Lai Jiangshan wrote: > >> On Wed, Mar 7, 2018 at 1:33 AM, Tejun Heo wrote: > >> > >> > +/** > >> > + * queue_rcu_work_on -

Re: [PATCH 7/7] RCU, workqueue: Implement rcu_work

2018-03-07 Thread Lai Jiangshan
On Wed, Mar 7, 2018 at 10:54 PM, Paul E. McKenney wrote: > On Wed, Mar 07, 2018 at 10:49:49AM +0800, Lai Jiangshan wrote: >> On Wed, Mar 7, 2018 at 1:33 AM, Tejun Heo wrote: >> >> > +/** >> > + * queue_rcu_work_on - queue work on specific CPU after a

Re: [PATCH 7/7] RCU, workqueue: Implement rcu_work

2018-03-07 Thread Lai Jiangshan
On Wed, Mar 7, 2018 at 10:54 PM, Paul E. McKenney wrote: > On Wed, Mar 07, 2018 at 10:49:49AM +0800, Lai Jiangshan wrote: >> On Wed, Mar 7, 2018 at 1:33 AM, Tejun Heo wrote: >> >> > +/** >> > + * queue_rcu_work_on - queue work on specific CPU after a RCU grace period >> > + * @cpu: CPU number to

Re: [PATCH 7/7] RCU, workqueue: Implement rcu_work

2018-03-07 Thread Paul E. McKenney
On Wed, Mar 07, 2018 at 05:23:17PM +0100, Peter Zijlstra wrote: > On Wed, Mar 07, 2018 at 06:54:08AM -0800, Paul E. McKenney wrote: > > One downside of allowing RCU callback functions to sleep is that > > one poorly written callback can block a bunch of other ones. > > Not to mention that we

Re: [PATCH 7/7] RCU, workqueue: Implement rcu_work

2018-03-07 Thread Paul E. McKenney
On Wed, Mar 07, 2018 at 05:23:17PM +0100, Peter Zijlstra wrote: > On Wed, Mar 07, 2018 at 06:54:08AM -0800, Paul E. McKenney wrote: > > One downside of allowing RCU callback functions to sleep is that > > one poorly written callback can block a bunch of other ones. > > Not to mention that we

Re: [PATCH 7/7] RCU, workqueue: Implement rcu_work

2018-03-07 Thread Peter Zijlstra
On Wed, Mar 07, 2018 at 06:54:08AM -0800, Paul E. McKenney wrote: > One downside of allowing RCU callback functions to sleep is that > one poorly written callback can block a bunch of other ones. Not to mention that we really want the RCU callbacks to be simple and short. Needing fancy things in

Re: [PATCH 7/7] RCU, workqueue: Implement rcu_work

2018-03-07 Thread Peter Zijlstra
On Wed, Mar 07, 2018 at 06:54:08AM -0800, Paul E. McKenney wrote: > One downside of allowing RCU callback functions to sleep is that > one poorly written callback can block a bunch of other ones. Not to mention that we really want the RCU callbacks to be simple and short. Needing fancy things in

Re: [PATCH 7/7] RCU, workqueue: Implement rcu_work

2018-03-07 Thread Paul E. McKenney
On Wed, Mar 07, 2018 at 10:49:49AM +0800, Lai Jiangshan wrote: > On Wed, Mar 7, 2018 at 1:33 AM, Tejun Heo wrote: > > > +/** > > + * queue_rcu_work_on - queue work on specific CPU after a RCU grace period > > + * @cpu: CPU number to execute work on > > + * @wq: workqueue to use

Re: [PATCH 7/7] RCU, workqueue: Implement rcu_work

2018-03-07 Thread Paul E. McKenney
On Wed, Mar 07, 2018 at 10:49:49AM +0800, Lai Jiangshan wrote: > On Wed, Mar 7, 2018 at 1:33 AM, Tejun Heo wrote: > > > +/** > > + * queue_rcu_work_on - queue work on specific CPU after a RCU grace period > > + * @cpu: CPU number to execute work on > > + * @wq: workqueue to use > > + * @rwork:

Re: [PATCH 7/7] RCU, workqueue: Implement rcu_work

2018-03-06 Thread Lai Jiangshan
On Wed, Mar 7, 2018 at 1:33 AM, Tejun Heo wrote: > +/** > + * queue_rcu_work_on - queue work on specific CPU after a RCU grace period > + * @cpu: CPU number to execute work on > + * @wq: workqueue to use > + * @rwork: work to queue For many people, "RCU grace period" is clear

Re: [PATCH 7/7] RCU, workqueue: Implement rcu_work

2018-03-06 Thread Lai Jiangshan
On Wed, Mar 7, 2018 at 1:33 AM, Tejun Heo wrote: > +/** > + * queue_rcu_work_on - queue work on specific CPU after a RCU grace period > + * @cpu: CPU number to execute work on > + * @wq: workqueue to use > + * @rwork: work to queue For many people, "RCU grace period" is clear enough, but not

Re: [PATCH 7/7] RCU, workqueue: Implement rcu_work

2018-03-06 Thread Linus Torvalds
On Tue, Mar 6, 2018 at 9:33 AM, Tejun Heo wrote: > > This patch introduces rcu_work, a workqueue work variant which gets > executed after a RCU grace period, and converts the open coded > bouncing in fs/aio and kernel/cgroup. So I like the concept, but I have two comments: -

Re: [PATCH 7/7] RCU, workqueue: Implement rcu_work

2018-03-06 Thread Linus Torvalds
On Tue, Mar 6, 2018 at 9:33 AM, Tejun Heo wrote: > > This patch introduces rcu_work, a workqueue work variant which gets > executed after a RCU grace period, and converts the open coded > bouncing in fs/aio and kernel/cgroup. So I like the concept, but I have two comments: - can we split this

[PATCH 7/7] RCU, workqueue: Implement rcu_work

2018-03-06 Thread Tejun Heo
There are cases where RCU callback needs to be bounced to a sleepable context. This is currently done by the RCU callback queueing a work item, which can be cumbersome to write and confusing to read. This patch introduces rcu_work, a workqueue work variant which gets executed after a RCU grace

[PATCH 7/7] RCU, workqueue: Implement rcu_work

2018-03-06 Thread Tejun Heo
There are cases where RCU callback needs to be bounced to a sleepable context. This is currently done by the RCU callback queueing a work item, which can be cumbersome to write and confusing to read. This patch introduces rcu_work, a workqueue work variant which gets executed after a RCU grace