* [PATCH] dm-thinp: report correct optimal I/O size
@ 2011-04-27 13:41 Christoph Hellwig
2011-04-27 17:25 ` Joe Thornber
0 siblings, 1 reply; 5+ messages in thread
From: Christoph Hellwig @ 2011-04-27 13:41 UTC (permalink / raw)
To: device-mapper development; +Cc: ejt
tc->block_shift is the shift to get from a sector to the block_size,
and it doesn't make any sense to apply that to the block size.
Without this I get overflows of the optimal I/O size queue limit
when using large block sizes in dm-thinp.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Index: linux-2.6/drivers/md/dm-thin-prov.c
===================================================================
--- linux-2.6.orig/drivers/md/dm-thin-prov.c 2011-04-27 15:30:22.798345522 +0200
+++ linux-2.6/drivers/md/dm-thin-prov.c 2011-04-27 15:30:49.084869781 +0200
@@ -641,7 +641,7 @@ thinp_io_hints(struct dm_target *ti, str
struct thinp_c *tc = ti->private;
blk_limits_io_min(limits, 0);
- blk_limits_io_opt(limits, tc->block_size << tc->block_shift);
+ blk_limits_io_opt(limits, tc->block_size);
}
static int thinp_iterate_devices(struct dm_target *ti,
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] dm-thinp: report correct optimal I/O size
2011-04-27 13:41 [PATCH] dm-thinp: report correct optimal I/O size Christoph Hellwig
@ 2011-04-27 17:25 ` Joe Thornber
2011-04-28 8:42 ` Christoph Hellwig
0 siblings, 1 reply; 5+ messages in thread
From: Joe Thornber @ 2011-04-27 17:25 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: device-mapper development, ejt
On Wed, 2011-04-27 at 09:41 -0400, Christoph Hellwig wrote:
> tc->block_shift is the shift to get from a sector to the block_size,
> and it doesn't make any sense to apply that to the block size.
> Without this I get overflows of the optimal I/O size queue limit
> when using large block sizes in dm-thinp.
NACK.
From looking at dm-raid and dm-stripe it appears that the
blk_limits_io_opt function is expecting the size to be in bytes, not
sectors.
static void raid_io_hints(struct dm_target *ti, struct queue_limits *limits)
{
struct raid_set *rs = ti->private;
unsigned chunk_size = rs->md.chunk_sectors << 9;
raid5_conf_t *conf = rs->md.private;
blk_limits_io_min(limits, chunk_size);
blk_limits_io_opt(limits, chunk_size * (conf->raid_disks - conf->max_degraded));
}
static void stripe_io_hints(struct dm_target *ti,
struct queue_limits *limits)
{
struct stripe_c *sc = ti->private;
unsigned chunk_size = (sc->chunk_mask + 1) << 9;
blk_limits_io_min(limits, chunk_size);
blk_limits_io_opt(limits, chunk_size * sc->stripes);
}
tc->block_size is in sectors (you are passing sectors on the target
line?).
What's probably happening here is we should be doing:
blk_limits_io_opt(limits, min(<some theoretical max>, tc->block_size << SECTOR_SHIFT));
- Joe
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] dm-thinp: report correct optimal I/O size
2011-04-27 17:25 ` Joe Thornber
@ 2011-04-28 8:42 ` Christoph Hellwig
2011-04-28 8:47 ` Joe Thornber
0 siblings, 1 reply; 5+ messages in thread
From: Christoph Hellwig @ 2011-04-28 8:42 UTC (permalink / raw)
To: device-mapper development; +Cc: ejt
On Wed, Apr 27, 2011 at 06:25:25PM +0100, Joe Thornber wrote:
> tc->block_size is in sectors (you are passing sectors on the target
> line?).
>
> What's probably happening here is we should be doing:
>
> blk_limits_io_opt(limits, min(<some theoretical max>, tc->block_size << SECTOR_SHIFT));
Yes, that should do it. I don't even think we need the max, the optimum
I/O size is a 32-bit value and we'll reach the limit of the possible
block sizes much earlier.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] dm-thinp: report correct optimal I/O size
2011-04-28 8:42 ` Christoph Hellwig
@ 2011-04-28 8:47 ` Joe Thornber
2011-04-28 8:49 ` Christoph Hellwig
0 siblings, 1 reply; 5+ messages in thread
From: Joe Thornber @ 2011-04-28 8:47 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: device-mapper development, ejt
On Thu, 2011-04-28 at 04:42 -0400, Christoph Hellwig wrote:
> On Wed, Apr 27, 2011 at 06:25:25PM +0100, Joe Thornber wrote:
> > tc->block_size is in sectors (you are passing sectors on the target
> > line?).
> >
> > What's probably happening here is we should be doing:
> >
> > blk_limits_io_opt(limits, min(<some theoretical max>, tc->block_size << SECTOR_SHIFT));
>
> Yes, that should do it. I don't even think we need the max, the optimum
> I/O size is a 32-bit value and we'll reach the limit of the possible
> block sizes much earlier.
I'm tempted to just say min(16M, tc->block_size << SECTOR_SHIFT). Does
this sound reasonable to you?
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-04-28 8:49 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-27 13:41 [PATCH] dm-thinp: report correct optimal I/O size Christoph Hellwig
2011-04-27 17:25 ` Joe Thornber
2011-04-28 8:42 ` Christoph Hellwig
2011-04-28 8:47 ` Joe Thornber
2011-04-28 8:49 ` Christoph Hellwig
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.