All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joe Thornber <thornber@redhat.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: device-mapper development <dm-devel@redhat.com>, ejt@redhat.com
Subject: Re: [PATCH] dm-thinp: report correct optimal I/O size
Date: Wed, 27 Apr 2011 18:25:25 +0100	[thread overview]
Message-ID: <1303925125.7049.9.camel@ubuntu> (raw)
In-Reply-To: <20110427134150.GA15413@infradead.org>



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

  reply	other threads:[~2011-04-27 17:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-27 13:41 [PATCH] dm-thinp: report correct optimal I/O size Christoph Hellwig
2011-04-27 17:25 ` Joe Thornber [this message]
2011-04-28  8:42   ` Christoph Hellwig
2011-04-28  8:47     ` Joe Thornber
2011-04-28  8:49       ` Christoph Hellwig

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=1303925125.7049.9.camel@ubuntu \
    --to=thornber@redhat.com \
    --cc=dm-devel@redhat.com \
    --cc=ejt@redhat.com \
    --cc=hch@infradead.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 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.