linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yufen Yu <yuyufen@huawei.com>
To: Song Liu <song@kernel.org>
Cc: linux-raid <linux-raid@vger.kernel.org>,
	NeilBrown <neilb@suse.com>,
	Guoqing Jiang <guoqing.jiang@cloud.ionos.com>,
	Hou Tao <houtao1@huawei.com>
Subject: Re: [PATCH v6 00/15] md/raid5: set STRIPE_SIZE as a configurable value
Date: Thu, 16 Jul 2020 22:01:55 +0800	[thread overview]
Message-ID: <17e80721-86dc-6be8-5018-222c3b7445a9@huawei.com> (raw)
In-Reply-To: <CAPhsuW4ON3U9GXygpMsTxWGfQr8XH1H8GHn-VPUmOBfOqAEWdw@mail.gmail.com>



On 2020/7/16 15:20, Song Liu wrote:
> On Wed, Jul 15, 2020 at 5:42 AM Yufen Yu <yuyufen@huawei.com> wrote:
>>
>> Hi, all
>>
>>   For now, STRIPE_SIZE is equal to the value of PAGE_SIZE. That means, RAID5
>>   will issue each bio to disk at least 64KB when PAGE_SIZE is 64KB in arm64.
>>   However, filesystem usually issue bio in the unit of 4KB. Then, RAID5 may
>>   waste resource of disk bandwidth.
>>
>>   To solve the problem, this patchset try to set stripe_size as a configuare
>>   value. The default value is 4096. We will add a new sysfs entry and set it
>>   by writing a new value, likely:
>>
>>          echo 16384 > /sys/block/md1/md/stripe_size
> 
> [...]
> 
>> V6:
>>   * Convert stripe_size and stripe_sectors from 'unsigned int' to
>>     'unsigned long' avoiding compiler warning.
>>   * Add a new member of stripes_per_page into r5conf, avoiding to
>>     compute each time.
>>   * Cover mddev->private with mddev_lock(mddev) for raid5_store/show_stripe_size().
>>   * Get rid of too many WARN_ON() and BUG_ON().
>>   * Unfold raid5_get_page_index() into raid5_get_dev_page() directly.
> 
> We are running out of time before the upcoming merge window, so we may not
> be able to ship the whole set. How about we ship 01, and 11 in this
> merge window,
> and the rest in the next merge window? Would the array get most of the
> performance benefit with these 2 patches? Do you see other issues with
> this path?
> 

This patchset includes two optimization, dynamically adjust stripe_size to improve
raid array performance and save memory used by stripe_head. If you think we may not
be able to ship the the whole set, I think just ship the first optimization (patch 01
and patch 11) can get better performance.

I will send the first optimization with adopting your suggestion as soon as possible.
Thanks a lot for your review.

Thanks,
Yufen

> Also I would like to minimize changes for PAGE_SIZE==4096 systems. Ideally,
> we can hide these changes from these system in ifdef's, like:
> 
> #if PAGE_SIZE == DEFAULT_STRIPE_SIZE
> #define STRIPE_SIZE            PAGE_SIZE
> #define STRIPE_SHIFT           (PAGE_SHIFT - 9)
> #define STRIPE_SECTORS         (STRIPE_SIZE>>9)
> #endif
> 
> #if PAGE_SIZE != DEFAULT_STRIPE_SIZE
> unsigned long           stripe_size;
> unsigned int            stripe_shift;
> unsigned long           stripe_sectors;
> #endif
> 
> #if PAGE_SIZE != DEFAULT_STRIPE_SIZE
> #define RAID5_STRIPE_SIZE(conf) DEFAULT_STRIPE_SIZE
> #else
> #define RAID5_STRIPE_SIZE(conf) ((conf)->stripe_size)
> #endif
> 
> And then use RAID5_STRIPE_SIZE(conf) in the rest of the code.
> 
> Thanks,
> Song
> .
> 

      reply	other threads:[~2020-07-16 14:01 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-15 12:42 [PATCH v6 00/15] md/raid5: set STRIPE_SIZE as a configurable value Yufen Yu
2020-07-15 12:42 ` [PATCH v6 01/15] md/raid456: convert macro STRIPE_* to members of struct r5conf Yufen Yu
2020-07-15 12:42 ` [PATCH v6 02/15] md/raid5: set default stripe_size as 4096 Yufen Yu
2020-07-15 12:42 ` [PATCH v6 03/15] md/raid5: add a member of r5pages for struct stripe_head Yufen Yu
2020-07-15 12:42 ` [PATCH v6 04/15] md/raid5: allocate and free shared pages of r5pages Yufen Yu
2020-07-15 12:42 ` [PATCH v6 05/15] md/raid5: set correct page offset for bi_io_vec in ops_run_io() Yufen Yu
2020-07-15 12:42 ` [PATCH v6 06/15] md/raid5: set correct page offset for async_copy_data() Yufen Yu
2020-07-15 12:42 ` [PATCH v6 07/15] md/raid5: resize stripes and set correct offset when reshape array Yufen Yu
2020-07-15 12:42 ` [PATCH v6 08/15] md/raid5: add new xor function to support different page offset Yufen Yu
2020-07-15 12:42 ` [PATCH v6 09/15] md/raid5: add offset array in scribble buffer Yufen Yu
2020-07-15 12:42 ` [PATCH v6 10/15] md/raid5: compute xor with correct page offset Yufen Yu
2020-07-15 12:42 ` [PATCH v6 11/15] md/raid5: support config stripe_size by sysfs entry Yufen Yu
2020-07-16  7:06   ` Song Liu
2020-07-15 12:42 ` [PATCH v6 12/15] md/raid6: let syndrome computor support different page offset Yufen Yu
2020-07-15 12:42 ` [PATCH v6 13/15] md/raid6: let async recovery function " Yufen Yu
2020-07-15 12:42 ` [PATCH v6 14/15] md/raid6: compute syndrome with correct " Yufen Yu
2020-07-15 12:42 ` [PATCH v6 15/15] raid6test: adaptation with syndrome function Yufen Yu
2020-07-16  7:20 ` [PATCH v6 00/15] md/raid5: set STRIPE_SIZE as a configurable value Song Liu
2020-07-16 14:01   ` Yufen Yu [this message]

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=17e80721-86dc-6be8-5018-222c3b7445a9@huawei.com \
    --to=yuyufen@huawei.com \
    --cc=guoqing.jiang@cloud.ionos.com \
    --cc=houtao1@huawei.com \
    --cc=linux-raid@vger.kernel.org \
    --cc=neilb@suse.com \
    --cc=song@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).