Skip to content

Commit 6033202

Browse files
Artem BityutskiyJens Axboe
authored andcommitted
writeback: add new tracepoints
Add 2 new trace points to the periodic write-back wake up case, just like we do in the 'bdi_queue_work()' function. Namely, introduce: 1. trace_writeback_wake_thread(bdi) 2. trace_writeback_wake_forker_thread(bdi) The first event is triggered every time we wake up a bdi thread to start periodic background write-out. The second event is triggered only when the bdi thread does not exist and should be created by the forker thread. This patch was suggested by Dave Chinner and Christoph Hellwig. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
1 parent b5048a6 commit 6033202

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

‎include/trace/events/writeback.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ DEFINE_EVENT(writeback_class, name, \
8181
TP_ARGS(bdi))
8282

8383
DEFINE_WRITEBACK_EVENT(writeback_nowork);
84+
DEFINE_WRITEBACK_EVENT(writeback_wake_thread);
85+
DEFINE_WRITEBACK_EVENT(writeback_wake_forker_thread);
8486
DEFINE_WRITEBACK_EVENT(writeback_bdi_register);
8587
DEFINE_WRITEBACK_EVENT(writeback_bdi_unregister);
8688
DEFINE_WRITEBACK_EVENT(writeback_thread_start);

‎mm/backing-dev.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,13 +310,15 @@ static void wakeup_timer_fn(unsigned long data)
310310

311311
spin_lock_bh(&bdi->wb_lock);
312312
if (bdi->wb.task) {
313+
trace_writeback_wake_thread(bdi);
313314
wake_up_process(bdi->wb.task);
314315
} else {
315316
/*
316317
* When bdi tasks are inactive for long time, they are killed.
317318
* In this case we have to wake-up the forker thread which
318319
* should create and run the bdi thread.
319320
*/
321+
trace_writeback_wake_forker_thread(bdi);
320322
wake_up_process(default_backing_dev_info.wb.task);
321323
}
322324
spin_unlock_bh(&bdi->wb_lock);

0 commit comments

Comments
 (0)