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. For the -b of mkfs.xfs, I try for 65536. But it don't change any. Thanks! > -----Original Message----- > From: Ilya Dryomov [mailto:idryomov@xxxxxxxxx] > Sent: Friday, August 28, 2015 5:23 PM > To: Ma, Jianpeng > Cc: huang jun; Haomai Wang; ceph-devel > Subject: Re: format 2TB rbd device is too slow > > On Fri, Aug 28, 2015 at 10:36 AM, Ma, Jianpeng <jianpeng.ma@xxxxxxxxx> > wrote: > > Hi Ilya, > > We can change sector size from 512 to 4096. This can reduce the count > of write. > > I did a simple test: for 900G, mkfs.xfs -f For default: 1m10s Physical > > sector size = 4096: 0m10s. > > > > But if change sector size, we need rbd meta record this. > > What exactly do you mean by changing the sector size? xfs sector size or > physical block size of the rbd device? If the latter, meaning mkfs.xfs -s size > 4096, I fail to see how it can result in the above numbers. If the former, you > have to patch the kernel and I fail to see how it can result in such an > improvement too. I probably didn't have enough coffee, please elaborate. > > Thanks, > > Ilya ��.n��������+%������w��{.n����z��u���ܨ}���Ơz�j:+v�����w����ޙ��&�)ߡ�a����z�ޗ���ݢj��w�f