All of lore.kernel.org
 help / color / mirror / Atom feed
* ios and sectors should be incremented on completion
@ 2014-09-26  9:12 Akira Hayakawa
  2014-10-01  8:26 ` Junichi Nomura
  0 siblings, 1 reply; 3+ messages in thread
From: Akira Hayakawa @ 2014-09-26  9:12 UTC (permalink / raw)
  To: dm-devel@redhat.com

Hi,

I seems DM increments stats (ios and sectors) before completion.
Why don't you do this in dec_pending?
block/stat.txt says these values are incremented when I/O request completes.

Is this to be fixed or do you have some justifications for this behavior?

static void _dm_request(struct request_queue *q, struct bio *bio)
{
	int rw = bio_data_dir(bio);
	struct mapped_device *md = q->queuedata;
	int cpu;
	int srcu_idx;
	struct dm_table *map;

	map = dm_get_live_table(md, &srcu_idx);

	cpu = part_stat_lock();
	part_stat_inc(cpu, &dm_disk(md)->part0, ios[rw]);
	part_stat_add(cpu, &dm_disk(md)->part0, sectors[rw], bio_sectors(bio));
	part_stat_unlock();

-- 
Akira Hayakawa <hayakawa@valinux.co.jp>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: ios and sectors should be incremented on completion
  2014-09-26  9:12 ios and sectors should be incremented on completion Akira Hayakawa
@ 2014-10-01  8:26 ` Junichi Nomura
  2014-10-22  1:55   ` Akira Hayakawa
  0 siblings, 1 reply; 3+ messages in thread
From: Junichi Nomura @ 2014-10-01  8:26 UTC (permalink / raw)
  To: device-mapper development

On 09/26/14 18:12, Akira Hayakawa wrote:
> I seems DM increments stats (ios and sectors) before completion.
> Why don't you do this in dec_pending?
> block/stat.txt says these values are incremented when I/O request completes.
> 
> Is this to be fixed or do you have some justifications for this behavior?

Do you have a problem with the current behavior other than the document?

AFAIR, dm increments ios/sectors at submission because md did.
And other bio-based drivers such as drbd and nvme seem to have followed
the precedence.

While md has a reason to do so (some md personalities just remaps bios
and doesn't track completion), dm should be able to collect stat
in dec_pending as it always clones.

So, I think it's ok to move ios/sectors counting to end_io_acct().
It might make tools like iostat happier.
You might want to fix other bio-based drivers as well.

-- 
Jun'ichi Nomura, NEC Corporation

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: ios and sectors should be incremented on completion
  2014-10-01  8:26 ` Junichi Nomura
@ 2014-10-22  1:55   ` Akira Hayakawa
  0 siblings, 0 replies; 3+ messages in thread
From: Akira Hayakawa @ 2014-10-22  1:55 UTC (permalink / raw)
  To: Junichi Nomura; +Cc: dm-devel@redhat.com

Thanks for information Junichi,

> Do you have a problem with the current behavior other than the document?
No. I and my colleagues just wondered why.

> AFAIR, dm increments ios/sectors at submission because md did.
> And other bio-based drivers such as drbd and nvme seem to have followed
> the precedence.
> 
> While md has a reason to do so (some md personalities just remaps bios
> and doesn't track completion), dm should be able to collect stat
> in dec_pending as it always clones.
Very interesting historical background.
Maybe bache, too.

> So, I think it's ok to move ios/sectors counting to end_io_acct().
> It might make tools like iostat happier.
> You might want to fix other bio-based drivers as well.
I want to hear comments from DM maintainers on this issue.

- Akira

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-10-22  1:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-26  9:12 ios and sectors should be incremented on completion Akira Hayakawa
2014-10-01  8:26 ` Junichi Nomura
2014-10-22  1:55   ` Akira Hayakawa

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.