projects
/
linux-2.6-microblaze.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1d24d4c
)
md: skip redundant raid_disks update when value is unchanged
author
Abd-Alrhman Masalkhi
<abd.masalkhi@gmail.com>
Tue, 28 Apr 2026 13:05:24 +0000
(15:05 +0200)
committer
Yu Kuai
<yukuai@fygo.io>
Sun, 31 May 2026 11:09:17 +0000
(19:09 +0800)
Calling update_raid_disks() with the same value as the current one
can trigger unnecessary work. For example, RAID1 will reallocate
resources such as the mempool for r1bio.
Signed-off-by: Abd-Alrhman Masalkhi <abd.masalkhi@gmail.com>
Link:
https://patch.msgid.link/20260428130524.448063-1-abd.masalkhi@gmail.com
Signed-off-by: Yu Kuai <yukuai@fygo.io>
drivers/md/md.c
patch
|
blob
|
history
diff --git
a/drivers/md/md.c
b/drivers/md/md.c
index
8b568ee
..
6cb2c45
100644
(file)
--- a/
drivers/md/md.c
+++ b/
drivers/md/md.c
@@
-4414,9
+4414,10
@@
raid_disks_store(struct mddev *mddev, const char *buf, size_t len)
err = mddev_suspend_and_lock(mddev);
if (err)
return err;
- if (mddev->pers)
- err = update_raid_disks(mddev, n);
- else if (mddev->reshape_position != MaxSector) {
+ if (mddev->pers) {
+ if (n != mddev->raid_disks)
+ err = update_raid_disks(mddev, n);
+ } else if (mddev->reshape_position != MaxSector) {
struct md_rdev *rdev;
int olddisks = mddev->raid_disks - mddev->delta_disks;