Re: [PATCH 44/51] writeback: implement bdi_wait_for_completion()

2015-07-03 Thread Tejun Heo
Hello, On Fri, Jul 03, 2015 at 02:36:42PM +0200, Jan Kara wrote: > Let me phrase my objection this differently: Instead of implementing custom > synchronization mechanism, you could as well do: > > int count_submitted; /* Number of submitted works we want to wait for */ > struct completion done;

Re: [PATCH 44/51] writeback: implement bdi_wait_for_completion()

2015-07-03 Thread Jan Kara
On Wed 01-07-15 23:06:24, Tejun Heo wrote: > Hello, Jan. > > On Wed, Jul 01, 2015 at 06:04:37PM +0200, Jan Kara wrote: > > I'd find it better to extend completions to allow doing what you need. It > > isn't that special. It seems it would be enough to implement > > > > void wait_for_completions(s

Re: [PATCH 44/51] writeback: implement bdi_wait_for_completion()

2015-07-01 Thread Tejun Heo
Hello, Jan. On Wed, Jul 01, 2015 at 06:04:37PM +0200, Jan Kara wrote: > I'd find it better to extend completions to allow doing what you need. It > isn't that special. It seems it would be enough to implement > > void wait_for_completions(struct completion *x, int n); > > where @n is the number

Re: [PATCH 44/51] writeback: implement bdi_wait_for_completion()

2015-07-01 Thread Tejun Heo
On Wed, Jul 01, 2015 at 06:09:18PM +0200, Jan Kara wrote: > > @@ -161,17 +178,34 @@ static void wb_queue_work(struct bdi_writeback *wb, > > trace_writeback_queue(wb->bdi, work); > > > > spin_lock_bh(&wb->work_lock); > > - if (!test_bit(WB_registered, &wb->state)) { > > - if (w

Re: [PATCH 44/51] writeback: implement bdi_wait_for_completion()

2015-07-01 Thread Jan Kara
On Fri 22-05-15 17:13:58, Tejun Heo wrote: > If the completion of a wb_writeback_work can be waited upon by setting > its ->done to a struct completion and waiting on it; however, for > cgroup writeback support, it's necessary to issue multiple work items > to multiple bdi_writebacks and wait for t

Re: [PATCH 44/51] writeback: implement bdi_wait_for_completion()

2015-07-01 Thread Jan Kara
On Fri 22-05-15 17:13:58, Tejun Heo wrote: > If the completion of a wb_writeback_work can be waited upon by setting > its ->done to a struct completion and waiting on it; however, for > cgroup writeback support, it's necessary to issue multiple work items > to multiple bdi_writebacks and wait for t

[PATCH 44/51] writeback: implement bdi_wait_for_completion()

2015-05-22 Thread Tejun Heo
If the completion of a wb_writeback_work can be waited upon by setting its ->done to a struct completion and waiting on it; however, for cgroup writeback support, it's necessary to issue multiple work items to multiple bdi_writebacks and wait for the completion of all. This patch implements wb_com