From: Miquel van Smoorenburg <mikevs@xs4all.net>
To: Jens Axboe <jens.axboe@oracle.com>
Cc: Greg KH <greg@kroah.com>,
linux-kernel@vger.kernel.org, mikevs@xs4all.net
Subject: Re: disk statistics issue in 2.6.27
Date: Mon, 03 Nov 2008 22:39:12 +0100 [thread overview]
Message-ID: <1225748352.15785.5.camel@localhost.localdomain> (raw)
In-Reply-To: <20081031124743.GH31673@kernel.dk>
On Fri, 2008-10-31 at 13:47 +0100, Jens Axboe wrote:
> On Thu, Oct 23 2008, Miquel van Smoorenburg wrote:
>
> > I added some debug statements to block/blk-core.c, and it appears that
> > blk_end_io() is always called with nr_bytes == 16320 Kbytes (16711680).
> >
> > Ofcourse I should have noticed earlier that iostat -x 2 always prints
> > 32640 as "average request size" (in sectors).
>
> You didn't happen to log a backtrace from that, did you? That's a weird
> nr_bytes, it's 0xff0000.
>
> I'm assuming this then fixes it, just wondering what the heck is going
> on here.
>
> diff --git a/block/blk-core.c b/block/blk-core.c
> index 33c8d4b..a372618 100644
> --- a/block/blk-core.c
> +++ b/block/blk-core.c
> @@ -1712,11 +1710,12 @@ static int __end_that_request_first(struct request *req, int error,
> if (blk_fs_request(req) && req->rq_disk) {
> const int rw = rq_data_dir(req);
> struct hd_struct *part;
> - int cpu;
> + int cpu, sectors;
>
> + sectors = min_t(int, nr_bytes >> 9, req->hard_nr_sectors);
> cpu = part_stat_lock();
> part = disk_map_sector_rcu(req->rq_disk, req->sector);
> - part_stat_add(cpu, part, sectors[rw], nr_bytes >> 9);
> + part_stat_add(cpu, part, sectors[rw], sectors);
> part_stat_unlock();
> }
I didn't try the above patch yet (it might work), but I did find the
cause. I bisected the problem and it was caused by commit
427e59f09fdba387547106de7bab980b7fff77be , something in the scsi layer.
More on linux-scsi (I'll Cc you)
Thanks
Mike.
prev parent reply other threads:[~2008-11-03 21:39 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-19 11:31 disk statistics issue in 2.6.27 Miquel van Smoorenburg
2008-10-20 17:12 ` Jens Axboe
2008-10-22 14:37 ` Miquel van Smoorenburg
2008-10-22 17:17 ` Jens Axboe
2008-10-23 16:05 ` Miquel van Smoorenburg
2008-10-31 12:47 ` Jens Axboe
2008-11-03 21:39 ` Miquel van Smoorenburg [this message]
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=1225748352.15785.5.camel@localhost.localdomain \
--to=mikevs@xs4all.net \
--cc=greg@kroah.com \
--cc=jens.axboe@oracle.com \
--cc=linux-kernel@vger.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