Artem Bityutskiy
6467716a37
writeback: optimize periodic bdi thread wakeups
...
Whe the first inode for a bdi is marked dirty, we wake up the bdi thread which
should take care of the periodic background write-out. However, the write-out
will actually start only 'dirty_writeback_interval' centisecs later, so we can
delay the wake-up.
This change was requested by Nick Piggin who pointed out that if we delay the
wake-up, we weed out 2 unnecessary contex switches, which matters because
'__mark_inode_dirty()' is a hot-path function.
This patch introduces a new function - 'bdi_wakeup_thread_delayed()', which
sets up a timer to wake-up the bdi thread and returns. So the wake-up is
delayed.
We also delete the timer in bdi threads just before writing-back. And
synchronously delete it when unregistering bdi. At the unregister point the bdi
does not have any users, so no one can arm it again.
Since now we take 'bdi->wb_lock' in the timer, which can execute in softirq
context, we have to use 'spin_lock_bh()' for 'bdi->wb_lock'. This patch makes
this change as well.
This patch also moves the 'bdi_wb_init()' function down in the file to avoid
forward-declaration of 'bdi_wakeup_thread_delayed()'.
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com >
Signed-off-by: Jens Axboe <jaxboe@fusionio.com >
2010-08-07 18:53:56 +02:00
..
2010-07-27 14:52:04 -05:00
2010-05-27 22:15:42 -04:00
2010-05-27 22:05:02 -04:00
2010-07-06 08:54:03 +02:00
2010-05-27 09:12:56 -07:00
2010-05-27 09:12:41 -07:00
2010-03-30 22:02:32 +09:00
2010-05-27 22:06:06 -04:00
2010-08-07 18:20:39 +02:00
2010-05-12 18:23:58 -07:00
2010-07-27 13:11:17 -07:00
2010-07-30 18:56:09 -07:00
2010-08-07 18:53:13 +02:00
2010-06-04 17:16:29 -04:00
2009-04-02 19:05:08 -07:00
2010-05-19 22:41:57 -04:00
2010-05-21 18:31:12 -04:00
2010-04-30 14:52:51 -05:00
2010-07-28 19:59:24 -07:00
2009-06-17 00:36:36 -04:00
2010-08-07 18:20:39 +02:00
2009-10-27 19:34:04 -04:00
2010-06-25 01:20:37 +02:00
2010-06-25 01:20:37 +02:00
2010-06-05 11:51:27 -04:00
2010-05-27 22:16:02 -04:00
2010-05-27 09:12:56 -07:00
2010-06-01 13:32:11 -07:00
2010-05-30 09:16:14 -07:00
2010-08-07 18:20:39 +02:00
2010-03-30 22:02:32 +09:00
2010-05-17 05:27:03 +02:00
2010-05-27 22:05:02 -04:00
2010-05-27 22:05:02 -04:00
2010-05-27 22:05:02 -04:00
2010-05-27 22:06:06 -04:00
2010-05-27 09:12:56 -07:00
2010-05-21 19:30:41 +02:00
2010-07-15 15:17:47 -07:00
2010-07-21 09:25:42 -07:00
2010-05-30 09:11:11 -07:00
2010-03-30 22:02:32 +09:00
2010-05-27 22:05:02 -04:00
2010-06-04 17:16:30 -04:00
2010-05-27 22:05:02 -04:00
2010-08-01 15:10:01 -07:00
2010-03-30 22:02:32 +09:00
2010-06-09 12:43:04 -07:00
2010-08-07 18:20:39 +02:00
2009-09-30 09:31:14 -07:00
2010-05-21 18:31:14 -04:00
2010-05-27 22:05:02 -04:00
2010-07-18 10:09:25 -07:00
2010-05-27 22:06:06 -04:00
2009-01-05 11:54:28 -05:00
2010-07-19 09:22:50 +02:00
2010-07-29 15:16:17 -07:00
2010-05-27 22:06:06 -04:00
2010-07-19 14:56:17 +10:00
2010-05-27 22:15:47 -04:00
2010-05-30 09:11:11 -07:00
2010-01-26 22:22:26 -05:00
2010-05-27 22:15:42 -04:00
2010-05-23 08:27:42 +01:00
2010-07-26 12:02:41 -07:00
2010-06-29 15:29:32 -07:00
2010-07-19 14:56:17 +10:00
2010-05-30 09:11:11 -07:00
2010-05-30 09:11:11 -07:00
2010-07-20 09:43:39 +10:00
2010-05-27 22:03:07 -04:00
2010-05-27 22:03:05 -04:00
2010-05-27 22:15:33 -04:00
2010-05-27 22:05:02 -04:00
2010-03-30 22:02:32 +09:00
2010-06-01 08:11:06 -07:00
2010-03-06 11:26:46 -08:00
2010-03-30 22:02:32 +09:00
2010-06-29 15:29:31 -07:00
2009-01-06 15:59:19 -08:00
2010-03-30 22:02:32 +09:00
2010-01-29 08:22:01 -08:00
2010-03-30 22:02:32 +09:00
2010-08-07 18:20:39 +02:00
2010-08-07 18:25:34 +02:00
2010-05-27 22:15:33 -04:00
2009-09-24 07:21:03 -07:00
2010-03-06 11:26:45 -08:00
2010-04-29 08:44:37 -07:00
2010-06-04 15:21:44 -07:00
2010-07-19 14:56:17 +10:00
2009-01-14 14:15:18 +01:00
2010-05-27 22:15:33 -04:00
2010-05-21 18:31:16 -04:00
2010-03-30 22:02:32 +09:00
2010-05-11 17:43:58 +02:00
2010-05-27 09:12:46 -07:00
2010-06-29 15:29:32 -07:00
2010-03-30 22:02:32 +09:00
2010-05-27 22:03:07 -04:00
2010-03-06 11:26:29 -08:00
2010-03-30 22:02:32 +09:00
2009-03-31 23:00:27 -04:00
2010-08-07 18:53:56 +02:00
2010-05-21 18:31:18 -04:00
2010-07-19 14:56:17 +10:00
2010-05-21 18:31:16 -04:00
2010-05-21 18:31:18 -04:00
2010-03-30 22:02:32 +09:00
2010-03-19 09:43:06 -07:00
2009-01-09 16:54:41 -08:00
2010-06-04 17:16:28 -04:00
2010-03-08 16:55:37 +01:00
2010-05-21 18:31:17 -04:00
2010-07-19 14:56:17 +10:00
2010-03-30 22:02:32 +09:00
2010-05-27 22:03:06 -04:00
2010-05-18 08:57:00 +10:00
2010-03-03 13:00:21 -05:00
2010-05-21 18:31:17 -04:00
2010-06-10 19:08:34 +02:00
2010-03-03 13:00:22 -05:00
2010-03-03 14:07:55 -05:00
2010-05-27 09:12:56 -07:00
2009-01-14 14:15:31 +01:00
2010-03-12 15:52:32 -08:00
2010-03-07 15:48:26 -08:00
2010-03-30 22:02:32 +09:00
2010-08-07 18:52:56 +02:00
2009-12-17 10:58:17 -05:00
2009-12-23 13:33:54 +01:00
2010-05-21 18:31:17 -04:00
2010-06-29 10:38:22 -07:00
2010-06-01 12:42:12 +02:00
2010-05-20 13:21:42 -07:00
2009-01-14 14:15:30 +01:00
2010-03-30 22:02:32 +09:00
2010-05-21 18:31:18 -04:00