2023-01-25 21:00:44 +01:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2014-06-24 14:27:04 -04:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2020-01-03 09:20:22 +01:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-02-08 02:11:09 +00:00
|
|
|
|
2006-08-22 20:29:17 +10:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2025-12-14 16:51:56 -08:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2016-11-21 15:58:51 +01:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2021-09-20 14:33:27 +02:00
|
|
|
|
2025-01-27 14:15:33 -08:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-10-11 11:10:42 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2015-02-13 08:25:59 -05:00
|
|
|
|
2006-10-19 23:28:16 -07:00
|
|
|
|
2011-07-26 16:09:06 -07:00
|
|
|
|
2005-09-17 17:55:31 +10:00
|
|
|
|
2015-02-13 08:27:41 -05:00
|
|
|
|
2016-12-01 18:20:52 +01:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2024-10-01 15:35:57 -04:00
|
|
|
|
2026-03-21 16:06:50 -07:00
|
|
|
|
2011-01-13 19:59:55 +00:00
|
|
|
|
|
|
|
|
|
2016-01-24 21:16:36 +08:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
2023-06-01 16:47:43 +08:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
2020-04-20 16:46:59 +03:00
|
|
|
|
2016-11-21 15:58:51 +01:00
|
|
|
|
2020-04-20 16:46:59 +03:00
|
|
|
|
2021-01-22 09:43:21 +01:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2008-10-21 17:44:59 +01:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2021-09-04 11:59:30 +02:00
|
|
|
|
|
|
|
|
|
2006-06-26 00:27:35 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2023-07-11 14:11:29 +08:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-02-08 02:11:09 +00:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2013-10-11 15:45:43 -07:00
|
|
|
|
2024-02-20 19:11:51 +01:00
|
|
|
|
2013-10-11 15:45:43 -07:00
|
|
|
|
2012-07-27 15:08:04 +01:00
|
|
|
|
2025-01-20 16:29:51 +08:00
|
|
|
|
2024-02-20 19:11:51 +01:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-02-19 21:31:11 +01:00
|
|
|
|
|
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2008-02-08 02:10:38 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-07-27 15:08:05 +01:00
|
|
|
|
2008-02-08 02:10:38 +00:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
2023-03-08 14:39:54 -05:00
|
|
|
|
|
|
|
|
|
2008-02-08 02:10:38 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-07-27 15:08:04 +01:00
|
|
|
|
2017-06-03 09:38:06 +02:00
|
|
|
|
2008-02-08 02:10:54 +00:00
|
|
|
|
2015-02-13 08:25:59 -05:00
|
|
|
|
2024-02-19 21:31:11 +01:00
|
|
|
|
|
|
|
|
|
2015-02-13 08:27:41 -05:00
|
|
|
|
2014-03-28 15:51:55 -04:00
|
|
|
|
2008-02-08 02:10:38 +00:00
|
|
|
|
2008-02-08 02:11:04 +00:00
|
|
|
|
2009-03-16 17:44:33 +00:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
2018-11-05 15:31:42 +08:00
|
|
|
|
2008-02-08 02:11:04 +00:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-10-19 22:42:37 +01:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2009-12-10 23:51:56 +00:00
|
|
|
|
2026-03-21 16:06:51 -07:00
|
|
|
|
2011-01-13 19:59:54 +00:00
|
|
|
|
|
|
|
|
|
2026-03-29 13:49:52 -07:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2009-12-10 23:51:55 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-01-13 19:59:55 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-10-28 23:21:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-01-03 09:20:22 +01:00
|
|
|
|
|
|
|
|
|
2026-03-21 16:06:50 -07:00
|
|
|
|
2020-01-03 09:20:22 +01:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-13 08:27:08 -05:00
|
|
|
|
2024-04-08 21:36:56 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-01-13 19:59:53 +00:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
2020-12-16 14:15:42 +01:00
|
|
|
|
2017-03-16 15:39:44 +01:00
|
|
|
|
2020-01-03 09:20:22 +01:00
|
|
|
|
2024-08-16 13:21:33 +02:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
2011-01-13 19:59:53 +00:00
|
|
|
|
2014-02-20 18:01:01 -05:00
|
|
|
|
2011-01-13 19:59:53 +00:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-08-13 22:45:08 -04:00
|
|
|
|
|
|
|
|
|
2007-10-19 22:38:58 +01:00
|
|
|
|
|
|
|
|
|
2008-03-28 14:16:07 -07:00
|
|
|
|
2018-07-11 12:10:51 -04:00
|
|
|
|
2018-05-22 18:26:20 -04:00
|
|
|
|
2015-02-13 08:27:41 -05:00
|
|
|
|
2015-02-13 08:25:59 -05:00
|
|
|
|
2011-01-13 19:59:52 +00:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
2016-11-21 15:58:51 +01:00
|
|
|
|
2010-08-12 04:14:07 +01:00
|
|
|
|
2015-11-29 14:09:19 +01:00
|
|
|
|
2006-12-05 13:41:52 -08:00
|
|
|
|
2009-12-10 23:51:55 +00:00
|
|
|
|
2011-01-13 19:59:55 +00:00
|
|
|
|
2013-10-28 23:21:04 +01:00
|
|
|
|
2020-01-03 09:20:22 +01:00
|
|
|
|
2006-12-05 13:41:52 -08:00
|
|
|
|
2018-11-05 15:31:42 +08:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2023-01-25 21:14:58 +01:00
|
|
|
|
2017-03-23 10:23:14 -04:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-01-25 21:14:58 +01:00
|
|
|
|
2023-07-11 14:11:29 +08:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
2011-01-13 19:59:53 +00:00
|
|
|
|
2008-02-08 02:11:07 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-01-24 21:16:36 +08:00
|
|
|
|
2008-02-08 02:11:07 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-03-28 15:51:55 -04:00
|
|
|
|
|
|
|
|
|
2006-10-03 01:15:37 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2013-10-28 23:21:03 +01:00
|
|
|
|
|
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-07-08 22:06:58 +02:00
|
|
|
|
|
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
2018-05-22 18:26:20 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-01-25 21:14:58 +01:00
|
|
|
|
2018-05-22 18:26:20 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
2023-09-15 13:03:45 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2017-08-13 22:45:08 -04:00
|
|
|
|
2023-01-30 21:28:24 +01:00
|
|
|
|
2017-08-13 22:45:08 -04:00
|
|
|
|
|
|
|
|
|
2021-03-11 12:01:37 +01:00
|
|
|
|
2024-07-03 15:00:29 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dm: dm-crypt: Do not partially accept write BIOs with zoned targets
Read and write operations issued to a dm-crypt target may be split
according to the dm-crypt internal limits defined by the max_read_size
and max_write_size module parameters (default is 128 KB). The intent is
to improve processing time of large BIOs by splitting them into smaller
operations that can be parallelized on different CPUs.
For zoned dm-crypt targets, this BIO splitting is still done but without
the parallel execution to ensure that the issuing order of write
operations to the underlying devices remains sequential. However, the
splitting itself causes other problems:
1) Since dm-crypt relies on the block layer zone write plugging to
handle zone append emulation using regular write operations, the
reminder of a split write BIO will always be plugged into the target
zone write plugged. Once the on-going write BIO finishes, this
reminder BIO is unplugged and issued from the zone write plug work.
If this reminder BIO itself needs to be split, the reminder will be
re-issued and plugged again, but that causes a call to a
blk_queue_enter(), which may block if a queue freeze operation was
initiated. This results in a deadlock as DM submission still holds
BIOs that the queue freeze side is waiting for.
2) dm-crypt relies on the emulation done by the block layer using
regular write operations for processing zone append operations. This
still requires to properly return the written sector as the BIO
sector of the original BIO. However, this can be done correctly only
and only if there is a single clone BIO used for processing the
original zone append operation issued by the user. If the size of a
zone append operation is larger than dm-crypt max_write_size, then
the orginal BIO will be split and processed as a chain of regular
write operations. Such chaining result in an incorrect written sector
being returned to the zone append issuer using the original BIO
sector. This in turn results in file system data corruptions using
xfs or btrfs.
Fix this by modifying get_max_request_size() to always return the size
of the BIO to avoid it being split with dm_accpet_partial_bio() in
crypt_map(). get_max_request_size() is renamed to
get_max_request_sectors() to clarify the unit of the value returned
and its interface is changed to take a struct dm_target pointer and a
pointer to the struct bio being processed. In addition to this change,
to ensure that crypt_alloc_buffer() works correctly, set the dm-crypt
device max_hw_sectors limit to be at most
BIO_MAX_VECS << PAGE_SECTORS_SHIFT (1 MB with a 4KB page architecture).
This forces DM core to split write BIOs before passing them to
crypt_map(), and thus guaranteeing that dm-crypt can always accept an
entire write BIO without needing to split it.
This change does not have any effect on the read path of dm-crypt. Read
operations can still be split and the BIO fragments processed in
parallel. There is also no impact on the performance of the write path
given that all zone write BIOs were already processed inline instead of
in parallel.
This change also does not affect in any way regular dm-crypt block
devices.
Fixes: f211268ed1f9 ("dm: Use the block layer zone append emulation")
Cc: stable@vger.kernel.org
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Mikulas Patocka <mpatocka@redhat.com>
Link: https://lore.kernel.org/r/20250625093327.548866-5-dlemoal@kernel.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2025-06-25 18:33:26 +09:00
|
|
|
|
2025-11-05 16:02:36 +01:00
|
|
|
|
2024-07-03 15:00:29 +02:00
|
|
|
|
dm: dm-crypt: Do not partially accept write BIOs with zoned targets
Read and write operations issued to a dm-crypt target may be split
according to the dm-crypt internal limits defined by the max_read_size
and max_write_size module parameters (default is 128 KB). The intent is
to improve processing time of large BIOs by splitting them into smaller
operations that can be parallelized on different CPUs.
For zoned dm-crypt targets, this BIO splitting is still done but without
the parallel execution to ensure that the issuing order of write
operations to the underlying devices remains sequential. However, the
splitting itself causes other problems:
1) Since dm-crypt relies on the block layer zone write plugging to
handle zone append emulation using regular write operations, the
reminder of a split write BIO will always be plugged into the target
zone write plugged. Once the on-going write BIO finishes, this
reminder BIO is unplugged and issued from the zone write plug work.
If this reminder BIO itself needs to be split, the reminder will be
re-issued and plugged again, but that causes a call to a
blk_queue_enter(), which may block if a queue freeze operation was
initiated. This results in a deadlock as DM submission still holds
BIOs that the queue freeze side is waiting for.
2) dm-crypt relies on the emulation done by the block layer using
regular write operations for processing zone append operations. This
still requires to properly return the written sector as the BIO
sector of the original BIO. However, this can be done correctly only
and only if there is a single clone BIO used for processing the
original zone append operation issued by the user. If the size of a
zone append operation is larger than dm-crypt max_write_size, then
the orginal BIO will be split and processed as a chain of regular
write operations. Such chaining result in an incorrect written sector
being returned to the zone append issuer using the original BIO
sector. This in turn results in file system data corruptions using
xfs or btrfs.
Fix this by modifying get_max_request_size() to always return the size
of the BIO to avoid it being split with dm_accpet_partial_bio() in
crypt_map(). get_max_request_size() is renamed to
get_max_request_sectors() to clarify the unit of the value returned
and its interface is changed to take a struct dm_target pointer and a
pointer to the struct bio being processed. In addition to this change,
to ensure that crypt_alloc_buffer() works correctly, set the dm-crypt
device max_hw_sectors limit to be at most
BIO_MAX_VECS << PAGE_SECTORS_SHIFT (1 MB with a 4KB page architecture).
This forces DM core to split write BIOs before passing them to
crypt_map(), and thus guaranteeing that dm-crypt can always accept an
entire write BIO without needing to split it.
This change does not have any effect on the read path of dm-crypt. Read
operations can still be split and the BIO fragments processed in
parallel. There is also no impact on the performance of the write path
given that all zone write BIOs were already processed inline instead of
in parallel.
This change also does not affect in any way regular dm-crypt block
devices.
Fixes: f211268ed1f9 ("dm: Use the block layer zone append emulation")
Cc: stable@vger.kernel.org
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Mikulas Patocka <mpatocka@redhat.com>
Link: https://lore.kernel.org/r/20250625093327.548866-5-dlemoal@kernel.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2025-06-25 18:33:26 +09:00
|
|
|
|
2024-07-03 15:00:29 +02:00
|
|
|
|
dm: dm-crypt: Do not partially accept write BIOs with zoned targets
Read and write operations issued to a dm-crypt target may be split
according to the dm-crypt internal limits defined by the max_read_size
and max_write_size module parameters (default is 128 KB). The intent is
to improve processing time of large BIOs by splitting them into smaller
operations that can be parallelized on different CPUs.
For zoned dm-crypt targets, this BIO splitting is still done but without
the parallel execution to ensure that the issuing order of write
operations to the underlying devices remains sequential. However, the
splitting itself causes other problems:
1) Since dm-crypt relies on the block layer zone write plugging to
handle zone append emulation using regular write operations, the
reminder of a split write BIO will always be plugged into the target
zone write plugged. Once the on-going write BIO finishes, this
reminder BIO is unplugged and issued from the zone write plug work.
If this reminder BIO itself needs to be split, the reminder will be
re-issued and plugged again, but that causes a call to a
blk_queue_enter(), which may block if a queue freeze operation was
initiated. This results in a deadlock as DM submission still holds
BIOs that the queue freeze side is waiting for.
2) dm-crypt relies on the emulation done by the block layer using
regular write operations for processing zone append operations. This
still requires to properly return the written sector as the BIO
sector of the original BIO. However, this can be done correctly only
and only if there is a single clone BIO used for processing the
original zone append operation issued by the user. If the size of a
zone append operation is larger than dm-crypt max_write_size, then
the orginal BIO will be split and processed as a chain of regular
write operations. Such chaining result in an incorrect written sector
being returned to the zone append issuer using the original BIO
sector. This in turn results in file system data corruptions using
xfs or btrfs.
Fix this by modifying get_max_request_size() to always return the size
of the BIO to avoid it being split with dm_accpet_partial_bio() in
crypt_map(). get_max_request_size() is renamed to
get_max_request_sectors() to clarify the unit of the value returned
and its interface is changed to take a struct dm_target pointer and a
pointer to the struct bio being processed. In addition to this change,
to ensure that crypt_alloc_buffer() works correctly, set the dm-crypt
device max_hw_sectors limit to be at most
BIO_MAX_VECS << PAGE_SECTORS_SHIFT (1 MB with a 4KB page architecture).
This forces DM core to split write BIOs before passing them to
crypt_map(), and thus guaranteeing that dm-crypt can always accept an
entire write BIO without needing to split it.
This change does not have any effect on the read path of dm-crypt. Read
operations can still be split and the BIO fragments processed in
parallel. There is also no impact on the performance of the write path
given that all zone write BIOs were already processed inline instead of
in parallel.
This change also does not affect in any way regular dm-crypt block
devices.
Fixes: f211268ed1f9 ("dm: Use the block layer zone append emulation")
Cc: stable@vger.kernel.org
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Mikulas Patocka <mpatocka@redhat.com>
Link: https://lore.kernel.org/r/20250625093327.548866-5-dlemoal@kernel.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2025-06-25 18:33:26 +09:00
|
|
|
|
|
|
|
|
|
2025-11-05 16:02:36 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dm: dm-crypt: Do not partially accept write BIOs with zoned targets
Read and write operations issued to a dm-crypt target may be split
according to the dm-crypt internal limits defined by the max_read_size
and max_write_size module parameters (default is 128 KB). The intent is
to improve processing time of large BIOs by splitting them into smaller
operations that can be parallelized on different CPUs.
For zoned dm-crypt targets, this BIO splitting is still done but without
the parallel execution to ensure that the issuing order of write
operations to the underlying devices remains sequential. However, the
splitting itself causes other problems:
1) Since dm-crypt relies on the block layer zone write plugging to
handle zone append emulation using regular write operations, the
reminder of a split write BIO will always be plugged into the target
zone write plugged. Once the on-going write BIO finishes, this
reminder BIO is unplugged and issued from the zone write plug work.
If this reminder BIO itself needs to be split, the reminder will be
re-issued and plugged again, but that causes a call to a
blk_queue_enter(), which may block if a queue freeze operation was
initiated. This results in a deadlock as DM submission still holds
BIOs that the queue freeze side is waiting for.
2) dm-crypt relies on the emulation done by the block layer using
regular write operations for processing zone append operations. This
still requires to properly return the written sector as the BIO
sector of the original BIO. However, this can be done correctly only
and only if there is a single clone BIO used for processing the
original zone append operation issued by the user. If the size of a
zone append operation is larger than dm-crypt max_write_size, then
the orginal BIO will be split and processed as a chain of regular
write operations. Such chaining result in an incorrect written sector
being returned to the zone append issuer using the original BIO
sector. This in turn results in file system data corruptions using
xfs or btrfs.
Fix this by modifying get_max_request_size() to always return the size
of the BIO to avoid it being split with dm_accpet_partial_bio() in
crypt_map(). get_max_request_size() is renamed to
get_max_request_sectors() to clarify the unit of the value returned
and its interface is changed to take a struct dm_target pointer and a
pointer to the struct bio being processed. In addition to this change,
to ensure that crypt_alloc_buffer() works correctly, set the dm-crypt
device max_hw_sectors limit to be at most
BIO_MAX_VECS << PAGE_SECTORS_SHIFT (1 MB with a 4KB page architecture).
This forces DM core to split write BIOs before passing them to
crypt_map(), and thus guaranteeing that dm-crypt can always accept an
entire write BIO without needing to split it.
This change does not have any effect on the read path of dm-crypt. Read
operations can still be split and the BIO fragments processed in
parallel. There is also no impact on the performance of the write path
given that all zone write BIOs were already processed inline instead of
in parallel.
This change also does not affect in any way regular dm-crypt block
devices.
Fixes: f211268ed1f9 ("dm: Use the block layer zone append emulation")
Cc: stable@vger.kernel.org
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Mikulas Patocka <mpatocka@redhat.com>
Link: https://lore.kernel.org/r/20250625093327.548866-5-dlemoal@kernel.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2025-06-25 18:33:26 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-07-03 15:00:29 +02:00
|
|
|
|
dm: dm-crypt: Do not partially accept write BIOs with zoned targets
Read and write operations issued to a dm-crypt target may be split
according to the dm-crypt internal limits defined by the max_read_size
and max_write_size module parameters (default is 128 KB). The intent is
to improve processing time of large BIOs by splitting them into smaller
operations that can be parallelized on different CPUs.
For zoned dm-crypt targets, this BIO splitting is still done but without
the parallel execution to ensure that the issuing order of write
operations to the underlying devices remains sequential. However, the
splitting itself causes other problems:
1) Since dm-crypt relies on the block layer zone write plugging to
handle zone append emulation using regular write operations, the
reminder of a split write BIO will always be plugged into the target
zone write plugged. Once the on-going write BIO finishes, this
reminder BIO is unplugged and issued from the zone write plug work.
If this reminder BIO itself needs to be split, the reminder will be
re-issued and plugged again, but that causes a call to a
blk_queue_enter(), which may block if a queue freeze operation was
initiated. This results in a deadlock as DM submission still holds
BIOs that the queue freeze side is waiting for.
2) dm-crypt relies on the emulation done by the block layer using
regular write operations for processing zone append operations. This
still requires to properly return the written sector as the BIO
sector of the original BIO. However, this can be done correctly only
and only if there is a single clone BIO used for processing the
original zone append operation issued by the user. If the size of a
zone append operation is larger than dm-crypt max_write_size, then
the orginal BIO will be split and processed as a chain of regular
write operations. Such chaining result in an incorrect written sector
being returned to the zone append issuer using the original BIO
sector. This in turn results in file system data corruptions using
xfs or btrfs.
Fix this by modifying get_max_request_size() to always return the size
of the BIO to avoid it being split with dm_accpet_partial_bio() in
crypt_map(). get_max_request_size() is renamed to
get_max_request_sectors() to clarify the unit of the value returned
and its interface is changed to take a struct dm_target pointer and a
pointer to the struct bio being processed. In addition to this change,
to ensure that crypt_alloc_buffer() works correctly, set the dm-crypt
device max_hw_sectors limit to be at most
BIO_MAX_VECS << PAGE_SECTORS_SHIFT (1 MB with a 4KB page architecture).
This forces DM core to split write BIOs before passing them to
crypt_map(), and thus guaranteeing that dm-crypt can always accept an
entire write BIO without needing to split it.
This change does not have any effect on the read path of dm-crypt. Read
operations can still be split and the BIO fragments processed in
parallel. There is also no impact on the performance of the write path
given that all zone write BIOs were already processed inline instead of
in parallel.
This change also does not affect in any way regular dm-crypt block
devices.
Fixes: f211268ed1f9 ("dm: Use the block layer zone append emulation")
Cc: stable@vger.kernel.org
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Mikulas Patocka <mpatocka@redhat.com>
Link: https://lore.kernel.org/r/20250625093327.548866-5-dlemoal@kernel.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2025-06-25 18:33:26 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-07-03 15:00:29 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-08-13 22:45:08 -04:00
|
|
|
|
2022-01-24 10:10:54 +01:00
|
|
|
|
2008-02-08 02:10:52 +00:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
2007-05-09 02:32:52 -07:00
|
|
|
|
2020-02-13 12:11:26 +08:00
|
|
|
|
|
|
|
|
|
2011-01-13 19:59:53 +00:00
|
|
|
|
2017-03-30 22:18:48 -07:00
|
|
|
|
2011-01-13 19:59:53 +00:00
|
|
|
|
2016-01-24 21:16:36 +08:00
|
|
|
|
2011-01-13 19:59:53 +00:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-01-13 19:59:53 +00:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-09-02 18:17:33 +10:00
|
|
|
|
2007-10-19 23:10:43 +02:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2009-12-10 23:52:25 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-06-06 09:07:01 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-09-02 18:17:33 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2006-09-03 08:56:39 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-05-09 02:32:55 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-01-13 19:59:55 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-10-28 23:21:04 +01:00
|
|
|
|
|
|
|
|
|
2015-04-05 18:03:10 +02:00
|
|
|
|
2013-10-28 23:21:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-07-09 15:22:14 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-01-03 09:20:22 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-27 12:31:38 +02:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2011-01-13 19:59:54 +00:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2011-08-02 12:32:01 +01:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-12-10 23:52:25 +00:00
|
|
|
|
2011-01-13 19:59:54 +00:00
|
|
|
|
2009-12-10 23:52:25 +00:00
|
|
|
|
|
|
|
|
|
2011-08-02 12:32:01 +01:00
|
|
|
|
2009-12-10 23:52:25 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-06-06 09:07:01 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-01-13 19:59:54 +00:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2019-08-19 17:17:37 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2011-08-02 12:32:01 +01:00
|
|
|
|
2011-01-13 19:59:53 +00:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-09-03 08:56:39 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-01-25 21:14:58 +01:00
|
|
|
|
2020-01-06 10:11:47 +01:00
|
|
|
|
|
|
|
|
|
2020-02-13 12:11:26 +08:00
|
|
|
|
2020-01-06 10:11:47 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-09-03 08:56:39 +10:00
|
|
|
|
2023-01-26 15:48:30 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-09-03 08:56:39 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-12-10 23:51:55 +00:00
|
|
|
|
2006-09-03 08:56:39 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-01-13 19:59:54 +00:00
|
|
|
|
|
|
|
|
|
2006-09-03 08:56:39 +10:00
|
|
|
|
2006-12-05 13:41:52 -08:00
|
|
|
|
|
|
|
|
|
2006-09-03 08:56:39 +10:00
|
|
|
|
2006-12-05 13:41:52 -08:00
|
|
|
|
2011-01-13 19:59:54 +00:00
|
|
|
|
2006-12-05 13:41:52 -08:00
|
|
|
|
2006-09-03 08:56:39 +10:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-01-13 19:59:54 +00:00
|
|
|
|
|
|
|
|
|
2007-05-09 02:32:55 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-01-13 19:59:55 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-08-06 23:18:13 -07:00
|
|
|
|
2011-01-13 19:59:55 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-16 15:39:44 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-10-11 11:10:42 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-01-13 19:59:55 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-10-11 11:10:42 -07:00
|
|
|
|
2011-01-13 19:59:55 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-03-21 16:06:51 -07:00
|
|
|
|
2011-01-13 19:59:55 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-10-11 11:10:42 -07:00
|
|
|
|
|
|
|
|
|
2011-01-13 19:59:55 +00:00
|
|
|
|
|
|
|
|
|
2025-10-11 11:10:42 -07:00
|
|
|
|
2013-10-28 23:21:03 +01:00
|
|
|
|
2011-01-13 19:59:55 +00:00
|
|
|
|
2025-10-11 11:10:42 -07:00
|
|
|
|
2011-01-13 19:59:55 +00:00
|
|
|
|
2025-10-11 11:10:42 -07:00
|
|
|
|
|
|
|
|
|
2011-01-13 19:59:55 +00:00
|
|
|
|
|
|
|
|
|
2025-10-11 11:10:42 -07:00
|
|
|
|
2011-01-13 19:59:55 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-10-11 11:10:42 -07:00
|
|
|
|
2011-01-13 19:59:55 +00:00
|
|
|
|
|
|
|
|
|
2025-10-11 11:10:42 -07:00
|
|
|
|
|
|
|
|
|
2011-01-13 19:59:55 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
2011-01-13 19:59:55 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
2023-02-07 20:22:58 +01:00
|
|
|
|
2025-10-11 11:10:42 -07:00
|
|
|
|
2023-02-07 20:22:58 +01:00
|
|
|
|
2011-01-13 19:59:55 +00:00
|
|
|
|
|
|
|
|
|
2025-10-11 11:10:42 -07:00
|
|
|
|
2011-01-13 19:59:55 +00:00
|
|
|
|
|
|
|
|
|
2026-03-29 13:49:52 -07:00
|
|
|
|
|
|
|
|
|
2011-01-13 19:59:55 +00:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
2011-01-13 19:59:55 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-03-29 13:49:52 -07:00
|
|
|
|
2011-01-13 19:59:55 +00:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
2023-02-07 20:22:58 +01:00
|
|
|
|
2025-10-11 11:10:42 -07:00
|
|
|
|
2011-01-13 19:59:55 +00:00
|
|
|
|
|
|
|
|
|
2025-10-11 11:10:42 -07:00
|
|
|
|
2011-01-13 19:59:55 +00:00
|
|
|
|
2023-02-07 20:22:58 +01:00
|
|
|
|
2011-01-13 19:59:55 +00:00
|
|
|
|
|
|
|
|
|
2013-10-28 23:21:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-08-06 23:18:13 -07:00
|
|
|
|
2013-10-28 23:21:04 +01:00
|
|
|
|
2020-08-06 23:18:13 -07:00
|
|
|
|
2013-10-28 23:21:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-16 15:39:44 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-10-28 23:21:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-03-21 16:06:51 -07:00
|
|
|
|
2013-10-28 23:21:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-01-27 14:15:33 -08:00
|
|
|
|
|
|
|
|
|
2013-10-28 23:21:04 +01:00
|
|
|
|
|
|
|
|
|
2016-06-28 16:32:32 +02:00
|
|
|
|
2013-10-28 23:21:04 +01:00
|
|
|
|
2025-01-27 14:15:33 -08:00
|
|
|
|
2013-10-28 23:21:04 +01:00
|
|
|
|
|
|
|
|
|
crypto: algapi - make crypto_xor() take separate dst and src arguments
There are quite a number of occurrences in the kernel of the pattern
if (dst != src)
memcpy(dst, src, walk.total % AES_BLOCK_SIZE);
crypto_xor(dst, final, walk.total % AES_BLOCK_SIZE);
or
crypto_xor(keystream, src, nbytes);
memcpy(dst, keystream, nbytes);
where crypto_xor() is preceded or followed by a memcpy() invocation
that is only there because crypto_xor() uses its output parameter as
one of the inputs. To avoid having to add new instances of this pattern
in the arm64 code, which will be refactored to implement non-SIMD
fallbacks, add an alternative implementation called crypto_xor_cpy(),
taking separate input and output arguments. This removes the need for
the separate memcpy().
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2017-07-24 11:28:04 +01:00
|
|
|
|
|
|
|
|
|
2013-10-28 23:21:04 +01:00
|
|
|
|
|
|
|
|
|
2025-01-27 14:15:33 -08:00
|
|
|
|
|
|
|
|
|
2013-10-28 23:21:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-11-22 09:36:04 +01:00
|
|
|
|
2013-10-28 23:21:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
2013-10-28 23:21:04 +01:00
|
|
|
|
2016-06-28 16:32:32 +02:00
|
|
|
|
2013-10-28 23:21:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
2023-02-07 20:22:58 +01:00
|
|
|
|
2025-01-27 14:15:33 -08:00
|
|
|
|
2023-02-07 20:22:58 +01:00
|
|
|
|
2013-10-28 23:21:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
crypto: algapi - make crypto_xor() take separate dst and src arguments
There are quite a number of occurrences in the kernel of the pattern
if (dst != src)
memcpy(dst, src, walk.total % AES_BLOCK_SIZE);
crypto_xor(dst, final, walk.total % AES_BLOCK_SIZE);
or
crypto_xor(keystream, src, nbytes);
memcpy(dst, keystream, nbytes);
where crypto_xor() is preceded or followed by a memcpy() invocation
that is only there because crypto_xor() uses its output parameter as
one of the inputs. To avoid having to add new instances of this pattern
in the arm64 code, which will be refactored to implement non-SIMD
fallbacks, add an alternative implementation called crypto_xor_cpy(),
taking separate input and output arguments. This removes the need for
the separate memcpy().
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2017-07-24 11:28:04 +01:00
|
|
|
|
2013-10-28 23:21:04 +01:00
|
|
|
|
crypto: algapi - make crypto_xor() take separate dst and src arguments
There are quite a number of occurrences in the kernel of the pattern
if (dst != src)
memcpy(dst, src, walk.total % AES_BLOCK_SIZE);
crypto_xor(dst, final, walk.total % AES_BLOCK_SIZE);
or
crypto_xor(keystream, src, nbytes);
memcpy(dst, keystream, nbytes);
where crypto_xor() is preceded or followed by a memcpy() invocation
that is only there because crypto_xor() uses its output parameter as
one of the inputs. To avoid having to add new instances of this pattern
in the arm64 code, which will be refactored to implement non-SIMD
fallbacks, add an alternative implementation called crypto_xor_cpy(),
taking separate input and output arguments. This removes the need for
the separate memcpy().
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2017-07-24 11:28:04 +01:00
|
|
|
|
|
|
|
|
|
2013-10-28 23:21:04 +01:00
|
|
|
|
2025-01-27 14:15:33 -08:00
|
|
|
|
2013-10-28 23:21:04 +01:00
|
|
|
|
|
|
|
|
|
2026-03-29 13:49:52 -07:00
|
|
|
|
|
|
|
|
|
2013-10-28 23:21:04 +01:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
2013-10-28 23:21:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-03-29 13:49:52 -07:00
|
|
|
|
2013-10-28 23:21:04 +01:00
|
|
|
|
|
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
2023-02-07 20:22:58 +01:00
|
|
|
|
2025-01-27 14:15:33 -08:00
|
|
|
|
2023-02-07 20:22:58 +01:00
|
|
|
|
2013-10-28 23:21:04 +01:00
|
|
|
|
|
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-07-09 15:22:14 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-02-13 12:11:26 +08:00
|
|
|
|
2019-08-07 08:50:22 +03:00
|
|
|
|
2019-07-09 15:22:14 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-07 08:50:22 +03:00
|
|
|
|
2023-02-03 18:55:47 +01:00
|
|
|
|
2019-08-07 08:50:22 +03:00
|
|
|
|
|
|
|
|
|
2019-07-09 15:22:14 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-06-01 16:47:43 +08:00
|
|
|
|
2019-08-07 08:50:22 +03:00
|
|
|
|
|
|
|
|
|
2020-08-31 14:55:55 +09:00
|
|
|
|
2023-06-01 16:47:43 +08:00
|
|
|
|
2019-08-07 08:50:22 +03:00
|
|
|
|
2023-06-01 16:47:43 +08:00
|
|
|
|
2019-07-09 15:22:14 +02:00
|
|
|
|
2023-10-06 09:41:55 +08:00
|
|
|
|
|
|
|
|
|
2023-06-01 16:47:43 +08:00
|
|
|
|
|
|
|
|
|
2019-08-07 08:50:22 +03:00
|
|
|
|
|
|
|
|
|
2019-07-09 15:22:14 +02:00
|
|
|
|
2023-06-01 16:47:43 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-07 08:50:22 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-06-01 16:47:43 +08:00
|
|
|
|
2019-08-07 08:50:22 +03:00
|
|
|
|
|
|
|
|
|
2019-07-09 15:22:14 +02:00
|
|
|
|
|
|
|
|
|
2020-01-03 09:20:22 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-03-21 16:06:50 -07:00
|
|
|
|
|
|
|
|
|
2020-01-03 09:20:22 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-03-21 16:06:50 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-01-03 09:20:22 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-03-21 16:06:50 -07:00
|
|
|
|
|
|
|
|
|
2020-01-03 09:20:22 +01:00
|
|
|
|
|
|
|
|
|
2026-03-21 16:06:50 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-01-03 09:20:22 +01:00
|
|
|
|
2026-03-21 16:06:50 -07:00
|
|
|
|
|
|
|
|
|
2020-01-03 09:20:22 +01:00
|
|
|
|
|
|
|
|
|
2026-03-21 16:06:50 -07:00
|
|
|
|
2020-01-03 09:20:22 +01:00
|
|
|
|
|
|
|
|
|
2026-03-21 16:06:50 -07:00
|
|
|
|
|
|
|
|
|
2020-01-03 09:20:22 +01:00
|
|
|
|
|
|
|
|
|
2023-02-07 20:22:58 +01:00
|
|
|
|
2020-01-03 09:20:22 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-02-07 20:22:58 +01:00
|
|
|
|
2020-01-03 09:20:22 +01:00
|
|
|
|
2023-02-07 20:22:58 +01:00
|
|
|
|
2020-01-03 09:20:22 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-01-31 19:47:36 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-01-03 09:20:22 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-01-31 19:47:36 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-01-03 09:20:22 +01:00
|
|
|
|
|
|
|
|
|
2023-02-07 20:22:58 +01:00
|
|
|
|
2026-03-21 16:06:50 -07:00
|
|
|
|
|
|
|
|
|
2020-01-03 09:20:22 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-03-21 16:06:50 -07:00
|
|
|
|
|
|
|
|
|
2020-01-03 09:20:22 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-03-29 13:49:52 -07:00
|
|
|
|
|
|
|
|
|
2020-01-03 09:20:22 +01:00
|
|
|
|
|
|
|
|
|
2026-03-21 16:06:50 -07:00
|
|
|
|
2020-01-03 09:20:22 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-03-21 16:06:50 -07:00
|
|
|
|
2020-01-03 09:20:22 +01:00
|
|
|
|
|
|
|
|
|
2026-03-21 16:06:51 -07:00
|
|
|
|
2020-01-03 09:20:22 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-03-21 16:06:50 -07:00
|
|
|
|
2020-01-03 09:20:22 +01:00
|
|
|
|
|
|
|
|
|
2015-11-29 14:09:19 +01:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-11-29 14:09:19 +01:00
|
|
|
|
2009-12-10 23:52:25 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-06-06 09:07:01 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-11-29 14:09:19 +01:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-11-29 14:09:19 +01:00
|
|
|
|
2006-09-03 08:56:39 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2015-11-29 14:09:19 +01:00
|
|
|
|
2007-05-09 02:32:55 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-11-29 14:09:19 +01:00
|
|
|
|
2011-01-13 19:59:55 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-11-29 14:09:19 +01:00
|
|
|
|
2013-10-28 23:21:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-11-21 23:22:48 +01:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-11-21 23:22:48 +01:00
|
|
|
|
2019-07-09 15:22:14 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-11-21 23:22:48 +01:00
|
|
|
|
2020-01-03 09:20:22 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-16 15:39:40 +01:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-16 15:39:40 +01:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-07-08 22:06:58 +02:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-07-08 22:06:58 +02:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
2025-01-20 16:29:48 +08:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-15 16:23:43 +02:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
2024-06-13 10:48:14 +02:00
|
|
|
|
2024-06-13 10:48:15 +02:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-06-30 14:35:45 +05:30
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-06-30 14:35:45 +05:30
|
|
|
|
2017-04-18 16:51:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
2017-03-16 15:39:40 +01:00
|
|
|
|
2024-07-08 22:06:58 +02:00
|
|
|
|
2019-05-15 16:23:43 +02:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-15 16:23:43 +02:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
2024-07-08 22:06:58 +02:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-10-19 22:42:37 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-02-08 02:10:41 +00:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-10-11 15:45:43 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-07-27 15:08:05 +01:00
|
|
|
|
2025-01-20 16:29:51 +08:00
|
|
|
|
2008-02-08 02:11:09 +00:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2009-03-16 17:44:33 +00:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
2009-03-16 17:44:33 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
2009-03-16 17:44:33 +00:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
2009-03-16 17:44:33 +00:00
|
|
|
|
|
|
|
|
|
2011-01-13 19:59:54 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-16 15:39:40 +01:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-01-13 19:59:54 +00:00
|
|
|
|
|
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-04-04 18:33:34 +02:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-02-01 23:42:29 +01:00
|
|
|
|
2019-04-04 18:33:34 +02:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-02-01 23:42:29 +01:00
|
|
|
|
2023-01-31 19:47:36 +01:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-07-08 22:06:58 +02:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-02-08 02:11:04 +00:00
|
|
|
|
2013-10-11 15:45:43 -07:00
|
|
|
|
|
|
|
|
|
2008-02-08 02:11:14 +00:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
2019-04-04 18:33:34 +02:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-02-08 02:11:04 +00:00
|
|
|
|
2017-03-16 15:39:44 +01:00
|
|
|
|
2017-11-07 10:35:57 -05:00
|
|
|
|
2017-03-16 15:39:44 +01:00
|
|
|
|
2008-02-08 02:11:04 +00:00
|
|
|
|
2009-03-16 17:44:33 +00:00
|
|
|
|
2012-07-27 15:08:05 +01:00
|
|
|
|
2017-03-16 15:39:44 +01:00
|
|
|
|
2017-03-23 10:23:14 -04:00
|
|
|
|
2009-03-16 17:44:33 +00:00
|
|
|
|
2008-02-08 02:11:04 +00:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
2008-02-08 02:11:04 +00:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-16 15:39:44 +01:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-16 15:39:44 +01:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
2008-02-08 02:11:04 +00:00
|
|
|
|
2008-02-08 02:11:14 +00:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-02-08 02:11:14 +00:00
|
|
|
|
|
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-16 15:39:44 +01:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
2024-07-08 22:06:58 +02:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
2024-07-08 22:06:58 +02:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
2017-03-16 15:39:44 +01:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-15 16:22:30 +02:00
|
|
|
|
2021-09-04 11:59:30 +02:00
|
|
|
|
|
|
|
|
|
2024-02-19 21:31:11 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-15 16:22:30 +02:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
2026-03-29 13:49:52 -07:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
2017-03-16 15:39:44 +01:00
|
|
|
|
|
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-04-04 18:33:34 +02:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
2017-03-16 15:39:44 +01:00
|
|
|
|
2017-11-07 10:35:57 -05:00
|
|
|
|
2017-03-16 15:39:44 +01:00
|
|
|
|
|
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
2017-03-16 15:39:44 +01:00
|
|
|
|
2017-03-23 10:23:14 -04:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-16 15:39:44 +01:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
2017-03-16 15:39:44 +01:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-01-03 09:20:22 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-16 15:39:44 +01:00
|
|
|
|
2008-02-08 02:11:14 +00:00
|
|
|
|
|
|
|
|
|
2016-01-24 21:16:36 +08:00
|
|
|
|
2008-02-08 02:11:14 +00:00
|
|
|
|
2016-01-24 21:16:36 +08:00
|
|
|
|
2008-02-08 02:11:14 +00:00
|
|
|
|
2011-01-13 19:59:54 +00:00
|
|
|
|
2026-03-29 13:49:52 -07:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
2017-03-16 15:39:44 +01:00
|
|
|
|
|
|
|
|
|
2011-01-13 19:59:54 +00:00
|
|
|
|
2008-02-08 02:11:14 +00:00
|
|
|
|
2008-02-08 02:11:04 +00:00
|
|
|
|
|
|
|
|
|
2023-02-06 18:22:34 +08:00
|
|
|
|
2011-01-13 19:59:53 +00:00
|
|
|
|
2021-01-04 14:59:48 +00:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
2008-02-08 02:11:07 +00:00
|
|
|
|
2023-01-25 21:14:58 +01:00
|
|
|
|
2011-01-13 19:59:53 +00:00
|
|
|
|
2021-01-04 14:59:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-01-13 19:59:53 +00:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
2015-05-15 17:00:25 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
2018-09-05 09:17:45 -04:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
2021-01-04 14:59:48 +00:00
|
|
|
|
|
|
|
|
|
2008-02-08 02:11:07 +00:00
|
|
|
|
|
|
|
|
|
2021-01-04 14:59:48 +00:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
2021-01-19 20:40:15 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-01-04 14:59:48 +00:00
|
|
|
|
|
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-09-05 09:17:45 -04:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
2021-01-04 14:59:48 +00:00
|
|
|
|
|
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
2021-01-04 14:59:48 +00:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
2017-03-16 15:39:40 +01:00
|
|
|
|
2021-01-04 14:59:48 +00:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
2021-01-04 14:59:48 +00:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-03-28 15:51:55 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-01-24 21:16:36 +08:00
|
|
|
|
2018-05-20 18:25:53 -04:00
|
|
|
|
2014-03-28 15:51:55 -04:00
|
|
|
|
|
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-05-20 18:25:53 -04:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-16 15:39:40 +01:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-06-03 09:38:06 +02:00
|
|
|
|
2021-01-04 14:59:47 +00:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2017-03-23 10:23:14 -04:00
|
|
|
|
2008-03-28 14:16:07 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2021-01-04 14:59:47 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-10-10 13:37:08 +01:00
|
|
|
|
2013-10-11 15:45:43 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2021-01-04 14:59:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-07-27 15:08:04 +01:00
|
|
|
|
2008-03-28 14:16:07 -07:00
|
|
|
|
2017-03-16 15:39:40 +01:00
|
|
|
|
2025-01-20 16:29:51 +08:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
2025-01-20 16:29:51 +08:00
|
|
|
|
2008-02-08 02:11:14 +00:00
|
|
|
|
|
|
|
|
|
2015-05-15 17:00:25 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-02-08 02:11:14 +00:00
|
|
|
|
2021-01-04 14:59:47 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-01-20 16:29:51 +08:00
|
|
|
|
2021-01-04 14:59:47 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-11-14 14:32:02 -08:00
|
|
|
|
2020-08-23 17:36:59 -05:00
|
|
|
|
2015-05-15 17:00:25 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Revert "dm crypt: fix deadlock when async crypto algorithm returns -EBUSY"
This reverts Linux 4.1-rc1 commit 0618764cb25f6fa9fb31152995de42a8a0496475.
The problem which that commit attempts to fix actually lies in the
Freescale CAAM crypto driver not dm-crypt.
dm-crypt uses CRYPTO_TFM_REQ_MAY_BACKLOG. This means the the crypto
driver should internally backlog requests which arrive when the queue is
full and process them later. Until the crypto hw's queue becomes full,
the driver returns -EINPROGRESS. When the crypto hw's queue if full,
the driver returns -EBUSY, and if CRYPTO_TFM_REQ_MAY_BACKLOG is set, is
expected to backlog the request and process it when the hardware has
queue space. At the point when the driver takes the request from the
backlog and starts processing it, it calls the completion function with
a status of -EINPROGRESS. The completion function is called (for a
second time, in the case of backlogged requests) with a status/err of 0
when a request is done.
Crypto drivers for hardware without hardware queueing use the helpers,
crypto_init_queue(), crypto_enqueue_request(), crypto_dequeue_request()
and crypto_get_backlog() helpers to implement this behaviour correctly,
while others implement this behaviour without these helpers (ccp, for
example).
dm-crypt (before the patch that needs reverting) uses this API
correctly. It queues up as many requests as the hw queues will allow
(i.e. as long as it gets back -EINPROGRESS from the request function).
Then, when it sees at least one backlogged request (gets -EBUSY), it
waits till that backlogged request is handled (completion gets called
with -EINPROGRESS), and then continues. The references to
af_alg_wait_for_completion() and af_alg_complete() in that commit's
commit message are irrelevant because those functions only handle one
request at a time, unlink dm-crypt.
The problem is that the Freescale CAAM driver, which that commit
describes as having being tested with, fails to implement the
backlogging behaviour correctly. In cam_jr_enqueue(), if the hardware
queue is full, it simply returns -EBUSY without backlogging the request.
What the observed deadlock was is not described in the commit message
but it is obviously the wait_for_completion() in crypto_convert() where
dm-crypto would wait for the completion being called with -EINPROGRESS
in the case of backlogged requests. This completion will never be
completed due to the bug in the CAAM driver.
Commit 0618764cb25 incorrectly made dm-crypt wait for every request,
even when the driver/hardware queues are not full, which means that
dm-crypt will never see -EBUSY. This means that that commit will cause
a performance regression on all crypto drivers which implement the API
correctly.
Revert it. Correct backlog handling should be implemented in the CAAM
driver instead.
Cc'ing stable purely because commit 0618764cb25 did. If for some reason
a stable@ kernel did pick up commit 0618764cb25 it should get reverted.
Signed-off-by: Rabin Vincent <rabin.vincent@axis.com>
Reviewed-by: Horia Geanta <horia.geanta@freescale.com>
Cc: stable@vger.kernel.org
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
2015-05-05 15:15:56 +02:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
2025-01-20 16:29:51 +08:00
|
|
|
|
2017-03-16 15:39:44 +01:00
|
|
|
|
2008-02-08 02:11:14 +00:00
|
|
|
|
2015-05-15 17:00:25 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-03-28 14:16:07 -07:00
|
|
|
|
2012-07-27 15:08:04 +01:00
|
|
|
|
2017-03-16 15:39:44 +01:00
|
|
|
|
2025-01-20 16:29:51 +08:00
|
|
|
|
dm crypt: add flags to optionally bypass kcryptd workqueues
This is a follow up to [1] that detailed latency problems associated
with dm-crypt's use of workqueues when processing IO.
Current dm-crypt implementation creates a significant IO performance
overhead (at least on small IO block sizes) for both latency and
throughput. We suspect offloading IO request processing into
workqueues and async threads is more harmful these days with the
modern fast storage. I also did some digging into the dm-crypt git
history and much of this async processing is not needed anymore,
because the reasons it was added are mostly gone from the kernel. More
details can be found in [2] (see "Git archeology" section).
This change adds DM_CRYPT_NO_READ_WORKQUEUE and
DM_CRYPT_NO_WRITE_WORKQUEUE flags for read and write BIOs, which
direct dm-crypt to not offload crypto operations into kcryptd
workqueues. In addition, writes are not buffered to be sorted in the
dm-crypt red-black tree, but dispatched immediately. For cases, where
crypto operations cannot happen (hard interrupt context, for example
the read path of some NVME drivers), we offload the work to a tasklet
rather than a workqueue.
These flags only ensure no async BIO processing in the dm-crypt
module. It is worth noting that some Crypto API implementations may
offload encryption into their own workqueues, which are independent of
the dm-crypt and its configuration. However upon enabling these new
flags dm-crypt will instruct Crypto API not to backlog crypto
requests.
To give an idea of the performance gains for certain workloads,
consider the script, and results when tested against various
devices, detailed here:
https://www.redhat.com/archives/dm-devel/2020-July/msg00138.html
[1]: https://www.spinics.net/lists/dm-crypt/msg07516.html
[2]: https://blog.cloudflare.com/speeding-up-linux-disk-encryption/
Signed-off-by: Ignat Korchagin <ignat@cloudflare.com>
Reviewed-by: Damien Le Moal <damien.lemoal@wdc.com>
Reviewed-by: Bob Liu <bob.liu@oracle.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
2020-07-06 18:37:31 +01:00
|
|
|
|
|
|
|
|
|
2008-03-28 14:16:07 -07:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-06-03 09:38:06 +02:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-03-28 14:16:07 -07:00
|
|
|
|
2012-07-27 15:08:04 +01:00
|
|
|
|
2017-06-03 09:38:06 +02:00
|
|
|
|
2008-03-28 14:16:07 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2008-03-28 14:16:07 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2015-02-13 08:23:52 -05:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2024-04-11 15:08:05 -04:00
|
|
|
|
|
|
|
|
|
2015-02-13 08:24:41 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-05-01 09:19:17 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2023-01-25 21:14:58 +01:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2012-07-27 15:08:05 +01:00
|
|
|
|
2006-10-03 01:15:37 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2015-02-13 08:24:41 -05:00
|
|
|
|
2023-05-01 09:19:17 -04:00
|
|
|
|
2023-12-28 17:47:04 +03:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2015-02-13 08:24:41 -05:00
|
|
|
|
2015-11-06 16:28:21 -08:00
|
|
|
|
2015-02-13 08:24:41 -05:00
|
|
|
|
|
|
|
|
|
2022-01-24 10:11:03 +01:00
|
|
|
|
|
|
|
|
|
2022-01-24 10:10:54 +01:00
|
|
|
|
|
|
|
|
|
2024-01-24 13:35:56 +08:00
|
|
|
|
2025-01-20 16:29:47 +08:00
|
|
|
|
2006-10-03 01:15:40 -07:00
|
|
|
|
2015-02-13 08:24:41 -05:00
|
|
|
|
|
|
|
|
|
2023-05-01 09:19:17 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-10-31 19:12:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-05-01 09:19:17 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-10-31 19:12:54 +01:00
|
|
|
|
|
|
|
|
|
2023-05-01 09:19:17 -04:00
|
|
|
|
2023-10-31 19:12:54 +01:00
|
|
|
|
|
|
|
|
|
2023-05-01 09:19:17 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-13 08:24:41 -05:00
|
|
|
|
|
|
|
|
|
2015-11-06 16:28:21 -08:00
|
|
|
|
2023-05-01 09:19:17 -04:00
|
|
|
|
2015-02-13 08:24:41 -05:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2023-05-01 09:19:17 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-01-24 10:10:53 +01:00
|
|
|
|
2015-11-06 16:28:21 -08:00
|
|
|
|
2015-02-13 08:24:41 -05:00
|
|
|
|
|
|
|
|
|
2006-10-03 01:15:37 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2007-10-16 13:48:46 +02:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2023-05-01 09:19:17 -04:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2023-05-01 09:19:17 -04:00
|
|
|
|
|
|
|
|
|
2023-10-31 19:12:54 +01:00
|
|
|
|
|
|
|
|
|
2025-10-04 00:19:12 -03:00
|
|
|
|
2023-05-01 09:19:17 -04:00
|
|
|
|
2023-10-31 19:12:54 +01:00
|
|
|
|
2023-05-01 09:19:17 -04:00
|
|
|
|
2023-10-31 19:12:54 +01:00
|
|
|
|
2023-05-01 09:19:17 -04:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-03-28 15:51:55 -04:00
|
|
|
|
|
|
|
|
|
2008-10-10 13:37:03 +01:00
|
|
|
|
2012-07-27 15:08:05 +01:00
|
|
|
|
2008-10-10 13:37:03 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-02-19 21:31:11 +01:00
|
|
|
|
|
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-07-27 15:08:04 +01:00
|
|
|
|
2008-10-10 13:37:03 +01:00
|
|
|
|
|
|
|
|
|
2008-10-10 13:37:02 +01:00
|
|
|
|
|
|
|
|
|
2012-07-27 15:08:04 +01:00
|
|
|
|
2008-10-10 13:37:02 +01:00
|
|
|
|
|
|
|
|
|
2024-02-19 21:31:11 +01:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-02-08 02:10:43 +00:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2012-07-27 15:08:05 +01:00
|
|
|
|
2009-03-16 17:44:36 +00:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2012-07-27 15:08:04 +01:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2024-02-19 21:31:11 +01:00
|
|
|
|
2024-07-08 22:06:58 +02:00
|
|
|
|
2024-02-19 21:31:11 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-05-20 18:25:53 -04:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
2009-03-16 17:44:36 +00:00
|
|
|
|
2026-08-26 00:25:33 +00:00
|
|
|
|
dm crypt: do not call bio_endio() from the dm-crypt tasklet
Sometimes, when dm-crypt executes decryption in a tasklet, we may get
"BUG: KASAN: use-after-free in tasklet_action_common.constprop..."
with a kasan-enabled kernel.
When the decryption fully completes in the tasklet, dm-crypt will call
bio_endio(), which in turn will call clone_endio() from dm.c core code. That
function frees the resources associated with the bio, including per bio private
structures. For dm-crypt it will free the current struct dm_crypt_io, which
contains our tasklet object, causing use-after-free, when the tasklet is being
dequeued by the kernel.
To avoid this, do not call bio_endio() from the current tasklet context, but
delay its execution to the dm-crypt IO workqueue.
Fixes: 39d42fa96ba1 ("dm crypt: add flags to optionally bypass kcryptd workqueues")
Cc: <stable@vger.kernel.org> # v5.9+
Signed-off-by: Ignat Korchagin <ignat@cloudflare.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
2021-01-09 15:17:06 +00:00
|
|
|
|
2023-03-08 14:39:54 -05:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-10-19 22:38:58 +01:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2006-10-03 01:15:39 -07:00
|
|
|
|
2007-10-19 22:38:58 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-01-13 19:59:53 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2015-07-20 15:29:37 +02:00
|
|
|
|
2006-10-03 01:15:37 -07:00
|
|
|
|
2007-07-12 17:26:32 +01:00
|
|
|
|
2012-07-27 15:08:05 +01:00
|
|
|
|
2023-01-25 21:14:58 +01:00
|
|
|
|
2024-02-19 21:31:11 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-10-03 01:15:37 -07:00
|
|
|
|
|
|
|
|
|
2007-09-27 12:47:43 +02:00
|
|
|
|
2006-10-03 01:15:37 -07:00
|
|
|
|
2024-02-19 21:31:11 +01:00
|
|
|
|
2007-10-16 13:48:46 +02:00
|
|
|
|
2008-02-08 02:10:46 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-08-10 19:05:18 -04:00
|
|
|
|
2008-02-08 02:10:46 +00:00
|
|
|
|
|
|
|
|
|
2007-09-27 12:47:43 +02:00
|
|
|
|
2006-10-03 01:15:37 -07:00
|
|
|
|
2015-08-10 19:05:18 -04:00
|
|
|
|
|
|
|
|
|
2008-02-08 02:10:43 +00:00
|
|
|
|
|
|
|
|
|
2006-10-03 01:15:37 -07:00
|
|
|
|
|
|
|
|
|
2022-02-17 23:40:35 -05:00
|
|
|
|
|
|
|
|
|
2011-01-13 19:59:53 +00:00
|
|
|
|
2006-10-03 01:15:37 -07:00
|
|
|
|
2012-07-27 15:08:05 +01:00
|
|
|
|
2006-10-03 01:15:37 -07:00
|
|
|
|
2006-10-03 01:15:38 -07:00
|
|
|
|
2024-02-19 21:31:11 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-10-03 01:15:37 -07:00
|
|
|
|
2022-02-02 17:01:09 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-10-03 01:15:37 -07:00
|
|
|
|
2022-02-02 17:01:09 +01:00
|
|
|
|
2011-03-10 08:52:07 +01:00
|
|
|
|
2011-01-13 19:59:53 +00:00
|
|
|
|
2025-01-20 16:29:47 +08:00
|
|
|
|
|
|
|
|
|
2022-01-24 10:10:54 +01:00
|
|
|
|
|
|
|
|
|
2006-10-03 01:15:37 -07:00
|
|
|
|
2011-01-13 19:59:53 +00:00
|
|
|
|
|
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-03-10 11:45:58 -05:00
|
|
|
|
2011-01-13 19:59:53 +00:00
|
|
|
|
2006-10-03 01:15:37 -07:00
|
|
|
|
|
|
|
|
|
2015-02-13 08:25:59 -05:00
|
|
|
|
2008-02-08 02:10:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-13 08:25:59 -05:00
|
|
|
|
|
|
|
|
|
2017-06-03 09:38:06 +02:00
|
|
|
|
2015-02-13 08:25:59 -05:00
|
|
|
|
2008-02-08 02:10:52 +00:00
|
|
|
|
|
|
|
|
|
2015-02-13 08:25:59 -05:00
|
|
|
|
2008-02-08 02:10:52 +00:00
|
|
|
|
2012-07-27 15:08:05 +01:00
|
|
|
|
2008-02-08 02:10:52 +00:00
|
|
|
|
2015-02-13 08:25:59 -05:00
|
|
|
|
2008-02-08 02:10:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-13 08:25:59 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-03-10 11:45:58 -05:00
|
|
|
|
2015-02-13 08:25:59 -05:00
|
|
|
|
|
|
|
|
|
2015-02-13 08:27:41 -05:00
|
|
|
|
|
|
|
|
|
2015-02-13 08:25:59 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-13 08:27:41 -05:00
|
|
|
|
|
|
|
|
|
2015-02-13 08:25:59 -05:00
|
|
|
|
2015-02-13 08:27:41 -05:00
|
|
|
|
2015-02-13 08:25:59 -05:00
|
|
|
|
|
|
|
|
|
2018-07-11 12:10:51 -04:00
|
|
|
|
2015-02-13 08:25:59 -05:00
|
|
|
|
|
|
|
|
|
2015-02-13 08:27:41 -05:00
|
|
|
|
2015-02-13 08:25:59 -05:00
|
|
|
|
|
|
|
|
|
2016-09-21 16:22:29 +02:00
|
|
|
|
2015-02-13 08:25:59 -05:00
|
|
|
|
2018-07-11 12:10:51 -04:00
|
|
|
|
2015-02-13 08:25:59 -05:00
|
|
|
|
2016-09-21 16:22:29 +02:00
|
|
|
|
sched/core: Remove set_task_state()
This is a nasty interface and setting the state of a foreign task must
not be done. As of the following commit:
be628be0956 ("bcache: Make gc wakeup sane, remove set_task_state()")
... everyone in the kernel calls set_task_state() with current, allowing
the helper to be removed.
However, as the comment indicates, it is still around for those archs
where computing current is more expensive than using a pointer, at least
in theory. An important arch that is affected is arm64, however this has
been addressed now [1] and performance is up to par making no difference
with either calls.
Of all the callers, if any, it's the locking bits that would care most
about this -- ie: we end up passing a tsk pointer to a lot of the lock
slowpath, and setting ->state on that. The following numbers are based
on two tests: a custom ad-hoc microbenchmark that just measures
latencies (for ~65 million calls) between get_task_state() vs
get_current_state().
Secondly for a higher overview, an unlink microbenchmark was used,
which pounds on a single file with open, close,unlink combos with
increasing thread counts (up to 4x ncpus). While the workload is quite
unrealistic, it does contend a lot on the inode mutex or now rwsem.
[1] https://lkml.kernel.org/r/1483468021-8237-1-git-send-email-mark.rutland@arm.com
== 1. x86-64 ==
Avg runtime set_task_state(): 601 msecs
Avg runtime set_current_state(): 552 msecs
vanilla dirty
Hmean unlink1-processes-2 36089.26 ( 0.00%) 38977.33 ( 8.00%)
Hmean unlink1-processes-5 28555.01 ( 0.00%) 29832.55 ( 4.28%)
Hmean unlink1-processes-8 37323.75 ( 0.00%) 44974.57 ( 20.50%)
Hmean unlink1-processes-12 43571.88 ( 0.00%) 44283.01 ( 1.63%)
Hmean unlink1-processes-21 34431.52 ( 0.00%) 38284.45 ( 11.19%)
Hmean unlink1-processes-30 34813.26 ( 0.00%) 37975.17 ( 9.08%)
Hmean unlink1-processes-48 37048.90 ( 0.00%) 39862.78 ( 7.59%)
Hmean unlink1-processes-79 35630.01 ( 0.00%) 36855.30 ( 3.44%)
Hmean unlink1-processes-110 36115.85 ( 0.00%) 39843.91 ( 10.32%)
Hmean unlink1-processes-141 32546.96 ( 0.00%) 35418.52 ( 8.82%)
Hmean unlink1-processes-172 34674.79 ( 0.00%) 36899.21 ( 6.42%)
Hmean unlink1-processes-203 37303.11 ( 0.00%) 36393.04 ( -2.44%)
Hmean unlink1-processes-224 35712.13 ( 0.00%) 36685.96 ( 2.73%)
== 2. ppc64le ==
Avg runtime set_task_state(): 938 msecs
Avg runtime set_current_state: 940 msecs
vanilla dirty
Hmean unlink1-processes-2 19269.19 ( 0.00%) 30704.50 ( 59.35%)
Hmean unlink1-processes-5 20106.15 ( 0.00%) 21804.15 ( 8.45%)
Hmean unlink1-processes-8 17496.97 ( 0.00%) 17243.28 ( -1.45%)
Hmean unlink1-processes-12 14224.15 ( 0.00%) 17240.21 ( 21.20%)
Hmean unlink1-processes-21 14155.66 ( 0.00%) 15681.23 ( 10.78%)
Hmean unlink1-processes-30 14450.70 ( 0.00%) 15995.83 ( 10.69%)
Hmean unlink1-processes-48 16945.57 ( 0.00%) 16370.42 ( -3.39%)
Hmean unlink1-processes-79 15788.39 ( 0.00%) 14639.27 ( -7.28%)
Hmean unlink1-processes-110 14268.48 ( 0.00%) 14377.40 ( 0.76%)
Hmean unlink1-processes-141 14023.65 ( 0.00%) 16271.69 ( 16.03%)
Hmean unlink1-processes-172 13417.62 ( 0.00%) 16067.55 ( 19.75%)
Hmean unlink1-processes-203 15293.08 ( 0.00%) 15440.40 ( 0.96%)
Hmean unlink1-processes-234 13719.32 ( 0.00%) 16190.74 ( 18.01%)
Hmean unlink1-processes-265 16400.97 ( 0.00%) 16115.22 ( -1.74%)
Hmean unlink1-processes-296 14388.60 ( 0.00%) 16216.13 ( 12.70%)
Hmean unlink1-processes-320 15771.85 ( 0.00%) 15905.96 ( 0.85%)
x86-64 (known to be fast for get_current()/this_cpu_read_stable() caching)
and ppc64 (with paca) show similar improvements in the unlink microbenches.
The small delta for ppc64 (2ms), does not represent the gains on the unlink
runs. In the case of x86, there was a decent amount of variation in the
latency runs, but always within a 20 to 50ms increase), ppc was more constant.
Signed-off-by: Davidlohr Bueso <dbueso@suse.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: dave@stgolabs.net
Cc: mark.rutland@arm.com
Link: http://lkml.kernel.org/r/1483479794-14013-5-git-send-email-dave@stgolabs.net
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2017-01-03 13:43:14 -08:00
|
|
|
|
2016-09-21 16:22:29 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-13 08:25:59 -05:00
|
|
|
|
|
|
|
|
|
2018-07-11 12:10:51 -04:00
|
|
|
|
2015-02-13 08:25:59 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-13 08:27:41 -05:00
|
|
|
|
|
|
|
|
|
2018-07-11 12:10:51 -04:00
|
|
|
|
2015-02-13 08:25:59 -05:00
|
|
|
|
2015-02-13 08:27:41 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-13 08:25:59 -05:00
|
|
|
|
|
|
|
|
|
2015-02-13 08:27:41 -05:00
|
|
|
|
|
|
|
|
|
2015-02-13 08:25:59 -05:00
|
|
|
|
2023-03-06 11:17:58 -05:00
|
|
|
|
2015-02-13 08:27:41 -05:00
|
|
|
|
2015-02-13 08:25:59 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-03-28 18:41:22 +01:00
|
|
|
|
2008-02-08 02:10:49 +00:00
|
|
|
|
2008-02-08 02:10:57 +00:00
|
|
|
|
2012-07-27 15:08:05 +01:00
|
|
|
|
2015-02-13 08:25:59 -05:00
|
|
|
|
2015-02-13 08:27:41 -05:00
|
|
|
|
|
|
|
|
|
2008-02-08 02:10:57 +00:00
|
|
|
|
2017-06-03 09:38:06 +02:00
|
|
|
|
2008-02-08 02:10:57 +00:00
|
|
|
|
|
|
|
|
|
2008-10-10 13:37:06 +01:00
|
|
|
|
2008-02-08 02:10:57 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-10-11 15:45:43 -07:00
|
|
|
|
2008-02-08 02:10:57 +00:00
|
|
|
|
dm crypt: add flags to optionally bypass kcryptd workqueues
This is a follow up to [1] that detailed latency problems associated
with dm-crypt's use of workqueues when processing IO.
Current dm-crypt implementation creates a significant IO performance
overhead (at least on small IO block sizes) for both latency and
throughput. We suspect offloading IO request processing into
workqueues and async threads is more harmful these days with the
modern fast storage. I also did some digging into the dm-crypt git
history and much of this async processing is not needed anymore,
because the reasons it was added are mostly gone from the kernel. More
details can be found in [2] (see "Git archeology" section).
This change adds DM_CRYPT_NO_READ_WORKQUEUE and
DM_CRYPT_NO_WRITE_WORKQUEUE flags for read and write BIOs, which
direct dm-crypt to not offload crypto operations into kcryptd
workqueues. In addition, writes are not buffered to be sorted in the
dm-crypt red-black tree, but dispatched immediately. For cases, where
crypto operations cannot happen (hard interrupt context, for example
the read path of some NVME drivers), we offload the work to a tasklet
rather than a workqueue.
These flags only ensure no async BIO processing in the dm-crypt
module. It is worth noting that some Crypto API implementations may
offload encryption into their own workqueues, which are independent of
the dm-crypt and its configuration. However upon enabling these new
flags dm-crypt will instruct Crypto API not to backlog crypto
requests.
To give an idea of the performance gains for certain workloads,
consider the script, and results when tested against various
devices, detailed here:
https://www.redhat.com/archives/dm-devel/2020-July/msg00138.html
[1]: https://www.spinics.net/lists/dm-crypt/msg07516.html
[2]: https://blog.cloudflare.com/speeding-up-linux-disk-encryption/
Signed-off-by: Ignat Korchagin <ignat@cloudflare.com>
Reviewed-by: Damien Le Moal <damien.lemoal@wdc.com>
Reviewed-by: Bob Liu <bob.liu@oracle.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
2020-07-06 18:37:31 +01:00
|
|
|
|
|
|
|
|
|
2022-03-10 11:45:58 -05:00
|
|
|
|
2015-02-13 08:27:08 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-07-11 12:10:51 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-13 08:27:41 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-07-11 12:10:51 -04:00
|
|
|
|
2008-02-08 02:10:49 +00:00
|
|
|
|
|
|
|
|
|
2020-07-08 18:28:08 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-01-04 14:59:47 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-01-20 16:29:46 +08:00
|
|
|
|
2021-01-04 14:59:47 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-01-20 16:29:49 +08:00
|
|
|
|
2021-01-04 14:59:47 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-10-10 13:37:04 +01:00
|
|
|
|
2006-10-03 01:15:37 -07:00
|
|
|
|
2012-07-27 15:08:05 +01:00
|
|
|
|
2020-07-08 18:28:08 +09:00
|
|
|
|
2006-10-03 01:15:37 -07:00
|
|
|
|
2008-10-10 13:37:08 +01:00
|
|
|
|
2017-06-03 09:38:06 +02:00
|
|
|
|
2006-10-03 01:15:37 -07:00
|
|
|
|
2008-10-10 13:37:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-01-20 16:29:49 +08:00
|
|
|
|
2008-10-10 13:37:04 +01:00
|
|
|
|
2015-02-13 08:23:52 -05:00
|
|
|
|
|
|
|
|
|
2017-06-03 09:38:06 +02:00
|
|
|
|
2015-02-13 08:23:52 -05:00
|
|
|
|
2006-10-03 01:15:37 -07:00
|
|
|
|
2008-02-08 02:11:02 +00:00
|
|
|
|
2015-02-13 08:23:52 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-02-19 21:30:10 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-13 08:23:52 -05:00
|
|
|
|
2020-07-08 18:28:08 +09:00
|
|
|
|
2021-01-04 14:59:47 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-06-03 09:38:06 +02:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
2020-07-08 18:28:08 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-02-13 08:23:52 -05:00
|
|
|
|
|
|
|
|
|
2025-01-20 16:29:49 +08:00
|
|
|
|
2015-02-13 08:23:52 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-02-08 02:11:02 +00:00
|
|
|
|
2008-02-08 02:10:59 +00:00
|
|
|
|
|
|
|
|
|
2012-03-28 18:41:22 +01:00
|
|
|
|
2008-02-08 02:10:43 +00:00
|
|
|
|
2024-02-19 21:31:11 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-02-08 02:10:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-01-04 14:59:47 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-01-20 16:29:46 +08:00
|
|
|
|
2021-01-04 14:59:47 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-02-08 02:10:49 +00:00
|
|
|
|
2006-10-03 01:15:37 -07:00
|
|
|
|
2012-07-27 15:08:05 +01:00
|
|
|
|
2017-06-03 09:38:06 +02:00
|
|
|
|
2006-10-03 01:15:37 -07:00
|
|
|
|
2008-10-10 13:37:02 +01:00
|
|
|
|
2008-02-08 02:11:14 +00:00
|
|
|
|
2024-02-19 21:31:11 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-10-03 01:15:37 -07:00
|
|
|
|
2024-02-19 21:31:11 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-01-04 14:59:47 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-06-03 09:38:06 +02:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
2008-02-08 02:10:43 +00:00
|
|
|
|
2012-07-27 15:08:04 +01:00
|
|
|
|
2012-03-28 18:41:22 +01:00
|
|
|
|
2008-02-08 02:11:14 +00:00
|
|
|
|
|
|
|
|
|
2006-10-03 01:15:37 -07:00
|
|
|
|
|
|
|
|
|
2023-02-06 18:22:34 +08:00
|
|
|
|
2008-02-08 02:11:12 +00:00
|
|
|
|
2023-02-06 18:22:34 +08:00
|
|
|
|
2009-03-16 17:44:33 +00:00
|
|
|
|
2008-02-08 02:11:12 +00:00
|
|
|
|
2012-07-27 15:08:05 +01:00
|
|
|
|
2008-02-08 02:11:12 +00:00
|
|
|
|
2015-05-15 17:00:25 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Revert "dm crypt: fix deadlock when async crypto algorithm returns -EBUSY"
This reverts Linux 4.1-rc1 commit 0618764cb25f6fa9fb31152995de42a8a0496475.
The problem which that commit attempts to fix actually lies in the
Freescale CAAM crypto driver not dm-crypt.
dm-crypt uses CRYPTO_TFM_REQ_MAY_BACKLOG. This means the the crypto
driver should internally backlog requests which arrive when the queue is
full and process them later. Until the crypto hw's queue becomes full,
the driver returns -EINPROGRESS. When the crypto hw's queue if full,
the driver returns -EBUSY, and if CRYPTO_TFM_REQ_MAY_BACKLOG is set, is
expected to backlog the request and process it when the hardware has
queue space. At the point when the driver takes the request from the
backlog and starts processing it, it calls the completion function with
a status of -EINPROGRESS. The completion function is called (for a
second time, in the case of backlogged requests) with a status/err of 0
when a request is done.
Crypto drivers for hardware without hardware queueing use the helpers,
crypto_init_queue(), crypto_enqueue_request(), crypto_dequeue_request()
and crypto_get_backlog() helpers to implement this behaviour correctly,
while others implement this behaviour without these helpers (ccp, for
example).
dm-crypt (before the patch that needs reverting) uses this API
correctly. It queues up as many requests as the hw queues will allow
(i.e. as long as it gets back -EINPROGRESS from the request function).
Then, when it sees at least one backlogged request (gets -EBUSY), it
waits till that backlogged request is handled (completion gets called
with -EINPROGRESS), and then continues. The references to
af_alg_wait_for_completion() and af_alg_complete() in that commit's
commit message are irrelevant because those functions only handle one
request at a time, unlink dm-crypt.
The problem is that the Freescale CAAM driver, which that commit
describes as having being tested with, fails to implement the
backlogging behaviour correctly. In cam_jr_enqueue(), if the hardware
queue is full, it simply returns -EBUSY without backlogging the request.
What the observed deadlock was is not described in the commit message
but it is obviously the wait_for_completion() in crypto_convert() where
dm-crypto would wait for the completion being called with -EINPROGRESS
in the case of backlogged requests. This completion will never be
completed due to the bug in the CAAM driver.
Commit 0618764cb25 incorrectly made dm-crypt wait for every request,
even when the driver/hardware queues are not full, which means that
dm-crypt will never see -EBUSY. This means that that commit will cause
a performance regression on all crypto drivers which implement the API
correctly.
Revert it. Correct backlog handling should be implemented in the CAAM
driver instead.
Cc'ing stable purely because commit 0618764cb25 did. If for some reason
a stable@ kernel did pick up commit 0618764cb25 it should get reverted.
Signed-off-by: Rabin Vincent <rabin.vincent@axis.com>
Reviewed-by: Horia Geanta <horia.geanta@freescale.com>
Cc: stable@vger.kernel.org
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
2015-05-05 15:15:56 +02:00
|
|
|
|
|
|
|
|
|
2008-02-08 02:11:12 +00:00
|
|
|
|
Revert "dm crypt: fix deadlock when async crypto algorithm returns -EBUSY"
This reverts Linux 4.1-rc1 commit 0618764cb25f6fa9fb31152995de42a8a0496475.
The problem which that commit attempts to fix actually lies in the
Freescale CAAM crypto driver not dm-crypt.
dm-crypt uses CRYPTO_TFM_REQ_MAY_BACKLOG. This means the the crypto
driver should internally backlog requests which arrive when the queue is
full and process them later. Until the crypto hw's queue becomes full,
the driver returns -EINPROGRESS. When the crypto hw's queue if full,
the driver returns -EBUSY, and if CRYPTO_TFM_REQ_MAY_BACKLOG is set, is
expected to backlog the request and process it when the hardware has
queue space. At the point when the driver takes the request from the
backlog and starts processing it, it calls the completion function with
a status of -EINPROGRESS. The completion function is called (for a
second time, in the case of backlogged requests) with a status/err of 0
when a request is done.
Crypto drivers for hardware without hardware queueing use the helpers,
crypto_init_queue(), crypto_enqueue_request(), crypto_dequeue_request()
and crypto_get_backlog() helpers to implement this behaviour correctly,
while others implement this behaviour without these helpers (ccp, for
example).
dm-crypt (before the patch that needs reverting) uses this API
correctly. It queues up as many requests as the hw queues will allow
(i.e. as long as it gets back -EINPROGRESS from the request function).
Then, when it sees at least one backlogged request (gets -EBUSY), it
waits till that backlogged request is handled (completion gets called
with -EINPROGRESS), and then continues. The references to
af_alg_wait_for_completion() and af_alg_complete() in that commit's
commit message are irrelevant because those functions only handle one
request at a time, unlink dm-crypt.
The problem is that the Freescale CAAM driver, which that commit
describes as having being tested with, fails to implement the
backlogging behaviour correctly. In cam_jr_enqueue(), if the hardware
queue is full, it simply returns -EBUSY without backlogging the request.
What the observed deadlock was is not described in the commit message
but it is obviously the wait_for_completion() in crypto_convert() where
dm-crypto would wait for the completion being called with -EINPROGRESS
in the case of backlogged requests. This completion will never be
completed due to the bug in the CAAM driver.
Commit 0618764cb25 incorrectly made dm-crypt wait for every request,
even when the driver/hardware queues are not full, which means that
dm-crypt will never see -EBUSY. This means that that commit will cause
a performance regression on all crypto drivers which implement the API
correctly.
Revert it. Correct backlog handling should be implemented in the CAAM
driver instead.
Cc'ing stable purely because commit 0618764cb25 did. If for some reason
a stable@ kernel did pick up commit 0618764cb25 it should get reverted.
Signed-off-by: Rabin Vincent <rabin.vincent@axis.com>
Reviewed-by: Horia Geanta <horia.geanta@freescale.com>
Cc: stable@vger.kernel.org
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
2015-05-05 15:15:56 +02:00
|
|
|
|
2008-02-08 02:11:12 +00:00
|
|
|
|
2011-01-13 19:59:54 +00:00
|
|
|
|
2026-03-29 13:49:52 -07:00
|
|
|
|
2011-01-13 19:59:54 +00:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
2021-09-04 11:59:30 +02:00
|
|
|
|
|
|
|
|
|
2024-02-19 21:31:11 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-06-03 09:38:06 +02:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
2017-06-03 09:38:06 +02:00
|
|
|
|
2012-03-28 18:41:22 +01:00
|
|
|
|
2014-03-28 15:51:55 -04:00
|
|
|
|
2008-02-08 02:11:12 +00:00
|
|
|
|
2012-07-27 15:08:04 +01:00
|
|
|
|
Revert "dm crypt: fix deadlock when async crypto algorithm returns -EBUSY"
This reverts Linux 4.1-rc1 commit 0618764cb25f6fa9fb31152995de42a8a0496475.
The problem which that commit attempts to fix actually lies in the
Freescale CAAM crypto driver not dm-crypt.
dm-crypt uses CRYPTO_TFM_REQ_MAY_BACKLOG. This means the the crypto
driver should internally backlog requests which arrive when the queue is
full and process them later. Until the crypto hw's queue becomes full,
the driver returns -EINPROGRESS. When the crypto hw's queue if full,
the driver returns -EBUSY, and if CRYPTO_TFM_REQ_MAY_BACKLOG is set, is
expected to backlog the request and process it when the hardware has
queue space. At the point when the driver takes the request from the
backlog and starts processing it, it calls the completion function with
a status of -EINPROGRESS. The completion function is called (for a
second time, in the case of backlogged requests) with a status/err of 0
when a request is done.
Crypto drivers for hardware without hardware queueing use the helpers,
crypto_init_queue(), crypto_enqueue_request(), crypto_dequeue_request()
and crypto_get_backlog() helpers to implement this behaviour correctly,
while others implement this behaviour without these helpers (ccp, for
example).
dm-crypt (before the patch that needs reverting) uses this API
correctly. It queues up as many requests as the hw queues will allow
(i.e. as long as it gets back -EINPROGRESS from the request function).
Then, when it sees at least one backlogged request (gets -EBUSY), it
waits till that backlogged request is handled (completion gets called
with -EINPROGRESS), and then continues. The references to
af_alg_wait_for_completion() and af_alg_complete() in that commit's
commit message are irrelevant because those functions only handle one
request at a time, unlink dm-crypt.
The problem is that the Freescale CAAM driver, which that commit
describes as having being tested with, fails to implement the
backlogging behaviour correctly. In cam_jr_enqueue(), if the hardware
queue is full, it simply returns -EBUSY without backlogging the request.
What the observed deadlock was is not described in the commit message
but it is obviously the wait_for_completion() in crypto_convert() where
dm-crypto would wait for the completion being called with -EINPROGRESS
in the case of backlogged requests. This completion will never be
completed due to the bug in the CAAM driver.
Commit 0618764cb25 incorrectly made dm-crypt wait for every request,
even when the driver/hardware queues are not full, which means that
dm-crypt will never see -EBUSY. This means that that commit will cause
a performance regression on all crypto drivers which implement the API
correctly.
Revert it. Correct backlog handling should be implemented in the CAAM
driver instead.
Cc'ing stable purely because commit 0618764cb25 did. If for some reason
a stable@ kernel did pick up commit 0618764cb25 it should get reverted.
Signed-off-by: Rabin Vincent <rabin.vincent@axis.com>
Reviewed-by: Horia Geanta <horia.geanta@freescale.com>
Cc: stable@vger.kernel.org
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
2015-05-05 15:15:56 +02:00
|
|
|
|
2008-02-08 02:11:12 +00:00
|
|
|
|
2020-07-08 18:28:08 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-03-28 18:41:22 +01:00
|
|
|
|
2020-07-08 18:28:08 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-02-08 02:11:12 +00:00
|
|
|
|
|
|
|
|
|
2008-02-08 02:10:49 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-10-03 01:15:37 -07:00
|
|
|
|
|
|
|
|
|
2008-02-08 02:10:52 +00:00
|
|
|
|
|
|
|
|
|
2012-07-27 15:08:05 +01:00
|
|
|
|
2008-02-08 02:10:52 +00:00
|
|
|
|
dm crypt: add flags to optionally bypass kcryptd workqueues
This is a follow up to [1] that detailed latency problems associated
with dm-crypt's use of workqueues when processing IO.
Current dm-crypt implementation creates a significant IO performance
overhead (at least on small IO block sizes) for both latency and
throughput. We suspect offloading IO request processing into
workqueues and async threads is more harmful these days with the
modern fast storage. I also did some digging into the dm-crypt git
history and much of this async processing is not needed anymore,
because the reasons it was added are mostly gone from the kernel. More
details can be found in [2] (see "Git archeology" section).
This change adds DM_CRYPT_NO_READ_WORKQUEUE and
DM_CRYPT_NO_WRITE_WORKQUEUE flags for read and write BIOs, which
direct dm-crypt to not offload crypto operations into kcryptd
workqueues. In addition, writes are not buffered to be sorted in the
dm-crypt red-black tree, but dispatched immediately. For cases, where
crypto operations cannot happen (hard interrupt context, for example
the read path of some NVME drivers), we offload the work to a tasklet
rather than a workqueue.
These flags only ensure no async BIO processing in the dm-crypt
module. It is worth noting that some Crypto API implementations may
offload encryption into their own workqueues, which are independent of
the dm-crypt and its configuration. However upon enabling these new
flags dm-crypt will instruct Crypto API not to backlog crypto
requests.
To give an idea of the performance gains for certain workloads,
consider the script, and results when tested against various
devices, detailed here:
https://www.redhat.com/archives/dm-devel/2020-July/msg00138.html
[1]: https://www.spinics.net/lists/dm-crypt/msg07516.html
[2]: https://blog.cloudflare.com/speeding-up-linux-disk-encryption/
Signed-off-by: Ignat Korchagin <ignat@cloudflare.com>
Reviewed-by: Damien Le Moal <damien.lemoal@wdc.com>
Reviewed-by: Bob Liu <bob.liu@oracle.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
2020-07-06 18:37:31 +01:00
|
|
|
|
|
|
|
|
|
2021-01-13 19:17:17 +00:00
|
|
|
|
2021-08-14 09:09:09 +08:00
|
|
|
|
2021-01-13 19:17:17 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-01-29 23:11:54 -10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-01-31 21:57:27 +01:00
|
|
|
|
dm crypt: add flags to optionally bypass kcryptd workqueues
This is a follow up to [1] that detailed latency problems associated
with dm-crypt's use of workqueues when processing IO.
Current dm-crypt implementation creates a significant IO performance
overhead (at least on small IO block sizes) for both latency and
throughput. We suspect offloading IO request processing into
workqueues and async threads is more harmful these days with the
modern fast storage. I also did some digging into the dm-crypt git
history and much of this async processing is not needed anymore,
because the reasons it was added are mostly gone from the kernel. More
details can be found in [2] (see "Git archeology" section).
This change adds DM_CRYPT_NO_READ_WORKQUEUE and
DM_CRYPT_NO_WRITE_WORKQUEUE flags for read and write BIOs, which
direct dm-crypt to not offload crypto operations into kcryptd
workqueues. In addition, writes are not buffered to be sorted in the
dm-crypt red-black tree, but dispatched immediately. For cases, where
crypto operations cannot happen (hard interrupt context, for example
the read path of some NVME drivers), we offload the work to a tasklet
rather than a workqueue.
These flags only ensure no async BIO processing in the dm-crypt
module. It is worth noting that some Crypto API implementations may
offload encryption into their own workqueues, which are independent of
the dm-crypt and its configuration. However upon enabling these new
flags dm-crypt will instruct Crypto API not to backlog crypto
requests.
To give an idea of the performance gains for certain workloads,
consider the script, and results when tested against various
devices, detailed here:
https://www.redhat.com/archives/dm-devel/2020-July/msg00138.html
[1]: https://www.spinics.net/lists/dm-crypt/msg07516.html
[2]: https://blog.cloudflare.com/speeding-up-linux-disk-encryption/
Signed-off-by: Ignat Korchagin <ignat@cloudflare.com>
Reviewed-by: Damien Le Moal <damien.lemoal@wdc.com>
Reviewed-by: Bob Liu <bob.liu@oracle.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
2020-07-06 18:37:31 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-02-08 02:10:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
2011-01-13 19:59:54 +00:00
|
|
|
|
2023-01-25 21:14:58 +01:00
|
|
|
|
2011-01-13 19:59:54 +00:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
2012-07-27 15:08:05 +01:00
|
|
|
|
|
|
|
|
|
2011-01-13 19:59:54 +00:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-01-13 19:59:54 +00:00
|
|
|
|
2012-07-27 15:08:05 +01:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2012-07-27 15:08:05 +01:00
|
|
|
|
2011-01-13 19:59:54 +00:00
|
|
|
|
2017-03-16 15:39:40 +01:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-01-13 19:59:54 +00:00
|
|
|
|
|
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
2011-01-13 19:59:54 +00:00
|
|
|
|
2023-01-25 21:14:58 +01:00
|
|
|
|
2011-01-13 19:59:54 +00:00
|
|
|
|
|
|
|
|
|
treewide: Replace kmalloc with kmalloc_obj for non-scalar types
This is the result of running the Coccinelle script from
scripts/coccinelle/api/kmalloc_objs.cocci. The script is designed to
avoid scalar types (which need careful case-by-case checking), and
instead replace kmalloc-family calls that allocate struct or union
object instances:
Single allocations: kmalloc(sizeof(TYPE), ...)
are replaced with: kmalloc_obj(TYPE, ...)
Array allocations: kmalloc_array(COUNT, sizeof(TYPE), ...)
are replaced with: kmalloc_objs(TYPE, COUNT, ...)
Flex array allocations: kmalloc(struct_size(PTR, FAM, COUNT), ...)
are replaced with: kmalloc_flex(*PTR, FAM, COUNT, ...)
(where TYPE may also be *VAR)
The resulting allocations no longer return "void *", instead returning
"TYPE *".
Signed-off-by: Kees Cook <kees@kernel.org>
2026-02-20 23:49:23 -08:00
|
|
|
|
Convert remaining multi-line kmalloc_obj/flex GFP_KERNEL uses
Conversion performed via this Coccinelle script:
// SPDX-License-Identifier: GPL-2.0-only
// Options: --include-headers-for-types --all-includes --include-headers --keep-comments
virtual patch
@gfp depends on patch && !(file in "tools") && !(file in "samples")@
identifier ALLOC = {kmalloc_obj,kmalloc_objs,kmalloc_flex,
kzalloc_obj,kzalloc_objs,kzalloc_flex,
kvmalloc_obj,kvmalloc_objs,kvmalloc_flex,
kvzalloc_obj,kvzalloc_objs,kvzalloc_flex};
@@
ALLOC(...
- , GFP_KERNEL
)
$ make coccicheck MODE=patch COCCI=gfp.cocci
Build and boot tested x86_64 with Fedora 42's GCC and Clang:
Linux version 6.19.0+ (user@host) (gcc (GCC) 15.2.1 20260123 (Red Hat 15.2.1-7), GNU ld version 2.44-12.fc42) #1 SMP PREEMPT_DYNAMIC 1970-01-01
Linux version 6.19.0+ (user@host) (clang version 20.1.8 (Fedora 20.1.8-4.fc42), LLD 20.1.8) #1 SMP PREEMPT_DYNAMIC 1970-01-01
Signed-off-by: Kees Cook <kees@kernel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2026-02-21 23:46:04 -08:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
2012-07-27 15:08:05 +01:00
|
|
|
|
|
|
|
|
|
2011-01-13 19:59:54 +00:00
|
|
|
|
2020-07-09 23:20:42 -07:00
|
|
|
|
|
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
2012-07-27 15:08:05 +01:00
|
|
|
|
2011-01-13 19:59:54 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-12-05 20:53:00 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-15 16:23:43 +02:00
|
|
|
|
2018-12-05 20:53:00 -08:00
|
|
|
|
2011-01-13 19:59:54 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-02-21 16:37:42 -08:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-09 23:20:42 -07:00
|
|
|
|
|
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-15 16:23:43 +02:00
|
|
|
|
2018-12-05 20:53:00 -08:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-16 15:39:40 +01:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-01-25 21:14:58 +01:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-01-25 21:14:58 +01:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-01-25 21:14:58 +01:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-08-25 07:12:54 -04:00
|
|
|
|
2011-01-13 19:59:53 +00:00
|
|
|
|
2023-01-25 21:14:58 +01:00
|
|
|
|
2012-07-27 15:08:05 +01:00
|
|
|
|
2011-01-13 19:59:53 +00:00
|
|
|
|
2013-10-28 23:21:03 +01:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
2013-10-28 23:21:03 +01:00
|
|
|
|
2018-01-03 22:48:59 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-01-03 22:48:59 +01:00
|
|
|
|
|
|
|
|
|
2012-07-27 15:08:05 +01:00
|
|
|
|
2017-03-16 15:39:40 +01:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
2017-03-16 15:39:40 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-07-27 15:08:05 +01:00
|
|
|
|
|
|
|
|
|
2011-01-13 19:59:53 +00:00
|
|
|
|
|
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-01-13 19:59:53 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-11-21 15:58:51 +01:00
|
|
|
|
|
|
|
|
|
2016-12-01 18:20:52 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-04-20 16:46:59 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-01-22 09:43:21 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-11-21 15:58:51 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-04-20 16:46:59 +03:00
|
|
|
|
2016-11-21 15:58:51 +01:00
|
|
|
|
2020-04-20 16:46:59 +03:00
|
|
|
|
2016-11-21 15:58:51 +01:00
|
|
|
|
2016-12-01 18:20:52 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-11-21 15:58:51 +01:00
|
|
|
|
2023-01-28 16:43:00 +01:00
|
|
|
|
2016-11-21 15:58:51 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-04-20 16:46:59 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-01-22 09:43:20 +01:00
|
|
|
|
|
|
|
|
|
2020-04-20 16:46:59 +03:00
|
|
|
|
|
|
|
|
|
2021-01-22 09:43:21 +01:00
|
|
|
|
2023-01-25 23:31:55 +01:00
|
|
|
|
2021-01-22 09:43:21 +01:00
|
|
|
|
|
|
|
|
|
2020-04-20 16:46:59 +03:00
|
|
|
|
2016-11-21 15:58:51 +01:00
|
|
|
|
2020-04-20 16:46:59 +03:00
|
|
|
|
2016-11-21 15:58:51 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-04-20 16:46:59 +03:00
|
|
|
|
2016-11-21 15:58:51 +01:00
|
|
|
|
2024-09-18 15:34:45 +02:00
|
|
|
|
|
|
|
|
|
2016-11-21 15:58:51 +01:00
|
|
|
|
|
|
|
|
|
2017-01-31 15:47:11 +01:00
|
|
|
|
2020-04-20 16:46:59 +03:00
|
|
|
|
2024-09-18 15:05:29 +02:00
|
|
|
|
|
|
|
|
|
2024-09-18 15:34:45 +02:00
|
|
|
|
|
|
|
|
|
2016-11-21 15:58:51 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-09-18 15:34:45 +02:00
|
|
|
|
|
|
|
|
|
2016-11-21 15:58:51 +01:00
|
|
|
|
2024-09-18 15:34:45 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-11-21 15:58:51 +01:00
|
|
|
|
2024-09-18 15:34:45 +02:00
|
|
|
|
|
|
|
|
|
2016-11-21 15:58:51 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-02-11 12:15:38 +00:00
|
|
|
|
2016-11-21 15:58:51 +01:00
|
|
|
|
|
|
|
|
|
2020-04-20 16:46:59 +03:00
|
|
|
|
2016-11-21 15:58:51 +01:00
|
|
|
|
2006-10-03 01:15:37 -07:00
|
|
|
|
|
|
|
|
|
2011-03-24 13:54:27 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-01-13 19:59:49 +00:00
|
|
|
|
|
|
|
|
|
2011-03-24 13:54:27 +00:00
|
|
|
|
2006-10-03 01:15:37 -07:00
|
|
|
|
2016-11-21 15:58:51 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-11-02 15:02:08 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-11-21 15:58:51 +01:00
|
|
|
|
2020-08-06 23:18:13 -07:00
|
|
|
|
2016-11-21 15:58:51 +01:00
|
|
|
|
|
|
|
|
|
2017-04-27 16:52:04 +03:00
|
|
|
|
|
|
|
|
|
2011-03-24 13:54:27 +00:00
|
|
|
|
2006-10-03 01:15:37 -07:00
|
|
|
|
2016-08-25 07:12:54 -04:00
|
|
|
|
2016-11-02 15:02:08 +01:00
|
|
|
|
|
|
|
|
|
2011-03-24 13:54:27 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-10-03 01:15:37 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-04-24 14:21:53 +02:00
|
|
|
|
|
|
|
|
|
2006-10-03 01:15:37 -07:00
|
|
|
|
2017-04-24 14:21:53 +02:00
|
|
|
|
2019-07-09 15:22:12 +02:00
|
|
|
|
|
|
|
|
|
2026-03-21 16:06:51 -07:00
|
|
|
|
|
|
|
|
|
2019-07-09 15:22:12 +02:00
|
|
|
|
2020-08-06 23:18:13 -07:00
|
|
|
|
2016-11-21 15:58:51 +01:00
|
|
|
|
2017-04-24 14:21:53 +02:00
|
|
|
|
|
|
|
|
|
2011-01-13 19:59:53 +00:00
|
|
|
|
2017-04-24 14:21:53 +02:00
|
|
|
|
2006-10-03 01:15:37 -07:00
|
|
|
|
|
|
|
|
|
2017-08-13 22:45:08 -04:00
|
|
|
|
|
|
|
|
|
2018-12-28 00:34:29 -08:00
|
|
|
|
2017-08-13 22:45:08 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-14 00:40:38 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-08-13 22:45:08 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-08-12 04:14:06 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-09-21 16:22:29 +02:00
|
|
|
|
2015-02-13 08:25:59 -05:00
|
|
|
|
|
|
|
|
|
2010-08-12 04:14:06 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-07-11 14:11:29 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-07-27 15:08:05 +01:00
|
|
|
|
|
|
|
|
|
2018-05-20 18:25:53 -04:00
|
|
|
|
2010-08-12 04:14:06 +01:00
|
|
|
|
2018-05-20 18:25:53 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-06-02 13:45:04 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-08-12 04:14:06 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-08-06 23:18:13 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-08-12 04:14:06 +01:00
|
|
|
|
2018-01-05 21:17:20 -05:00
|
|
|
|
|
|
|
|
|
2010-08-12 04:14:06 +01:00
|
|
|
|
2020-08-06 23:18:13 -07:00
|
|
|
|
2017-08-13 22:45:08 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-09-04 11:59:30 +02:00
|
|
|
|
|
|
|
|
|
2010-08-12 04:14:06 +01:00
|
|
|
|
|
|
|
|
|
2017-03-16 15:39:39 +01:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2010-08-12 04:14:07 +01:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2017-03-16 15:39:40 +01:00
|
|
|
|
2017-03-16 15:39:39 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2010-08-12 04:14:07 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-12-10 23:52:25 +00:00
|
|
|
|
|
|
|
|
|
2017-06-06 09:07:01 +02:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2006-09-03 08:56:39 +10:00
|
|
|
|
|
|
|
|
|
2007-05-09 02:32:55 -07:00
|
|
|
|
|
|
|
|
|
2019-07-09 15:22:14 +02:00
|
|
|
|
|
|
|
|
|
2020-01-03 09:20:22 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-01-13 19:59:55 +00:00
|
|
|
|
2013-10-28 23:21:04 +01:00
|
|
|
|
|
|
|
|
|
2011-01-13 19:59:55 +00:00
|
|
|
|
|
|
|
|
|
2013-10-28 23:21:04 +01:00
|
|
|
|
2011-01-13 19:59:55 +00:00
|
|
|
|
2013-10-28 23:21:03 +01:00
|
|
|
|
2011-01-13 19:59:55 +00:00
|
|
|
|
2013-10-28 23:21:03 +01:00
|
|
|
|
|
|
|
|
|
2013-10-28 23:21:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-16 15:39:39 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-01-13 19:59:55 +00:00
|
|
|
|
2006-06-26 00:27:35 -07:00
|
|
|
|
2017-03-16 15:39:39 +01:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2017-03-16 15:39:39 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-16 15:39:40 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-09-25 06:35:54 +00:00
|
|
|
|
2017-03-16 15:39:40 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-09 23:20:42 -07:00
|
|
|
|
2017-03-16 15:39:40 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-08-16 13:21:33 +02:00
|
|
|
|
|
|
|
|
|
2017-03-16 15:39:40 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2010-08-12 04:14:07 +01:00
|
|
|
|
2019-08-19 17:17:37 +03:00
|
|
|
|
2017-03-16 15:39:40 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-01-09 11:57:14 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-16 15:39:40 +01:00
|
|
|
|
2019-08-19 17:17:37 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-05-24 05:35:29 -04:00
|
|
|
|
2019-08-19 17:17:37 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-09-15 00:39:10 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-16 15:39:40 +01:00
|
|
|
|
2026-09-15 00:39:10 +00:00
|
|
|
|
2017-03-16 15:39:40 +01:00
|
|
|
|
2019-08-19 17:17:37 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-16 15:39:40 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-19 17:17:37 +03:00
|
|
|
|
2017-03-16 15:39:40 +01:00
|
|
|
|
2019-08-19 17:17:37 +03:00
|
|
|
|
2017-03-16 15:39:40 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-08-12 04:14:07 +01:00
|
|
|
|
2012-07-27 15:08:05 +01:00
|
|
|
|
dm: reject trailing characters in sccanf input
Device mapper uses sscanf to convert arguments to numbers. The problem is that
the way we use it ignores additional unmatched characters in the scanned string.
For example, this `if (sscanf(string, "%d", &number) == 1)' will match a number,
but also it will match number with some garbage appended, like "123abc".
As a result, device mapper accepts garbage after some numbers. For example
the command `dmsetup create vg1-new --table "0 16384 linear 254:1bla 34816bla"'
will pass without an error.
This patch fixes all sscanf uses in device mapper. It appends "%c" with
a pointer to a dummy character variable to every sscanf statement.
The construct `if (sscanf(string, "%d%c", &number, &dummy) == 1)' succeeds
only if string is a null-terminated number (optionally preceded by some
whitespace characters). If there is some character appended after the number,
sscanf matches "%c", writes the character to the dummy variable and returns 2.
We check the return value for 1 and consequently reject numbers with some
garbage appended.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Acked-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
2012-03-28 18:41:26 +01:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2017-03-16 15:39:40 +01:00
|
|
|
|
2010-08-12 04:14:07 +01:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-08-12 04:14:07 +01:00
|
|
|
|
|
|
|
|
|
2011-01-13 19:59:54 +00:00
|
|
|
|
2010-08-12 04:14:07 +01:00
|
|
|
|
|
|
|
|
|
2011-01-13 19:59:54 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dm: reject trailing characters in sccanf input
Device mapper uses sscanf to convert arguments to numbers. The problem is that
the way we use it ignores additional unmatched characters in the scanned string.
For example, this `if (sscanf(string, "%d", &number) == 1)' will match a number,
but also it will match number with some garbage appended, like "123abc".
As a result, device mapper accepts garbage after some numbers. For example
the command `dmsetup create vg1-new --table "0 16384 linear 254:1bla 34816bla"'
will pass without an error.
This patch fixes all sscanf uses in device mapper. It appends "%c" with
a pointer to a dummy character variable to every sscanf statement.
The construct `if (sscanf(string, "%d%c", &number, &dummy) == 1)' succeeds
only if string is a null-terminated number (optionally preceded by some
whitespace characters). If there is some character appended after the number,
sscanf matches "%c", writes the character to the dummy variable and returns 2.
We check the return value for 1 and consequently reject numbers with some
garbage appended.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Acked-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
2012-03-28 18:41:26 +01:00
|
|
|
|
2011-01-13 19:59:54 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-08-12 04:14:07 +01:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2019-01-09 11:57:14 +01:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2011-01-13 19:59:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-16 15:39:40 +01:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2017-03-16 15:39:40 +01:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2017-03-16 15:39:40 +01:00
|
|
|
|
2010-08-12 04:14:07 +01:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2010-08-12 04:14:07 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-19 17:17:37 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-08-12 04:14:07 +01:00
|
|
|
|
|
|
|
|
|
2006-08-22 20:29:17 +10:00
|
|
|
|
|
|
|
|
|
2010-08-12 04:14:07 +01:00
|
|
|
|
2012-07-27 15:08:05 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-16 15:39:40 +01:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2017-09-27 20:28:57 +08:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2017-03-16 15:39:40 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-08-12 04:14:07 +01:00
|
|
|
|
2017-03-16 15:39:39 +01:00
|
|
|
|
|
|
|
|
|
2017-03-16 15:39:40 +01:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2013-10-28 23:21:03 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-16 15:39:40 +01:00
|
|
|
|
2013-10-28 23:21:03 +01:00
|
|
|
|
|
|
|
|
|
2010-08-12 04:14:06 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-16 15:39:40 +01:00
|
|
|
|
2010-08-12 04:14:06 +01:00
|
|
|
|
2009-12-10 23:51:56 +00:00
|
|
|
|
|
|
|
|
|
2010-08-12 04:14:06 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-16 15:39:40 +01:00
|
|
|
|
2010-08-12 04:14:06 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-01-12 16:30:32 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-08-12 04:14:07 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-06-22 11:32:45 -07:00
|
|
|
|
2024-04-08 21:36:56 +02:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-16 15:39:44 +01:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-04-08 21:36:56 +02:00
|
|
|
|
|
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dm crypt: add flags to optionally bypass kcryptd workqueues
This is a follow up to [1] that detailed latency problems associated
with dm-crypt's use of workqueues when processing IO.
Current dm-crypt implementation creates a significant IO performance
overhead (at least on small IO block sizes) for both latency and
throughput. We suspect offloading IO request processing into
workqueues and async threads is more harmful these days with the
modern fast storage. I also did some digging into the dm-crypt git
history and much of this async processing is not needed anymore,
because the reasons it was added are mostly gone from the kernel. More
details can be found in [2] (see "Git archeology" section).
This change adds DM_CRYPT_NO_READ_WORKQUEUE and
DM_CRYPT_NO_WRITE_WORKQUEUE flags for read and write BIOs, which
direct dm-crypt to not offload crypto operations into kcryptd
workqueues. In addition, writes are not buffered to be sorted in the
dm-crypt red-black tree, but dispatched immediately. For cases, where
crypto operations cannot happen (hard interrupt context, for example
the read path of some NVME drivers), we offload the work to a tasklet
rather than a workqueue.
These flags only ensure no async BIO processing in the dm-crypt
module. It is worth noting that some Crypto API implementations may
offload encryption into their own workqueues, which are independent of
the dm-crypt and its configuration. However upon enabling these new
flags dm-crypt will instruct Crypto API not to backlog crypto
requests.
To give an idea of the performance gains for certain workloads,
consider the script, and results when tested against various
devices, detailed here:
https://www.redhat.com/archives/dm-devel/2020-July/msg00138.html
[1]: https://www.spinics.net/lists/dm-crypt/msg07516.html
[2]: https://blog.cloudflare.com/speeding-up-linux-disk-encryption/
Signed-off-by: Ignat Korchagin <ignat@cloudflare.com>
Reviewed-by: Damien Le Moal <damien.lemoal@wdc.com>
Reviewed-by: Bob Liu <bob.liu@oracle.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
2020-07-06 18:37:31 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-07-08 22:06:58 +02:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-02-19 21:31:11 +01:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-08-16 13:21:33 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-23 10:23:14 -04:00
|
|
|
|
2017-03-16 15:39:44 +01:00
|
|
|
|
|
|
|
|
|
2017-03-23 10:23:14 -04:00
|
|
|
|
2017-03-16 15:39:44 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-09-13 15:45:56 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-23 10:23:14 -04:00
|
|
|
|
2017-03-16 15:39:44 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-08-12 04:14:07 +01:00
|
|
|
|
|
|
|
|
|
2020-07-08 18:28:08 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-05-26 06:24:57 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-08 18:28:08 +09:00
|
|
|
|
2021-02-10 17:38:30 -05:00
|
|
|
|
|
|
|
|
|
2020-07-08 18:28:08 +09:00
|
|
|
|
|
|
|
|
|
2010-08-12 04:14:07 +01:00
|
|
|
|
|
|
|
|
|
2016-11-21 15:58:51 +01:00
|
|
|
|
2010-08-12 04:14:07 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-10-09 22:13:43 +02:00
|
|
|
|
2023-07-11 14:11:29 +08:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
2024-04-08 21:36:56 +02:00
|
|
|
|
2010-08-12 04:14:07 +01:00
|
|
|
|
|
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
dm: reject trailing characters in sccanf input
Device mapper uses sscanf to convert arguments to numbers. The problem is that
the way we use it ignores additional unmatched characters in the scanned string.
For example, this `if (sscanf(string, "%d", &number) == 1)' will match a number,
but also it will match number with some garbage appended, like "123abc".
As a result, device mapper accepts garbage after some numbers. For example
the command `dmsetup create vg1-new --table "0 16384 linear 254:1bla 34816bla"'
will pass without an error.
This patch fixes all sscanf uses in device mapper. It appends "%c" with
a pointer to a dummy character variable to every sscanf statement.
The construct `if (sscanf(string, "%d%c", &number, &dummy) == 1)' succeeds
only if string is a null-terminated number (optionally preceded by some
whitespace characters). If there is some character appended after the number,
sscanf matches "%c", writes the character to the dummy variable and returns 2.
We check the return value for 1 and consequently reject numbers with some
garbage appended.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Acked-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
2012-03-28 18:41:26 +01:00
|
|
|
|
2010-08-12 04:14:07 +01:00
|
|
|
|
2011-08-02 12:32:08 +01:00
|
|
|
|
2010-08-12 04:14:07 +01:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2016-11-21 15:58:51 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-08-12 04:14:07 +01:00
|
|
|
|
2026-02-21 17:06:51 -08:00
|
|
|
|
2010-08-12 04:14:07 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-01-13 19:59:49 +00:00
|
|
|
|
2017-03-16 15:39:44 +01:00
|
|
|
|
2017-03-23 10:23:14 -04:00
|
|
|
|
2010-08-12 04:14:07 +01:00
|
|
|
|
|
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
2017-08-13 22:45:08 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-08-12 04:14:07 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-16 15:39:40 +01:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dm crypt: fix access beyond the end of allocated space
The DM crypt target accesses memory beyond allocated space resulting in
a crash on 32 bit x86 systems.
This bug is very old (it dates back to 2.6.25 commit 3a7f6c990ad04 "dm
crypt: use async crypto"). However, this bug was masked by the fact
that kmalloc rounds the size up to the next power of two. This bug
wasn't exposed until 3.17-rc1 commit 298a9fa08a ("dm crypt: use per-bio
data"). By switching to using per-bio data there was no longer any
padding beyond the end of a dm-crypt allocated memory block.
To minimize allocation overhead dm-crypt puts several structures into one
block allocated with kmalloc. The block holds struct ablkcipher_request,
cipher-specific scratch pad (crypto_ablkcipher_reqsize(any_tfm(cc))),
struct dm_crypt_request and an initialization vector.
The variable dmreq_start is set to offset of struct dm_crypt_request
within this memory block. dm-crypt allocates the block with this size:
cc->dmreq_start + sizeof(struct dm_crypt_request) + cc->iv_size.
When accessing the initialization vector, dm-crypt uses the function
iv_of_dmreq, which performs this calculation: ALIGN((unsigned long)(dmreq
+ 1), crypto_ablkcipher_alignmask(any_tfm(cc)) + 1).
dm-crypt allocated "cc->iv_size" bytes beyond the end of dm_crypt_request
structure. However, when dm-crypt accesses the initialization vector, it
takes a pointer to the end of dm_crypt_request, aligns it, and then uses
it as the initialization vector. If the end of dm_crypt_request is not
aligned on a crypto_ablkcipher_alignmask(any_tfm(cc)) boundary the
alignment causes the initialization vector to point beyond the allocated
space.
Fix this bug by calculating the variable iv_size_padding and adding it
to the allocated size.
Also correct the alignment of dm_crypt_request. struct dm_crypt_request
is specific to dm-crypt (it isn't used by the crypto subsystem at all),
so it is aligned on __alignof__(struct dm_crypt_request).
Also align per_bio_data_size on ARCH_KMALLOC_MINALIGN, so that it is
aligned as if the block was allocated with kmalloc.
Reported-by: Krzysztof Kolasa <kkolasa@winsoft.pl>
Tested-by: Milan Broz <gmazyland@gmail.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
2014-08-28 11:09:31 -04:00
|
|
|
|
|
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
dm crypt: fix access beyond the end of allocated space
The DM crypt target accesses memory beyond allocated space resulting in
a crash on 32 bit x86 systems.
This bug is very old (it dates back to 2.6.25 commit 3a7f6c990ad04 "dm
crypt: use async crypto"). However, this bug was masked by the fact
that kmalloc rounds the size up to the next power of two. This bug
wasn't exposed until 3.17-rc1 commit 298a9fa08a ("dm crypt: use per-bio
data"). By switching to using per-bio data there was no longer any
padding beyond the end of a dm-crypt allocated memory block.
To minimize allocation overhead dm-crypt puts several structures into one
block allocated with kmalloc. The block holds struct ablkcipher_request,
cipher-specific scratch pad (crypto_ablkcipher_reqsize(any_tfm(cc))),
struct dm_crypt_request and an initialization vector.
The variable dmreq_start is set to offset of struct dm_crypt_request
within this memory block. dm-crypt allocates the block with this size:
cc->dmreq_start + sizeof(struct dm_crypt_request) + cc->iv_size.
When accessing the initialization vector, dm-crypt uses the function
iv_of_dmreq, which performs this calculation: ALIGN((unsigned long)(dmreq
+ 1), crypto_ablkcipher_alignmask(any_tfm(cc)) + 1).
dm-crypt allocated "cc->iv_size" bytes beyond the end of dm_crypt_request
structure. However, when dm-crypt accesses the initialization vector, it
takes a pointer to the end of dm_crypt_request, aligns it, and then uses
it as the initialization vector. If the end of dm_crypt_request is not
aligned on a crypto_ablkcipher_alignmask(any_tfm(cc)) boundary the
alignment causes the initialization vector to point beyond the allocated
space.
Fix this bug by calculating the variable iv_size_padding and adding it
to the allocated size.
Also correct the alignment of dm_crypt_request. struct dm_crypt_request
is specific to dm-crypt (it isn't used by the crypto subsystem at all),
so it is aligned on __alignof__(struct dm_crypt_request).
Also align per_bio_data_size on ARCH_KMALLOC_MINALIGN, so that it is
aligned as if the block was allocated with kmalloc.
Reported-by: Krzysztof Kolasa <kkolasa@winsoft.pl>
Tested-by: Milan Broz <gmazyland@gmail.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
2014-08-28 11:09:31 -04:00
|
|
|
|
|
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
dm crypt: fix access beyond the end of allocated space
The DM crypt target accesses memory beyond allocated space resulting in
a crash on 32 bit x86 systems.
This bug is very old (it dates back to 2.6.25 commit 3a7f6c990ad04 "dm
crypt: use async crypto"). However, this bug was masked by the fact
that kmalloc rounds the size up to the next power of two. This bug
wasn't exposed until 3.17-rc1 commit 298a9fa08a ("dm crypt: use per-bio
data"). By switching to using per-bio data there was no longer any
padding beyond the end of a dm-crypt allocated memory block.
To minimize allocation overhead dm-crypt puts several structures into one
block allocated with kmalloc. The block holds struct ablkcipher_request,
cipher-specific scratch pad (crypto_ablkcipher_reqsize(any_tfm(cc))),
struct dm_crypt_request and an initialization vector.
The variable dmreq_start is set to offset of struct dm_crypt_request
within this memory block. dm-crypt allocates the block with this size:
cc->dmreq_start + sizeof(struct dm_crypt_request) + cc->iv_size.
When accessing the initialization vector, dm-crypt uses the function
iv_of_dmreq, which performs this calculation: ALIGN((unsigned long)(dmreq
+ 1), crypto_ablkcipher_alignmask(any_tfm(cc)) + 1).
dm-crypt allocated "cc->iv_size" bytes beyond the end of dm_crypt_request
structure. However, when dm-crypt accesses the initialization vector, it
takes a pointer to the end of dm_crypt_request, aligns it, and then uses
it as the initialization vector. If the end of dm_crypt_request is not
aligned on a crypto_ablkcipher_alignmask(any_tfm(cc)) boundary the
alignment causes the initialization vector to point beyond the allocated
space.
Fix this bug by calculating the variable iv_size_padding and adding it
to the allocated size.
Also correct the alignment of dm_crypt_request. struct dm_crypt_request
is specific to dm-crypt (it isn't used by the crypto subsystem at all),
so it is aligned on __alignof__(struct dm_crypt_request).
Also align per_bio_data_size on ARCH_KMALLOC_MINALIGN, so that it is
aligned as if the block was allocated with kmalloc.
Reported-by: Krzysztof Kolasa <kkolasa@winsoft.pl>
Tested-by: Milan Broz <gmazyland@gmail.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
2014-08-28 11:09:31 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
dm crypt: fix access beyond the end of allocated space
The DM crypt target accesses memory beyond allocated space resulting in
a crash on 32 bit x86 systems.
This bug is very old (it dates back to 2.6.25 commit 3a7f6c990ad04 "dm
crypt: use async crypto"). However, this bug was masked by the fact
that kmalloc rounds the size up to the next power of two. This bug
wasn't exposed until 3.17-rc1 commit 298a9fa08a ("dm crypt: use per-bio
data"). By switching to using per-bio data there was no longer any
padding beyond the end of a dm-crypt allocated memory block.
To minimize allocation overhead dm-crypt puts several structures into one
block allocated with kmalloc. The block holds struct ablkcipher_request,
cipher-specific scratch pad (crypto_ablkcipher_reqsize(any_tfm(cc))),
struct dm_crypt_request and an initialization vector.
The variable dmreq_start is set to offset of struct dm_crypt_request
within this memory block. dm-crypt allocates the block with this size:
cc->dmreq_start + sizeof(struct dm_crypt_request) + cc->iv_size.
When accessing the initialization vector, dm-crypt uses the function
iv_of_dmreq, which performs this calculation: ALIGN((unsigned long)(dmreq
+ 1), crypto_ablkcipher_alignmask(any_tfm(cc)) + 1).
dm-crypt allocated "cc->iv_size" bytes beyond the end of dm_crypt_request
structure. However, when dm-crypt accesses the initialization vector, it
takes a pointer to the end of dm_crypt_request, aligns it, and then uses
it as the initialization vector. If the end of dm_crypt_request is not
aligned on a crypto_ablkcipher_alignmask(any_tfm(cc)) boundary the
alignment causes the initialization vector to point beyond the allocated
space.
Fix this bug by calculating the variable iv_size_padding and adding it
to the allocated size.
Also correct the alignment of dm_crypt_request. struct dm_crypt_request
is specific to dm-crypt (it isn't used by the crypto subsystem at all),
so it is aligned on __alignof__(struct dm_crypt_request).
Also align per_bio_data_size on ARCH_KMALLOC_MINALIGN, so that it is
aligned as if the block was allocated with kmalloc.
Reported-by: Krzysztof Kolasa <kkolasa@winsoft.pl>
Tested-by: Milan Broz <gmazyland@gmail.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
2014-08-28 11:09:31 -04:00
|
|
|
|
2008-02-08 02:11:07 +00:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-05-20 18:25:53 -04:00
|
|
|
|
|
|
|
|
|
2008-02-08 02:11:07 +00:00
|
|
|
|
2010-08-12 04:14:06 +01:00
|
|
|
|
2008-02-08 02:11:07 +00:00
|
|
|
|
|
|
|
|
|
2016-01-31 13:28:26 -05:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
2023-06-12 16:31:53 +01:00
|
|
|
|
2014-03-28 15:51:55 -04:00
|
|
|
|
2021-03-11 12:01:37 +01:00
|
|
|
|
2018-05-20 18:25:53 -04:00
|
|
|
|
2006-06-26 00:27:35 -07:00
|
|
|
|
2010-08-12 04:14:06 +01:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2018-05-20 18:25:53 -04:00
|
|
|
|
|
|
|
|
|
2006-10-03 01:15:40 -07:00
|
|
|
|
2010-08-12 04:14:06 +01:00
|
|
|
|
2006-10-03 01:15:40 -07:00
|
|
|
|
|
|
|
|
|
2015-02-13 08:24:41 -05:00
|
|
|
|
|
|
|
|
|
2010-08-12 04:14:06 +01:00
|
|
|
|
2017-03-16 15:39:44 +01:00
|
|
|
|
|
|
|
|
|
2006-06-26 00:27:35 -07:00
|
|
|
|
2010-08-12 04:14:06 +01:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2006-03-27 01:17:48 -08:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2015-07-31 09:20:36 -04:00
|
|
|
|
|
|
|
|
|
2010-08-12 04:14:06 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-07-31 09:20:36 -04:00
|
|
|
|
2018-11-07 22:24:55 +01:00
|
|
|
|
2006-06-26 00:27:35 -07:00
|
|
|
|
2010-08-12 04:14:06 +01:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2006-03-27 01:17:48 -08:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2020-07-08 18:28:08 +09:00
|
|
|
|
2021-05-26 06:25:01 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-08 18:28:08 +09:00
|
|
|
|
|
|
|
|
|
2021-05-26 06:25:01 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-08 18:28:08 +09:00
|
|
|
|
|
|
|
|
|
2017-03-16 15:39:40 +01:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
2011-08-02 12:32:08 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-07-08 22:06:58 +02:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
2011-08-02 12:32:08 +01:00
|
|
|
|
2018-05-20 18:25:53 -04:00
|
|
|
|
2024-07-08 22:06:58 +02:00
|
|
|
|
2018-05-20 18:25:53 -04:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
2011-08-02 12:32:08 +01:00
|
|
|
|
2017-04-18 16:51:54 -04:00
|
|
|
|
|
|
|
|
|
2011-08-02 12:32:08 +01:00
|
|
|
|
|
|
|
|
|
2023-07-11 14:11:29 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-08-12 04:14:06 +01:00
|
|
|
|
2023-07-11 14:11:29 +08:00
|
|
|
|
2024-04-08 21:36:56 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-01-13 12:03:02 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-10-19 22:38:58 +01:00
|
|
|
|
|
|
|
|
|
2010-08-12 04:14:06 +01:00
|
|
|
|
2007-10-19 22:38:58 +01:00
|
|
|
|
|
|
|
|
|
2024-04-08 21:36:56 +02:00
|
|
|
|
2023-07-11 14:11:29 +08:00
|
|
|
|
2026-01-13 12:03:02 +01:00
|
|
|
|
2023-07-11 14:11:29 +08:00
|
|
|
|
2024-04-08 21:36:56 +02:00
|
|
|
|
2024-04-12 10:58:05 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-07-11 14:11:29 +08:00
|
|
|
|
2024-04-12 10:58:05 -04:00
|
|
|
|
2023-07-11 14:11:29 +08:00
|
|
|
|
2024-04-08 21:36:56 +02:00
|
|
|
|
2007-10-19 22:38:58 +01:00
|
|
|
|
2007-10-19 22:38:57 +01:00
|
|
|
|
2010-08-12 04:14:06 +01:00
|
|
|
|
2007-10-19 22:38:57 +01:00
|
|
|
|
|
|
|
|
|
2018-07-11 12:10:51 -04:00
|
|
|
|
2015-02-13 08:27:41 -05:00
|
|
|
|
2015-02-13 08:25:59 -05:00
|
|
|
|
2021-10-21 16:39:01 +08:00
|
|
|
|
2015-02-13 08:25:59 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-04-08 21:36:56 +02:00
|
|
|
|
|
|
|
|
|
2015-02-13 08:25:59 -05:00
|
|
|
|
2013-03-01 22:45:47 +00:00
|
|
|
|
2021-02-10 15:26:23 -05:00
|
|
|
|
2022-02-17 23:40:35 -05:00
|
|
|
|
2011-09-25 23:26:21 +01:00
|
|
|
|
2021-09-04 11:59:30 +02:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2010-08-12 04:14:06 +01:00
|
|
|
|
2021-09-04 11:59:30 +02:00
|
|
|
|
2010-08-12 04:14:06 +01:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2012-12-21 20:23:41 +00:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2007-07-12 17:26:32 +01:00
|
|
|
|
2012-07-27 15:08:05 +01:00
|
|
|
|
2024-07-03 15:00:29 +02:00
|
|
|
|
2025-11-05 16:02:36 +01:00
|
|
|
|
2009-06-22 10:12:23 +01:00
|
|
|
|
2011-08-02 12:32:08 +01:00
|
|
|
|
2016-06-05 14:32:25 -05:00
|
|
|
|
|
|
|
|
|
2016-06-05 14:32:04 -05:00
|
|
|
|
2011-08-02 12:32:08 +01:00
|
|
|
|
2016-08-05 15:35:16 -06:00
|
|
|
|
2016-06-05 14:32:25 -05:00
|
|
|
|
2017-08-23 19:10:32 +02:00
|
|
|
|
2011-08-02 12:32:08 +01:00
|
|
|
|
2013-10-11 15:44:27 -07:00
|
|
|
|
|
|
|
|
|
2009-06-22 10:12:23 +01:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2016-08-30 16:38:42 -04:00
|
|
|
|
|
|
|
|
|
2025-11-05 16:02:36 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-08-30 16:38:42 -04:00
|
|
|
|
2025-11-05 16:02:36 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-07-03 15:00:29 +02:00
|
|
|
|
2025-11-05 16:02:36 +01:00
|
|
|
|
2016-08-30 16:38:42 -04:00
|
|
|
|
2017-03-16 15:39:44 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-06-03 09:38:02 +02:00
|
|
|
|
2017-03-16 15:39:44 +01:00
|
|
|
|
|
|
|
|
|
2017-06-03 09:38:02 +02:00
|
|
|
|
2017-03-16 15:39:44 +01:00
|
|
|
|
2014-03-28 15:51:55 -04:00
|
|
|
|
|
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
2024-07-08 22:06:58 +02:00
|
|
|
|
|
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
2023-02-01 21:17:44 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
2018-05-20 18:25:53 -04:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-16 15:39:40 +01:00
|
|
|
|
2017-01-04 20:23:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-10-19 22:38:58 +01:00
|
|
|
|
2011-01-13 19:59:53 +00:00
|
|
|
|
2022-02-17 23:40:35 -05:00
|
|
|
|
2015-02-13 08:25:59 -05:00
|
|
|
|
2011-01-13 19:59:53 +00:00
|
|
|
|
2007-10-19 22:38:58 +01:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2006-12-08 02:41:06 -08:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2022-04-25 08:53:29 -04:00
|
|
|
|
|
|
|
|
|
2023-01-25 21:14:58 +01:00
|
|
|
|
2022-04-25 08:53:29 -04:00
|
|
|
|
|
|
|
|
|
2013-03-01 22:45:44 +00:00
|
|
|
|
2023-01-25 21:14:58 +01:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2010-08-12 04:14:07 +01:00
|
|
|
|
2023-01-25 21:14:58 +01:00
|
|
|
|
2015-02-13 08:23:09 -05:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-01-13 19:59:52 +00:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2016-11-21 15:58:51 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-04-25 08:53:29 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-11-21 15:58:51 +01:00
|
|
|
|
2013-03-01 22:45:44 +00:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2006-03-27 01:17:48 -08:00
|
|
|
|
|
|
|
|
|
2011-08-02 12:32:08 +01:00
|
|
|
|
2015-02-13 08:23:09 -05:00
|
|
|
|
|
|
|
|
|
2024-04-08 21:36:56 +02:00
|
|
|
|
2015-02-13 08:27:08 -05:00
|
|
|
|
dm crypt: add flags to optionally bypass kcryptd workqueues
This is a follow up to [1] that detailed latency problems associated
with dm-crypt's use of workqueues when processing IO.
Current dm-crypt implementation creates a significant IO performance
overhead (at least on small IO block sizes) for both latency and
throughput. We suspect offloading IO request processing into
workqueues and async threads is more harmful these days with the
modern fast storage. I also did some digging into the dm-crypt git
history and much of this async processing is not needed anymore,
because the reasons it was added are mostly gone from the kernel. More
details can be found in [2] (see "Git archeology" section).
This change adds DM_CRYPT_NO_READ_WORKQUEUE and
DM_CRYPT_NO_WRITE_WORKQUEUE flags for read and write BIOs, which
direct dm-crypt to not offload crypto operations into kcryptd
workqueues. In addition, writes are not buffered to be sorted in the
dm-crypt red-black tree, but dispatched immediately. For cases, where
crypto operations cannot happen (hard interrupt context, for example
the read path of some NVME drivers), we offload the work to a tasklet
rather than a workqueue.
These flags only ensure no async BIO processing in the dm-crypt
module. It is worth noting that some Crypto API implementations may
offload encryption into their own workqueues, which are independent of
the dm-crypt and its configuration. However upon enabling these new
flags dm-crypt will instruct Crypto API not to backlog crypto
requests.
To give an idea of the performance gains for certain workloads,
consider the script, and results when tested against various
devices, detailed here:
https://www.redhat.com/archives/dm-devel/2020-July/msg00138.html
[1]: https://www.spinics.net/lists/dm-crypt/msg07516.html
[2]: https://blog.cloudflare.com/speeding-up-linux-disk-encryption/
Signed-off-by: Ignat Korchagin <ignat@cloudflare.com>
Reviewed-by: Damien Le Moal <damien.lemoal@wdc.com>
Reviewed-by: Bob Liu <bob.liu@oracle.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
2020-07-06 18:37:31 +01:00
|
|
|
|
|
|
|
|
|
2024-08-16 13:21:33 +02:00
|
|
|
|
2017-03-23 10:23:14 -04:00
|
|
|
|
2017-03-16 15:39:44 +01:00
|
|
|
|
2024-08-16 13:21:33 +02:00
|
|
|
|
2015-02-13 08:23:09 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-04-08 21:36:56 +02:00
|
|
|
|
|
|
|
|
|
2015-02-13 08:27:08 -05:00
|
|
|
|
|
|
|
|
|
dm crypt: add flags to optionally bypass kcryptd workqueues
This is a follow up to [1] that detailed latency problems associated
with dm-crypt's use of workqueues when processing IO.
Current dm-crypt implementation creates a significant IO performance
overhead (at least on small IO block sizes) for both latency and
throughput. We suspect offloading IO request processing into
workqueues and async threads is more harmful these days with the
modern fast storage. I also did some digging into the dm-crypt git
history and much of this async processing is not needed anymore,
because the reasons it was added are mostly gone from the kernel. More
details can be found in [2] (see "Git archeology" section).
This change adds DM_CRYPT_NO_READ_WORKQUEUE and
DM_CRYPT_NO_WRITE_WORKQUEUE flags for read and write BIOs, which
direct dm-crypt to not offload crypto operations into kcryptd
workqueues. In addition, writes are not buffered to be sorted in the
dm-crypt red-black tree, but dispatched immediately. For cases, where
crypto operations cannot happen (hard interrupt context, for example
the read path of some NVME drivers), we offload the work to a tasklet
rather than a workqueue.
These flags only ensure no async BIO processing in the dm-crypt
module. It is worth noting that some Crypto API implementations may
offload encryption into their own workqueues, which are independent of
the dm-crypt and its configuration. However upon enabling these new
flags dm-crypt will instruct Crypto API not to backlog crypto
requests.
To give an idea of the performance gains for certain workloads,
consider the script, and results when tested against various
devices, detailed here:
https://www.redhat.com/archives/dm-devel/2020-July/msg00138.html
[1]: https://www.spinics.net/lists/dm-crypt/msg07516.html
[2]: https://blog.cloudflare.com/speeding-up-linux-disk-encryption/
Signed-off-by: Ignat Korchagin <ignat@cloudflare.com>
Reviewed-by: Damien Le Moal <damien.lemoal@wdc.com>
Reviewed-by: Bob Liu <bob.liu@oracle.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
2020-07-06 18:37:31 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-07-08 22:06:58 +02:00
|
|
|
|
|
|
|
|
|
2017-03-16 15:39:44 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-08-16 13:21:33 +02:00
|
|
|
|
|
|
|
|
|
2015-02-13 08:23:09 -05:00
|
|
|
|
2021-07-12 17:49:03 -07:00
|
|
|
|
2011-08-02 12:32:08 +01:00
|
|
|
|
2021-07-12 17:49:03 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-04-08 21:36:56 +02:00
|
|
|
|
2021-07-12 17:49:03 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-07-08 22:06:58 +02:00
|
|
|
|
2021-07-12 17:49:03 -07:00
|
|
|
|
2024-07-08 22:06:58 +02:00
|
|
|
|
2021-07-12 17:49:03 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-10-03 01:15:37 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-01-25 21:14:58 +01:00
|
|
|
|
|
|
|
|
|
2006-10-03 01:15:37 -07:00
|
|
|
|
|
|
|
|
|
2016-11-21 15:58:51 +01:00
|
|
|
|
2006-10-03 01:15:37 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-08-02 12:32:04 +01:00
|
|
|
|
2006-10-03 01:15:37 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-08-02 12:32:04 +01:00
|
|
|
|
2016-11-21 15:58:51 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-12-10 23:51:57 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-01-12 16:30:32 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-12-10 23:51:57 +00:00
|
|
|
|
|
|
|
|
|
2019-07-09 15:22:12 +02:00
|
|
|
|
2006-10-03 01:15:37 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-06-22 10:12:33 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-07-23 20:30:42 +01:00
|
|
|
|
2009-06-22 10:12:33 +01:00
|
|
|
|
|
|
|
|
|
2015-09-09 21:34:51 -04:00
|
|
|
|
|
|
|
|
|
2017-03-16 15:39:44 +01:00
|
|
|
|
|
|
|
|
|
2026-03-25 12:36:08 -07:00
|
|
|
|
2022-11-10 10:44:58 -08:00
|
|
|
|
dm: dm-crypt: Do not partially accept write BIOs with zoned targets
Read and write operations issued to a dm-crypt target may be split
according to the dm-crypt internal limits defined by the max_read_size
and max_write_size module parameters (default is 128 KB). The intent is
to improve processing time of large BIOs by splitting them into smaller
operations that can be parallelized on different CPUs.
For zoned dm-crypt targets, this BIO splitting is still done but without
the parallel execution to ensure that the issuing order of write
operations to the underlying devices remains sequential. However, the
splitting itself causes other problems:
1) Since dm-crypt relies on the block layer zone write plugging to
handle zone append emulation using regular write operations, the
reminder of a split write BIO will always be plugged into the target
zone write plugged. Once the on-going write BIO finishes, this
reminder BIO is unplugged and issued from the zone write plug work.
If this reminder BIO itself needs to be split, the reminder will be
re-issued and plugged again, but that causes a call to a
blk_queue_enter(), which may block if a queue freeze operation was
initiated. This results in a deadlock as DM submission still holds
BIOs that the queue freeze side is waiting for.
2) dm-crypt relies on the emulation done by the block layer using
regular write operations for processing zone append operations. This
still requires to properly return the written sector as the BIO
sector of the original BIO. However, this can be done correctly only
and only if there is a single clone BIO used for processing the
original zone append operation issued by the user. If the size of a
zone append operation is larger than dm-crypt max_write_size, then
the orginal BIO will be split and processed as a chain of regular
write operations. Such chaining result in an incorrect written sector
being returned to the zone append issuer using the original BIO
sector. This in turn results in file system data corruptions using
xfs or btrfs.
Fix this by modifying get_max_request_size() to always return the size
of the BIO to avoid it being split with dm_accpet_partial_bio() in
crypt_map(). get_max_request_size() is renamed to
get_max_request_sectors() to clarify the unit of the value returned
and its interface is changed to take a struct dm_target pointer and a
pointer to the struct bio being processed. In addition to this change,
to ensure that crypt_alloc_buffer() works correctly, set the dm-crypt
device max_hw_sectors limit to be at most
BIO_MAX_VECS << PAGE_SECTORS_SHIFT (1 MB with a 4KB page architecture).
This forces DM core to split write BIOs before passing them to
crypt_map(), and thus guaranteeing that dm-crypt can always accept an
entire write BIO without needing to split it.
This change does not have any effect on the read path of dm-crypt. Read
operations can still be split and the BIO fragments processed in
parallel. There is also no impact on the performance of the write path
given that all zone write BIOs were already processed inline instead of
in parallel.
This change also does not affect in any way regular dm-crypt block
devices.
Fixes: f211268ed1f9 ("dm: Use the block layer zone append emulation")
Cc: stable@vger.kernel.org
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Mikulas Patocka <mpatocka@redhat.com>
Link: https://lore.kernel.org/r/20250625093327.548866-5-dlemoal@kernel.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2025-06-25 18:33:26 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-11-05 16:02:36 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-09-09 21:34:51 -04:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2025-11-05 16:02:36 +01:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-11-05 16:02:36 +01:00
|
|
|
|
2020-07-08 18:28:08 +09:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2006-10-03 01:15:37 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-06-22 10:12:33 +01:00
|
|
|
|
2015-09-09 21:34:51 -04:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2023-04-10 00:43:37 +08:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2014-06-24 14:27:04 -04:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|