From mboxrd@z Thu Jan 1 00:00:00 1970 From: Artem Bityutskiy Subject: Re: [PATCHv4 17/17] writeback: lessen sync_supers wakeup count Date: Mon, 31 May 2010 16:03:35 +0300 Message-ID: <1275311015.2678.131.camel@localhost> References: <1274795352-3551-18-git-send-email-dedekind1@gmail.com> <20100527065041.GA31073@ZenIV.linux.org.uk> <20100527072240.GM22536@laptop> <1274957469.13159.20.camel@localhost> <20100527120737.GN22536@laptop> <1274973693.15516.67.camel@localhost> <20100527154435.GS22536@laptop> <1275294352.2678.102.camel@localhost> <20100531083844.GF9453@laptop> <1275296644.2678.122.camel@localhost> <20100531124742.GG9453@laptop> Reply-To: dedekind1@gmail.com Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Al Viro , LKML , Jens Axboe , linux-fsdevel@vger.kernel.org To: Nick Piggin Return-path: Received: from smtp.nokia.com ([192.100.122.230]:36949 "EHLO mgw-mx03.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754219Ab0EaNFv (ORCPT ); Mon, 31 May 2010 09:05:51 -0400 In-Reply-To: <20100531124742.GG9453@laptop> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Mon, 2010-05-31 at 22:47 +1000, Nick Piggin wrote: > > set_current_state(TASK_INTERRUPTIBLE); > > /*=20 > > * XXX: what if we are preempted here. No timer is armed. Our state= is > > * TASK_INTERRUPTIBLE, supers_dirty is 1, so no one will ever wake = us > > * up. Thus, we'll sleep forever. > > */ > > if (supers_dirty) > > bdi_arm_supers_timer(); > > schedule(); > >=20 > > Not sure, but I did quick search and it looks like in preemptive ke= rnel, > > an interrupt may happen in the XXX place above, then it will call > > 'preempt_schedule_irq()', which sill call 'schedule()'. >=20 > Yes, preempt does not participate in tsak sleeping exactly for reason= s > such as this. >=20 > From kernel/sched.c:schedule() >=20 > if (prev->state && !(preempt_count() & PREEMPT_ACTIVE)) { > if (unlikely(signal_pending_state(prev->state, prev))= ) > prev->state =3D TASK_RUNNING; > else > deactivate_task(rq, prev, DEQUEUE_SLEEP); > switch_count =3D &prev->nvcsw; > } >=20 > If the task is not running, then is only removed from the runqueue > (or reset to running in case of pending signal) IFF it has not been > scheduled from an involuntary kernel preemption. >=20 > So in the XXX region, the task will actually be allowed to run again > until it calls schedule(). Clear now, thanks a lot again! --=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