summaryrefslogtreecommitdiffstats
path: root/drivers/md/md.h
diff options
context:
space:
mode:
authorXiao Ni <xni@redhat.com>2023-01-31 13:17:10 +0800
committerSong Liu <song@kernel.org>2023-02-01 08:32:58 -0800
commit72adae23a72cb12e2ef0dcd7c0aa042867f27998 (patch)
treefe12bde4b82451378474a61174f29a7615a61bd4 /drivers/md/md.h
parentd19329133d25ad3dc32f8a62635692cb2f189014 (diff)
downloadlinux-72adae23a72cb12e2ef0dcd7c0aa042867f27998.tar.gz
linux-72adae23a72cb12e2ef0dcd7c0aa042867f27998.tar.bz2
linux-72adae23a72cb12e2ef0dcd7c0aa042867f27998.zip
md: Change active_io to percpu
Now the type of active_io is atomic. It's used to count how many ios are in the submitting process and it's added and decreased very time. But it only needs to check if it's zero when suspending the raid. So we can switch atomic to percpu to improve the performance. After switching active_io to percpu type, we use the state of active_io to judge if the raid device is suspended. And we don't need to wake up ->sb_wait in md_handle_request anymore. It's done in the callback function which is registered when initing active_io. The argument mddev->suspended is only used to count how many users are trying to set raid to suspend state. Signed-off-by: Xiao Ni <xni@redhat.com> Signed-off-by: Song Liu <song@kernel.org>
Diffstat (limited to 'drivers/md/md.h')
-rw-r--r--drivers/md/md.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/md/md.h b/drivers/md/md.h
index 554a9026669a..6335cb86e52e 100644
--- a/drivers/md/md.h
+++ b/drivers/md/md.h
@@ -315,7 +315,7 @@ struct mddev {
unsigned long sb_flags;
int suspended;
- atomic_t active_io;
+ struct percpu_ref active_io;
int ro;
int sysfs_active; /* set when sysfs deletes
* are happening, so run/