-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve performance for zpool trim on Linux #15843
Conversation
a839588
to
96c10a5
Compare
On Linux, ZFS uses blkdev_issue_discard in vdev_disk_io_trim to issue trim command which is synchronus. This commit updates vdev_disk_io_trim to use __blkdev_issue_discard, which is asynchronus. Unfortunately there isn't any asynchronus version for blkdev_issue_secure_erase, so performance of secure trim will still suffer. Signed-off-by: Umer Saleem <usaleem@ixsystems.com>
96c10a5
to
6beb1c1
Compare
On Linux, ZFS uses blkdev_issue_discard in vdev_disk_io_trim to issue trim command which is synchronous. This commit updates vdev_disk_io_trim to use __blkdev_issue_discard, which is asynchronous. Unfortunately there isn't any asynchronous version for blkdev_issue_secure_erase, so performance of secure trim will still suffer. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Alexander Motin <mav@FreeBSD.org> Signed-off-by: Umer Saleem <usaleem@ixsystems.com> Closes #15843
On Linux, ZFS uses blkdev_issue_discard in vdev_disk_io_trim to issue trim command which is synchronous. This commit updates vdev_disk_io_trim to use __blkdev_issue_discard, which is asynchronous. Unfortunately there isn't any asynchronous version for blkdev_issue_secure_erase, so performance of secure trim will still suffer. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Alexander Motin <mav@FreeBSD.org> Signed-off-by: Umer Saleem <usaleem@ixsystems.com> Closes openzfs#15843
On Linux, ZFS uses blkdev_issue_discard in vdev_disk_io_trim to issue trim command which is synchronous. This commit updates vdev_disk_io_trim to use __blkdev_issue_discard, which is asynchronous. Unfortunately there isn't any asynchronous version for blkdev_issue_secure_erase, so performance of secure trim will still suffer. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Alexander Motin <mav@FreeBSD.org> Signed-off-by: Umer Saleem <usaleem@ixsystems.com> Closes openzfs#15843
On Linux, ZFS uses blkdev_issue_discard in vdev_disk_io_trim to issue trim command which is synchronous. This commit updates vdev_disk_io_trim to use __blkdev_issue_discard, which is asynchronous. Unfortunately there isn't any asynchronous version for blkdev_issue_secure_erase, so performance of secure trim will still suffer. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Alexander Motin <mav@FreeBSD.org> Signed-off-by: Umer Saleem <usaleem@ixsystems.com> Closes openzfs#15843
@usaleem-ix do you have any info on hand about the performance improvements this change gives? I'm not doubting that there's something there, I just want to understand the before & after a little better before I make any changes in this area. Thanks! |
@robn there was an issue where users with typically large pools were experiencing very slow trim operation. Before this change, we saw that ZFS uses synchronous TRIM KPIs on Linux ( The problem with synchronous KPI is that ZFS currently has only 4 TRIM issue taskq threads, that means on Linux it can have only 4 TRIM requests per pool running same time. That may be OK for small non-fragmented pool, but for some cases it becomes a problem. So we introduced this patch to use asynchronous KPI ( Unfortunately, I don't have performance improvement numbers at hand for this. |
No problem, I appreciate the info! That's about what my guess was too. Cheers! |
Motivation and Context
On Linux, ZFS uses
blkdev_issue_discard
invdev_disk_io_trim
to issue trim command which is synchronus. Inblkdev_issue_discard
,submit_bio_wait
is used to after calling__blkdev_issue_discard
.Description
This commit updates
vdev_disk_io_trim
to use__blkdev_issue_discard
, which is asynchronous, and submit bio viavdev_submit_bio
.Unfortunately, there isn't any asynchronus version for
blkdev_issue_secure_erase
, so performance of secure trim will still suffer.How Has This Been Tested?
CI test runs and manual runs of
zpool trim <pool>
Types of changes
Checklist:
Signed-off-by
.