Re: [PATCH v3 01/11] md/raid5: add CONFIG_MD_RAID456_STRIPE_SHIFT to set STRIPE_SIZE
From: Yufen Yu <hidden>
Date: 2020-05-28 06:17:18
On 2020/5/27 21:54, Guoqing Jiang wrote:
Hi, On 5/27/20 3:19 PM, Yufen Yu wrote:quoted
+config MD_RAID456_STRIPE_SHIFT + int "RAID4/RAID5/RAID6 stripe size shift" + default "1" + depends on MD_RAID456 + help + When set the value as 'N', stripe size will be set as 'N << 9', + which is a multiple of 4KB.If 'N << 9', then seems you are convert it to sector, do you actually mean 'N << 12'?quoted
+ + The default value is 1, that means the default stripe size is + 4096(1 << 9). Just setting as a bigger value when PAGE_SIZE is + bigger than 4096. In that case, you can set it as 2(8KB), + 4(16K), 16(64K).So with the above description, the algorithm should be 2 << 12 = 8KB and so on.quoted
+ + When you try to set a big value, likely 16 on arm64 with 64KB + PAGE_SIZE, that means, you know size of each io that issued to + raid device is more than 4096. Otherwise just use default value. + + Normally, using default value can get better performance. + Only change this value if you know what you are doing. + + config MD_MULTIPATH tristate "Multipath I/O support" depends on BLK_DEV_MDdiff --git a/drivers/md/raid5.h b/drivers/md/raid5.h index f90e0704bed9..b25f107dafc7 100644 --- a/drivers/md/raid5.h +++ b/drivers/md/raid5.h@@ -472,7 +472,9 @@ struct disk_info {*/ #define NR_STRIPES 256 -#define STRIPE_SIZE PAGE_SIZE +#define CONFIG_STRIPE_SIZE (CONFIG_MD_RAID456_STRIPE_SHIFT << 9) +#define STRIPE_SIZE \ + (CONFIG_STRIPE_SIZE > PAGE_SIZE ? PAGE_SIZE : CONFIG_STRIPE_SIZE)If I am not misunderstand, you need to s/9/12/ above.
Oh yeah, thanks a lot for catching this. Sorry for this obvious error. It show be 12, then STRIPE_SIZE can be multiple of 4KB, as Liu Song suggested. Thanks, Yufen,