From mboxrd@z Thu Jan 1 00:00:00 1970 From: Artem Bityutskiy Subject: Re: [PATCH 02/10] writeback: switch to per-bdi threads for flushing data Date: Wed, 08 Jul 2009 07:47:36 +0300 Message-ID: <4A5424E8.1070201@gmail.com> References: <1245926523-21959-1-git-send-email-jens.axboe@oracle.com> <1245926523-21959-3-git-send-email-jens.axboe@oracle.com> <4A53694D.2010905@gmail.com> <1247014636.2560.539.camel@ymzhang> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Jens Axboe , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, chris.mason@oracle.com, david@fromorbit.com, hch@infradead.org, akpm@linux-foundation.org, jack@suse.cz, richard@rsk.demon.co.uk, damien.wyart@free.fr, fweisbec@gmail.com, Alan.Brunelle@hp.com To: "Zhang, Yanmin" Return-path: Received: from smtp.nokia.com ([192.100.122.230]:32953 "EHLO mgw-mx03.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750871AbZGHEsV (ORCPT ); Wed, 8 Jul 2009 00:48:21 -0400 In-Reply-To: <1247014636.2560.539.camel@ymzhang> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Zhang, Yanmin wrote: >>> + list_for_each_entry_safe(bdi, tmp, &bdi_list, bdi_list) { >>> + if (bdi->task || !bdi_has_dirty_io(bdi)) >>> + continue; >>> + >>> + bdi_add_default_flusher_task(bdi); >>> + } >>> + >>> + set_current_state(TASK_INTERRUPTIBLE); >>> + >> What happens if we are preempted here? Since we have TASK_INTERRUPTI= BLE >> state, we will not come back unless some other task wakes us up. Who >> would wake us up in this case? > If it's preempted (CONFIG_PREEMPT=3Dy), it will stay in runqueue. Onl= y when > it calls schedule initiatively or calls schedule when exiting to user= space, > it will be moved out of runqueue if its state isn't TASK_RUNNING. >=20 > See flag PREEMPT_ACTIVE. OK, thanks for the hint! --=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