From mboxrd@z Thu Jan 1 00:00:00 1970 From: Artem Bityutskiy Subject: Re: [PATCHv2 11/11] writeback: prevent unnecessary bdi threads wakeups Date: Thu, 22 Jul 2010 16:27:00 +0300 Message-ID: <1279805220.3044.56.camel@localhost> References: <1279704706-1267-1-git-send-email-dedekind1@gmail.com> <1279704706-1267-12-git-send-email-dedekind1@gmail.com> <1279712741.2306.36.camel@localhost> <20100722004155.GZ32635@dastard> <20100722090023.GA7692@infradead.org> Reply-To: dedekind1@gmail.com Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Dave Chinner , Dave Chinner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Jens Axboe To: Christoph Hellwig Return-path: Received: from smtp.nokia.com ([192.100.105.134]:50347 "EHLO mgw-mx09.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759370Ab0GVNec (ORCPT ); Thu, 22 Jul 2010 09:34:32 -0400 In-Reply-To: <20100722090023.GA7692@infradead.org> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Thu, 2010-07-22 at 05:00 -0400, Christoph Hellwig wrote: > On Thu, Jul 22, 2010 at 10:41:55AM +1000, Dave Chinner wrote: > > if (wakeup_bdi) { > > trace_writeback_wakeup(bdi) > > spin_lock(&bdi->wb_lock); > > if (!bdi->wb.task) {{ > > trace_writeback_wakeup_nothread(bdi); > > wake_up_process(default_backing_dev_info.wb.task); > > } else > > wake_up_process(bdi->wb.task); > > spin_unlock(&bdi->wb_lock); >=20 > That gives us duplicate traces for the first case, what about: >=20 > if (wakeup_bdi) { > spin_lock(&bdi->wb_lock); > if (bdi->wb.task) { > trace_writeback_wake_thread(bdi); > wake_up_process(bdi->wb.task); > } else { > trace_writeback_wake_forker_thread(bdi); > wake_up_process(default_backing_dev_info.wb.task); > } > spin_unlock(&bdi->wb_lock); > } But Dave's version is what we have in 'bdi_queue_work()' as well. I it is OK - first trace point is triggered every time the bdi thread is _wanted_ to be woken up. Then if it does not exist, we need to do something special to wake it u= p (ask the forker thread which to create it). This is a different event and we use a different trace point. --=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) -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel= " in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html