Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754668AbbGAQJc (ORCPT ); Wed, 1 Jul 2015 12:09:32 -0400 Received: from cantor2.suse.de ([195.135.220.15]:55487 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753609AbbGAQJX (ORCPT ); Wed, 1 Jul 2015 12:09:23 -0400 Date: Wed, 1 Jul 2015 18:09:18 +0200 From: Jan Kara To: Tejun Heo Cc: axboe@kernel.dk, linux-kernel@vger.kernel.org, jack@suse.cz, hch@infradead.org, hannes@cmpxchg.org, linux-fsdevel@vger.kernel.org, vgoyal@redhat.com, lizefan@huawei.com, cgroups@vger.kernel.org, linux-mm@kvack.org, mhocko@suse.cz, clm@fb.com, fengguang.wu@intel.com, david@fromorbit.com, gthelen@google.com, khlebnikov@yandex-team.ru Subject: Re: [PATCH 44/51] writeback: implement bdi_wait_for_completion() Message-ID: <20150701160918.GH7252@quack.suse.cz> References: <1432329245-5844-1-git-send-email-tj@kernel.org> <1432329245-5844-45-git-send-email-tj@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1432329245-5844-45-git-send-email-tj@kernel.org> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1478 Lines: 38 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 the completion of all. > > This patch implements wb_completion which can wait for multiple work > items and replaces the struct completion with it. It can be defined > using DEFINE_WB_COMPLETION_ONSTACK(), used for multiple work items and > waited for by wb_wait_for_completion(). > > Nobody currently issues multiple work items and this patch doesn't > introduce any behavior changes. One more thing... > @@ -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? Honza -- Jan Kara SUSE Labs, CR -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/