Re: format 2TB rbd device is too slow

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

 



On Mon, Aug 31, 2015 at 4:21 AM, Ma, Jianpeng <jianpeng.ma@xxxxxxxxx> wrote:
> Ilya
>  I modify kernel code. The patch like this:
> [root@dev linux]# git diff
> diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
> index bc67a93..e4c4ea9 100644
> --- a/drivers/block/rbd.c
> +++ b/drivers/block/rbd.c
> @@ -55,7 +55,7 @@
>   * universally 512 bytes.  These symbols are just slightly more
>   * meaningful than the bare numbers they represent.
>   */
> -#define        SECTOR_SHIFT    9
> +#define        SECTOR_SHIFT    12
>  #define        SECTOR_SIZE     (1ULL << SECTOR_SHIFT)
>
>  /*
> @@ -3811,6 +3811,7 @@ static int rbd_init_disk(struct rbd_device *rbd_dev)
>         blk_queue_io_min(q, segment_size);
>         blk_queue_io_opt(q, segment_size);
>
> +       blk_queue_physical_block_size(q, SECTOR_SIZE);
>         /* enable the discard support */
>         queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, q);
>         q->limits.discard_granularity = segment_size;
>
> I don't know the exact why this can decrease the time.

Well, that's the answer ;)  set_capacity()'s @size is always in 512
byte sectors, and it's called as follows in rbd:

    set_capacity(rbd_dev->disk, rbd_dev->mapping.size / SECTOR_SIZE);

By changing the SECTOR_SIZE from 512 to 4096 (i.e. by a factor of 8)
you just shrink the block device by the same factor.  What used to be
a 2T mapping would now be a 256G mapping, and since the amount of data
mkfs.xfs has to write is proportional to the size of the device, your
7 times decrease in time is easily explained by an 8 times decrease in
size of the mapping.

>
> For the -b of mkfs.xfs, I try for 65536. But it don't change any.

Right.

Thanks,

                Ilya
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux