From mboxrd@z Thu Jan 1 00:00:00 1970 From: Artem Bityutskiy Subject: Re: [PATCHv5 12/15] writeback: optimize periodic bdi thread wakeups Date: Sun, 25 Jul 2010 13:41:09 +0300 Message-ID: <1280054469.9990.16.camel@localhost> References: <1280046581-23623-1-git-send-email-dedekind1@gmail.com> <1280046581-23623-13-git-send-email-dedekind1@gmail.com> Reply-To: dedekind1@gmail.com Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org To: Jens Axboe Return-path: In-Reply-To: <1280046581-23623-13-git-send-email-dedekind1@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Sun, 2010-07-25 at 11:29 +0300, Artem Bityutskiy wrote: > +static void wakeup_timer_fn(unsigned long data) > +{ > + struct backing_dev_info *bdi =3D (struct backing_dev_info *)data; > + > + spin_lock(&bdi->wb_lock); > + if (bdi->wb.task) { > + wake_up_process(bdi->wb.task); > + } else { > + /* > + * When bdi tasks are inactive for long time, they are killed. > + * In this case we have to wake-up the forker thread which > + * should create and run the bdi thread. > + */ > + wake_up_process(default_backing_dev_info.wb.task); > + } > + spin_unlock(&bdi->wb_lock); > +} OK, since now we use this lock in a timer, this should become a spin_lock_bh(). --=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)