linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 09/11] md: add atomic mode switching when removing disk
@ 2024-03-26 10:29 tada keisuke
  2024-03-31  0:02 ` kernel test robot
  0 siblings, 1 reply; 3+ messages in thread
From: tada keisuke @ 2024-03-26 10:29 UTC (permalink / raw)
  To: song@kernel.org, yukuai3@huawei.com
  Cc: linux-raid@vger.kernel.org, linux-kernel@vger.kernel.org

This patch depends on patch 08.

To minimize the number of execution of atomic mode switching, not only adding atomic mode switching, but also remove judgment is divided into two stages.
Latency is minimized because only rdev to be removed is switched to atomic mode, not all rdevs.

Signed-off-by: Keisuke TADA <keisuke1.tada@kioxia.com>
Signed-off-by: Toshifumi OHTAKE <toshifumi.ootake@kioxia.com>
---
 drivers/md/md.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/md/md.c b/drivers/md/md.c
index 30fbba38ea58..8c0c48a3a585 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -9277,8 +9277,10 @@ static bool rdev_removeable(struct md_rdev *rdev)
 		return false;
 
 	/* Fautly rdev is not used, it's safe to remove it. */
-	if (test_bit(Faulty, &rdev->flags))
+	if (test_bit(Faulty, &rdev->flags)) {
+		percpu_ref_switch_to_atomic_sync(&rdev->nr_pending);
 		return true;
+	}
 
 	/* Journal disk can only be removed if it's faulty. */
 	if (test_bit(Journal, &rdev->flags))
-- 
2.34.1


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

end of thread, other threads:[~2024-04-05  6:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-26 10:29 [PATCH 09/11] md: add atomic mode switching when removing disk tada keisuke
2024-03-31  0:02 ` kernel test robot
2024-04-05  5:18   ` tada keisuke

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