diff options
author | Yufen Yu <yuyufen@huawei.com> | 2020-08-20 15:22:12 +0200 |
---|---|---|
committer | Song Liu <songliubraving@fb.com> | 2020-09-25 01:44:44 +0200 |
commit | 046169f048cdea84fd327469239e2dfa317981b5 (patch) | |
tree | 7b83d9a3f31c6f5d4cc2ef646e5c6545c75bc020 /scripts/mkuboot.sh | |
parent | md/raid6: let async recovery function support different page offset (diff) | |
download | linux-046169f048cdea84fd327469239e2dfa317981b5.tar.xz linux-046169f048cdea84fd327469239e2dfa317981b5.zip |
md/raid5: let multiple devices of stripe_head share page
In current implementation, grow_buffers() uses alloc_page() to
allocate the buffers for each stripe_head, i.e. allocate a page
for each dev[i] in stripe_head.
After setting stripe_size as a configurable value by writing
sysfs entry, it means that we always allocate 64K buffers, but
just use 4K of them when stripe_size is 4K in 64KB arm64.
To avoid wasting memory, we try to let multiple sh->dev share
one real page. That means, multiple sh->dev[i].page will point
to the only page with different offset. Example of 64K PAGE_SIZE
and 4K stripe_size as following:
64K PAGE_SIZE
+---+---+---+---+------------------------------+
| | | | |
| | | | |
+-+-+-+-+-+-+-+-+------------------------------+
^ ^ ^ ^
| | | +----------------------------+
| | | |
| | +-------------------+ |
| | | |
| +----------+ | |
| | | |
+-+ | | |
| | | |
+-----+-----+------+-----+------+-----+------+------+
sh | offset(0) | offset(4K) | offset(8K) | offset(12K) |
+ +-----------+------------+------------+-------------+
+----> dev[0].page dev[1].page dev[2].page dev[3].page
A new 'pages' array will be added into stripe_head to record shared
page used by this stripe_head. Allocate them when grow_buffers()
and free them when shrink_buffers().
After trying to share page, the users of sh->dev[i].page need to take
care of the related page offset: page of issued bio and page passed
to xor compution functions. But thanks for previous different page offset
supported. Here, we just need to set correct dev[i].offset.
Signed-off-by: Yufen Yu <yuyufen@huawei.com>
Signed-off-by: Song Liu <songliubraving@fb.com>
Diffstat (limited to 'scripts/mkuboot.sh')
0 files changed, 0 insertions, 0 deletions