Re: [PATCH 1/1] Add check for dirty_writeback_interval inbdi_wakeup_thread_delayed

From: Raghavendra D Prabhu
Date: Wed Apr 20 2011 - 15:18:09 EST


* On Mon, Apr 18, 2011 at 03:26:29PM +0300, Artem Bityutskiy <Artem.Bityutskiy@xxxxxxxxx> wrote:
On Mon, 2011-04-18 at 14:46 +0530, Raghavendra D Prabhu wrote:
I have set it to 500 centisecs as that is the default value of
dirty_writeback_interval. I used this logic for following reason: the
purpose for which dirty_writeback_interval is set to 0 is to disable
periodic writeback
(http://tomoyo.sourceforge.jp/cgi-bin/lxr/source/fs/fs-writeback.c#L818)
, whereas here (in bdi_wakeup_thread_delayed) it is being used for a
different purpose -- to delay the bdi wakeup in order to reduce context
switches for dirty inode writeback.

But why it wakes up the bdi thread? Exactly to make sure the periodic
write-back happen.
I checked the callgraph of bdi_wakeup_thread_delayed and found out that
even though it may be called in the aftermath of wb_do_writeback(), it
is certainly called in the call-chain of sync. So effectively making
that function do nothing when dirty_writeback_interval is unset will
also make sync do nothing. On the other hand, not applying the original
change at all will make it run instantly (jiffies + 0, 0 being the
writeback interval in this case ) thus reversing the benefits of
d7dd01adc098eadc5d5fb07a7d2bf942d09b15df.

Attachment: pgp00000.pgp
Description: PGP signature