From: Shaohua Li <shli@kernel.org>
To: NeilBrown <neilb@suse.com>
Cc: linux-raid@vger.kernel.org
Subject: Re: [PATCH v2] md: add block tracing for bio_remapping
Date: Fri, 18 Nov 2016 09:50:05 -0800 [thread overview]
Message-ID: <20161118175005.dodwcprytycwyuyq@kernel.org> (raw)
In-Reply-To: <20161118172622.hzvmtt5rbtmdh7hh@kernel.org>
On Fri, Nov 18, 2016 at 09:26:22AM -0800, Shaohua Li wrote:
> On Fri, Nov 18, 2016 at 01:22:04PM +1100, Neil Brown wrote:
> >
> > The block tracing infrastructure (accessed with blktrace/blkparse)
> > supports the tracing of mapping bios from one device to another.
> > This is currently used when a bio in a partition is mapped to the
> > whole device, when bios are mapped by dm, and for mapping in md/raid5.
> > Other md personalities do not include this tracing yet, so add it.
> >
> > When a read-error is detected we redirect the request to a different device.
> > This could justifiably be seen as a new mapping for the originial bio,
> > or a secondary mapping for the bio that errors. This patch uses
> > the second option.
> >
> > When md is used under dm-raid, the mappings are not traced as we do
> > not have access to the block device number of the parent.
>
> thanks, applied patch 1, 3, 4.
BTW, I added below patch
commit 504634f60f463e73e7d58c6810a04437da942dba
Author: Shaohua Li <shli@fb.com>
Date: Fri Nov 18 09:44:08 2016 -0800
md: add blktrace event for writes to superblock
superblock write is an expensive operation. With raid5-cache, it can be called
regularly. Tracing to help performance debug.
Signed-off-by: Shaohua Li <shli@fb.com>
Cc: NeilBrown <neilb@suse.com>
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 1f1c7f0..d3cef77 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -64,6 +64,7 @@
#include <linux/raid/md_p.h>
#include <linux/raid/md_u.h>
#include <linux/slab.h>
+#include <trace/events/block.h>
#include "md.h"
#include "bitmap.h"
#include "md-cluster.h"
@@ -2403,6 +2404,8 @@ void md_update_sb(struct mddev *mddev, int force_change)
pr_debug("md: updating %s RAID superblock on device (in sync %d)\n",
mdname(mddev), mddev->in_sync);
+ if (mddev->queue)
+ blk_add_trace_msg(mddev->queue, "md md_update_sb");
bitmap_update_sb(mddev->bitmap);
rdev_for_each(rdev, mddev) {
char b[BDEVNAME_SIZE];
next prev parent reply other threads:[~2016-11-18 17:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-18 2:22 [PATCH v2] md: add block tracing for bio_remapping NeilBrown
2016-11-18 17:26 ` Shaohua Li
2016-11-18 17:50 ` Shaohua Li [this message]
2016-11-21 4:00 ` 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=20161118175005.dodwcprytycwyuyq@kernel.org \
--to=shli@kernel.org \
--cc=linux-raid@vger.kernel.org \
--cc=neilb@suse.com \
/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;
as well as URLs for NNTP newsgroup(s).