linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next v3 00/25] md: synchronize io with array reconfiguration
@ 2023-09-28  6:15 Yu Kuai
  2023-09-28  6:15 ` [PATCH -next v3 01/25] md: use READ_ONCE/WRITE_ONCE for 'suspend_lo' and 'suspend_hi' Yu Kuai
                   ` (25 more replies)
  0 siblings, 26 replies; 34+ messages in thread
From: Yu Kuai @ 2023-09-28  6:15 UTC (permalink / raw)
  To: xni, agk, snitzer, dm-devel, song
  Cc: linux-kernel, linux-raid, yukuai3, yukuai1, yi.zhang, yangerkun

From: Yu Kuai <yukuai3@huawei.com>

Changes in v3:
 - rebase with latest md-next;
 - remove patch 2 from v2, and replace it with a new patch;
 - fix a null-ptr-derefrence in rdev_attr_store() that mddev is used
 before checking;
 - merge patch 20-22 from v1 into one patch;
 - mddev_lock() used to be called first and can be interruptted, allow new
 api, which is called before mddev_lock() now, to be interruptted as well;
 - improve some comments and coding;

Changes in v2:
 - rebase with latest md-next;
 - remove some follow up cleanup patches, these patches will be sent
 later after this patchset.

After previous four patchset of preparatory work, this patchset impelement
a new version of mddev_suspend(), the new apis:
 - reconfig_mutex is not required;
 - the weird logical that suspend array hold 'reconfig_mutex' for
   mddev_check_recovery() to update superblock is not needed;
 - the special handling, 'pers->prepare_suspend', for raid456 is not
   needed;
 - It's safe to be called at any time once mddev is allocated, and it's
   designed to be used from slow path where array configuration is changed;

And use the new api to replace:

mddev_lock
mddev_suspend or not
// array reconfiguration
mddev_resume or not
mddev_unlock

With:

mddev_suspend
mddev_lock
// array reconfiguration
mddev_unlock
mddev_resume

However, the above change is not possible for raid5 and raid-cluster in
some corner cases, and mddev_suspend/resume() is replaced with quiesce()
callback, which will suspend the array as well.

This patchset is tested in my VM with mdadm testsuite with loop device
except for 10ddf tests(they always fail before this patchset).

A lot of cleanups will be started after this patchset.

Yu Kuai (25):
  md: use READ_ONCE/WRITE_ONCE for 'suspend_lo' and 'suspend_hi'
  md: replace is_md_suspended() with 'mddev->suspended' in
    md_check_recovery()
  md: add new helpers to suspend/resume array
  md: add new helpers to suspend/resume and lock/unlock array
  md: use new apis to suspend array for suspend_lo/hi_store()
  md: use new apis to suspend array for level_store()
  md: use new apis to suspend array for serialize_policy_store()
  md/dm-raid: use new apis to suspend array
  md/md-bitmap: use new apis to suspend array for location_store()
  md/raid5-cache: use READ_ONCE/WRITE_ONCE for 'conf->log'
  md/raid5-cache: use new apis to suspend array for
    r5c_disable_writeback_async()
  md/raid5-cache: use new apis to suspend array for
    r5c_journal_mode_store()
  md/raid5: use new apis to suspend array for raid5_store_stripe_size()
  md/raid5: use new apis to suspend array for raid5_store_skip_copy()
  md/raid5: use new apis to suspend array for
    raid5_store_group_thread_cnt()
  md/raid5: use new apis to suspend array for
    raid5_change_consistency_policy()
  md/raid5: replace suspend with quiesce() callback
  md: use new apis to suspend array for ioctls involed array
    reconfiguration
  md: use new apis to suspend array for adding/removing rdev from
    state_store()
  md: use new apis to suspend array before
    mddev_create/destroy_serial_pool
  md: cleanup mddev_create/destroy_serial_pool()
  md/md-linear: cleanup linear_add()
  md: suspend array in md_start_sync() if array need reconfiguration
  md: remove old apis to suspend the array
  md: rename __mddev_suspend/resume() back to mddev_suspend/resume()

 drivers/md/dm-raid.c       |  10 +-
 drivers/md/md-autodetect.c |   4 +-
 drivers/md/md-bitmap.c     |  18 ++-
 drivers/md/md-linear.c     |   2 -
 drivers/md/md.c            | 233 ++++++++++++++++++++-----------------
 drivers/md/md.h            |  43 +++++--
 drivers/md/raid5-cache.c   |  64 +++++-----
 drivers/md/raid5.c         |  56 ++++-----
 8 files changed, 226 insertions(+), 204 deletions(-)

-- 
2.39.2


^ permalink raw reply	[flat|nested] 34+ messages in thread

end of thread, other threads:[~2023-10-07  2:49 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-28  6:15 [PATCH -next v3 00/25] md: synchronize io with array reconfiguration Yu Kuai
2023-09-28  6:15 ` [PATCH -next v3 01/25] md: use READ_ONCE/WRITE_ONCE for 'suspend_lo' and 'suspend_hi' Yu Kuai
2023-09-28 15:54   ` Song Liu
2023-09-28  6:15 ` [PATCH -next v3 02/25] md: replace is_md_suspended() with 'mddev->suspended' in md_check_recovery() Yu Kuai
2023-09-28  6:15 ` [PATCH -next v3 03/25] md: add new helpers to suspend/resume array Yu Kuai
2023-09-28 18:45   ` Song Liu
     [not found]     ` <0ae441ba-68db-b823-b48c-76e953d22067@huaweicloud.com>
2023-10-05  4:00       ` Song Liu
2023-09-28  6:15 ` [PATCH -next v3 04/25] md: add new helpers to suspend/resume and lock/unlock array Yu Kuai
2023-09-28  6:15 ` [PATCH -next v3 05/25] md: use new apis to suspend array for suspend_lo/hi_store() Yu Kuai
2023-09-28  6:15 ` [PATCH -next v3 06/25] md: use new apis to suspend array for level_store() Yu Kuai
2023-09-28  6:15 ` [PATCH -next v3 07/25] md: use new apis to suspend array for serialize_policy_store() Yu Kuai
2023-09-28  6:15 ` [PATCH -next v3 08/25] md/dm-raid: use new apis to suspend array Yu Kuai
2023-09-28  6:15 ` [PATCH -next v3 09/25] md/md-bitmap: use new apis to suspend array for location_store() Yu Kuai
2023-09-28  6:15 ` [PATCH -next v3 10/25] md/raid5-cache: use READ_ONCE/WRITE_ONCE for 'conf->log' Yu Kuai
2023-09-28  6:15 ` [PATCH -next v3 11/25] md/raid5-cache: use new apis to suspend array for r5c_disable_writeback_async() Yu Kuai
2023-09-28  6:15 ` [PATCH -next v3 12/25] md/raid5-cache: use new apis to suspend array for r5c_journal_mode_store() Yu Kuai
2023-09-28  6:15 ` [PATCH -next v3 13/25] md/raid5: use new apis to suspend array for raid5_store_stripe_size() Yu Kuai
2023-09-28  6:15 ` [PATCH -next v3 14/25] md/raid5: use new apis to suspend array for raid5_store_skip_copy() Yu Kuai
2023-09-28  6:15 ` [PATCH -next v3 15/25] md/raid5: use new apis to suspend array for raid5_store_group_thread_cnt() Yu Kuai
2023-09-28  6:15 ` [PATCH -next v3 16/25] md/raid5: use new apis to suspend array for raid5_change_consistency_policy() Yu Kuai
2023-09-28  6:15 ` [PATCH -next v3 17/25] md/raid5: replace suspend with quiesce() callback Yu Kuai
2023-09-28  6:15 ` [PATCH -next v3 18/25] md: use new apis to suspend array for ioctls involed array reconfiguration Yu Kuai
2023-09-28  6:15 ` [PATCH -next v3 19/25] md: use new apis to suspend array for adding/removing rdev from state_store() Yu Kuai
2023-09-28  6:15 ` [PATCH -next v3 20/25] md: use new apis to suspend array before mddev_create/destroy_serial_pool Yu Kuai
2023-09-28  6:15 ` [PATCH -next v3 21/25] md: cleanup mddev_create/destroy_serial_pool() Yu Kuai
2023-09-28  6:15 ` [PATCH -next v3 22/25] md/md-linear: cleanup linear_add() Yu Kuai
2023-09-28  6:15 ` [PATCH -next v3 23/25] md: suspend array in md_start_sync() if array need reconfiguration Yu Kuai
2023-09-28  6:15 ` [PATCH -next v3 24/25] md: remove old apis to suspend the array Yu Kuai
2023-09-28  6:15 ` [PATCH -next v3 25/25] md: rename __mddev_suspend/resume() back to mddev_suspend/resume() Yu Kuai
2023-09-28 19:15 ` [PATCH -next v3 00/25] md: synchronize io with array reconfiguration Song Liu
     [not found]   ` <f59cbb99-33dd-c427-2e43-5a07ab9fbf51@huaweicloud.com>
2023-10-05  3:55     ` Song Liu
2023-10-07  2:32       ` Yu Kuai
2023-10-07  2:40         ` Song Liu
2023-10-07  2:49           ` Yu Kuai

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).