From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tejun Heo Subject: Re: [PATCH 44/51] writeback: implement bdi_wait_for_completion() Date: Wed, 1 Jul 2015 23:01:50 -0400 Message-ID: <20150702030150.GL26440@mtj.duckdns.org> References: <1432329245-5844-1-git-send-email-tj@kernel.org> <1432329245-5844-45-git-send-email-tj@kernel.org> <20150701160918.GH7252@quack.suse.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: axboe-tSWWG44O7X1aa/9Udqfwiw@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, hch-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org, hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org, linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, vgoyal-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org, lizefan-hv44wF8Li93QT0dZR+AlfA@public.gmane.org, cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org, mhocko-AlSwsSmVLrQ@public.gmane.org, clm-b10kYP2dOMg@public.gmane.org, fengguang.wu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org, david-FqsqvQoI3Ljby3iVrkZq2A@public.gmane.org, gthelen-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org, khlebnikov-XoJtRXgx1JseBXzfvpsJ4g@public.gmane.org To: Jan Kara Return-path: Content-Disposition: inline In-Reply-To: <20150701160918.GH7252-+0h/O2h83AeN3ZZ/Hiejyg@public.gmane.org> Sender: cgroups-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: linux-fsdevel.vger.kernel.org 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 (work->done) > > - complete(work->done); > > + if (!test_bit(WB_registered, &wb->state)) > > goto out_unlock; > > This seems like a change in behavior. Previously unregistered wbs just > completed the work->done, now you don't complete them. Is that intentional? If nothing is queued, the cnt is never increased and the wait becomes noop. The default states are different between completion and wb_completion. There's no need to do anything to indicate that nothing needs to be waited. Thanks. -- tejun