From: Mikulas Patocka <mpatocka@redhat.com>
To: Mike Snitzer <msnitzer@redhat.com>
Cc: Jens Axboe <axboe@kernel.dk>,
Christoph Hellwig <hch@infradead.org>,
linux-block@vger.kernel.org, dm-devel@redhat.com,
Mikulas Patocka <mpatocka@redhat.com>,
"Alasdair G. Kergon" <agk@redhat.com>
Subject: [PATCH 1/3] dm: move dm_stats_account_io before generic_end_io_acct
Date: Fri, 16 Nov 2018 01:04:17 +0100 [thread overview]
Message-ID: <20181116000506.568964151@debian.vm> (raw)
[-- Attachment #1: dm-stats-ordering.patch --]
[-- Type: text/plain, Size: 1366 bytes --]
Make sure that the statistics are not updated while the device is
suspended. So, we move statistics update before generic_end_io_acct.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
---
drivers/md/dm.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
Index: linux-dm/drivers/md/dm.c
===================================================================
--- linux-dm.orig/drivers/md/dm.c 2018-11-15 21:56:36.000000000 +0100
+++ linux-dm/drivers/md/dm.c 2018-11-15 21:56:36.000000000 +0100
@@ -674,6 +674,11 @@ static void end_io_acct(struct dm_io *io
struct bio *bio = io->orig_bio;
unsigned long duration = jiffies - io->start_time;
+ if (unlikely(dm_stats_used(&md->stats)))
+ dm_stats_account_io(&md->stats, bio_data_dir(bio),
+ bio->bi_iter.bi_sector, bio_sectors(bio),
+ true, duration, &io->stats_aux);
+
/*
* make sure that atomic_dec in generic_end_io_acct is not reordered
* with previous writes
@@ -687,11 +692,6 @@ static void end_io_acct(struct dm_io *io
*/
smp_mb__after_atomic();
- if (unlikely(dm_stats_used(&md->stats)))
- dm_stats_account_io(&md->stats, bio_data_dir(bio),
- bio->bi_iter.bi_sector, bio_sectors(bio),
- true, duration, &io->stats_aux);
-
/* nudge anyone waiting on suspend queue */
if (unlikely(waitqueue_active(&md->wait))) {
if (!md_in_flight(md))
WARNING: multiple messages have this Message-ID (diff)
From: Mikulas Patocka <mpatocka@redhat.com>
To: Mike Snitzer <msnitzer@redhat.com>
Cc: dm-devel@redhat.com, linux-block@vger.kernel.org,
Jens Axboe <axboe@kernel.dk>,
"Alasdair G. Kergon" <agk@redhat.com>,
Christoph Hellwig <hch@infradead.org>,
Mikulas Patocka <mpatocka@redhat.com>
Subject: [PATCH 1/3] dm: move dm_stats_account_io before generic_end_io_acct
Date: Fri, 16 Nov 2018 01:04:17 +0100 [thread overview]
Message-ID: <20181116000506.568964151@debian.vm> (raw)
[-- Attachment #1: dm-stats-ordering.patch --]
[-- Type: text/plain, Size: 1367 bytes --]
Make sure that the statistics are not updated while the device is
suspended. So, we move statistics update before generic_end_io_acct.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
---
drivers/md/dm.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
Index: linux-dm/drivers/md/dm.c
===================================================================
--- linux-dm.orig/drivers/md/dm.c 2018-11-15 21:56:36.000000000 +0100
+++ linux-dm/drivers/md/dm.c 2018-11-15 21:56:36.000000000 +0100
@@ -674,6 +674,11 @@ static void end_io_acct(struct dm_io *io
struct bio *bio = io->orig_bio;
unsigned long duration = jiffies - io->start_time;
+ if (unlikely(dm_stats_used(&md->stats)))
+ dm_stats_account_io(&md->stats, bio_data_dir(bio),
+ bio->bi_iter.bi_sector, bio_sectors(bio),
+ true, duration, &io->stats_aux);
+
/*
* make sure that atomic_dec in generic_end_io_acct is not reordered
* with previous writes
@@ -687,11 +692,6 @@ static void end_io_acct(struct dm_io *io
*/
smp_mb__after_atomic();
- if (unlikely(dm_stats_used(&md->stats)))
- dm_stats_account_io(&md->stats, bio_data_dir(bio),
- bio->bi_iter.bi_sector, bio_sectors(bio),
- true, duration, &io->stats_aux);
-
/* nudge anyone waiting on suspend queue */
if (unlikely(waitqueue_active(&md->wait))) {
if (!md_in_flight(md))
next reply other threads:[~2018-11-16 0:04 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-16 0:04 Mikulas Patocka [this message]
2018-11-16 0:04 ` [PATCH 1/3] dm: move dm_stats_account_io before generic_end_io_acct Mikulas Patocka
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=20181116000506.568964151@debian.vm \
--to=mpatocka@redhat.com \
--cc=agk@redhat.com \
--cc=axboe@kernel.dk \
--cc=dm-devel@redhat.com \
--cc=hch@infradead.org \
--cc=linux-block@vger.kernel.org \
--cc=msnitzer@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.