From: NeilBrown <neilb@suse.com>
To: Shaohua Li <shli@kernel.org>
Cc: linux-raid@vger.kernel.org
Subject: [md PATCH 3/4] md/bitmap: add blktrace event for writes to the bitmap.
Date: Mon, 14 Nov 2016 16:30:21 +1100 [thread overview]
Message-ID: <147910142125.27168.1639109067364223445.stgit@noble> (raw)
In-Reply-To: <147910131504.27168.6566119701315109161.stgit@noble>
We trace wheneven bitmap_unplug() finds that it needs to write
to the bitmap, or when bitmap_daemon_work() find there is work
to do.
This makes it easier to correlate bitmap updates with data writes.
Signed-off-by: NeilBrown <neilb@suse.com>
---
drivers/md/bitmap.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c
index 1a7f402b79ba..cf77cbf9ed22 100644
--- a/drivers/md/bitmap.c
+++ b/drivers/md/bitmap.c
@@ -27,6 +27,7 @@
#include <linux/mount.h>
#include <linux/buffer_head.h>
#include <linux/seq_file.h>
+#include <trace/events/block.h>
#include "md.h"
#include "bitmap.h"
@@ -1008,8 +1009,12 @@ void bitmap_unplug(struct bitmap *bitmap)
need_write = test_and_clear_page_attr(bitmap, i,
BITMAP_PAGE_NEEDWRITE);
if (dirty || need_write) {
- if (!writing)
+ if (!writing) {
bitmap_wait_writes(bitmap);
+ if (bitmap->mddev->queue)
+ blk_add_trace_msg(bitmap->mddev->queue,
+ "md bitmap_unplug");
+ }
clear_page_attr(bitmap, i, BITMAP_PAGE_PENDING);
write_page(bitmap, bitmap->storage.filemap[i], 0);
writing = 1;
@@ -1234,6 +1239,10 @@ void bitmap_daemon_work(struct mddev *mddev)
}
bitmap->allclean = 1;
+ if (bitmap->mddev->queue)
+ blk_add_trace_msg(bitmap->mddev->queue,
+ "md bitmap_daemon_work");
+
/* Any file-page which is PENDING now needs to be written.
* So set NEEDWRITE now, then after we make any last-minute changes
* we will write it.
next prev parent reply other threads:[~2016-11-14 5:30 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-14 5:30 [md PATCH 0/4] Improve blktrace tracing of md NeilBrown
2016-11-14 5:30 ` [md PATCH 1/4] md: add block tracing for bio_remapping NeilBrown
2016-11-16 19:29 ` Shaohua Li
2016-11-17 5:33 ` NeilBrown
2016-11-17 18:04 ` Shaohua Li
2016-11-18 0:45 ` NeilBrown
2016-11-14 5:30 ` [md PATCH 2/4] md: add bio completion tracing for raid1/raid10 NeilBrown
2016-11-16 14:32 ` Christoph Hellwig
2016-11-17 5:35 ` NeilBrown
2016-11-17 12:51 ` Christoph Hellwig
2016-11-14 5:30 ` NeilBrown [this message]
2016-11-16 19:31 ` [md PATCH 3/4] md/bitmap: add blktrace event for writes to the bitmap Shaohua Li
2016-11-14 5:30 ` [md PATCH 4/4] md/raid1, raid10: add blktrace records when IO is delayed NeilBrown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=147910142125.27168.1639109067364223445.stgit@noble \
--to=neilb@suse.com \
--cc=linux-raid@vger.kernel.org \
--cc=shli@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox