From mboxrd@z Thu Jan 1 00:00:00 1970 From: Artem Bityutskiy Subject: Re: [RFC][PATCH 14/16] writeback: move bdi threads exiting logic to the forker thread Date: Tue, 20 Jul 2010 15:23:19 +0300 Message-ID: <1279628599.16462.120.camel@localhost> References: <1279284312-2411-1-git-send-email-dedekind1@gmail.com> <1279284312-2411-15-git-send-email-dedekind1@gmail.com> <20100718070231.GK23811@infradead.org> Reply-To: dedekind1@gmail.com Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Jens Axboe , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org To: Christoph Hellwig Return-path: In-Reply-To: <20100718070231.GK23811@infradead.org> Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Sun, 2010-07-18 at 03:02 -0400, Christoph Hellwig wrote: > > + if (wakeup_default) { > > trace_writeback_nothread(bdi, work); > > wake_up_process(default_backing_dev_info.wb.task); >=20 > Why not simply do the defaul thread wakeup under wb_lock, too? > It keeps the code a lot simpler, and this is not a typical path anywa= y. Will address. > > if (dirty_writeback_interval) { > > + unsigned long wait_jiffies; > > + > > wait_jiffies =3D msecs_to_jiffies(dirty_writeback_interval * 10= ); > > schedule_timeout(wait_jiffies); >=20 > No real need for a local variable here. Will address. > > @@ -364,7 +395,7 @@ static int bdi_forker_thread(void *ptr) > > if (!list_empty(&me->bdi->work_list)) > > __set_current_state(TASK_RUNNING); > > =20 > > - if (!fork) { > > + if (!fork && !kill) { >=20 > I think the code here would be a lot cleaner if you implement the > suggestion I have for the forking restructuring. As I replied earlier, to fork/kill the the thread from inside list walk we'd need to drop the spinlock, which is not very nice. So I am keeping this part intact so far. --=20 Best Regards, Artem Bityutskiy (=D0=90=D1=80=D1=82=D1=91=D0=BC =D0=91=D0=B8=D1=82=D1=8E= =D1=86=D0=BA=D0=B8=D0=B9)