[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [dm-devel] [PATCH] dm-thinp: report correct optimal I/O size

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. 


>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

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

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

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]