dm-verity: Remove WQ_UNBOUND.
PATCH 1/1 dm-verity: Remove WQ_UNBOUND.
Setting WQ_UNBOUND increases scheduler latency on ARM64. This is likely due to the asymmetric architecture of ARM64 processors.
I've been unable to reproduce the results that claim WQ_UNBOUND gives a performance boost on x86-64.
This flag is causing performance issues for multiple subsystems within Android. Notably, the same slowdown exists for decompression with EROFS.
| open-prebuilt-camera | WQ_UNBOUND | ~WQ_UNBOUND | |-----------------------|------------|---------------| | verity wait time (us) | 11746 | 119 (-98%) | | erofs wait time (us) | 357805 | 174205 (-51%) |
| sha256 ramdisk random read | WQ_UNBOUND | ~WQ_UNBOUND | |----------------------------|-----------=---|-------------| | arm64 (accelerated) | bw=42.4MiB/s | bw=212MiB/s | | arm64 (generic) | bw=16.5MiB/s | bw=48MiB/s | | x86_64 (generic) | bw=233MiB/s | bw=230MiB/s |
--- drivers/md/dm-verity-target.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/md/dm-verity-target.c +2 -2
@@ -1399,8 +1399,8 @@ static int verity_ctr(struct dm_target *ti, unsigned argc, char **argv) goto bad; } -/* WQ_UNBOUND greatly improves performance when running on ramdisk */ - wq_flags =WQ_MEM_RECLAIM |WQ_UNBOUND ; + wq_flags =WQ_MEM_RECLAIM ; +/* * Using WQ_HIGHPRI improves throughput and completion latency by * reducing wait times when reading from a dm-verity device.
Signature · 1 line
2.39.1.456.gfc5497dd1b-goog
Mike Snitzer
maintainerQuoted 45 lines · Nathan Huckleberry
Setting
WQ_UNBOUNDincreases scheduler latency on ARM64. This is likely due to the asymmetric architecture of ARM64 processors.I've been unable to reproduce the results that claim
WQ_UNBOUNDgives a performance boost on x86-64.This flag is causing performance issues for multiple subsystems within Android. Notably, the same slowdown exists for decompression with EROFS.
| open-prebuilt-camera | WQ_UNBOUND | ~WQ_UNBOUND | |-----------------------|------------|---------------| | verity wait time (us) | 11746 | 119 (-98%) | | erofs wait time (us) | 357805 | 174205 (-51%) || sha256 ramdisk random read | WQ_UNBOUND | ~WQ_UNBOUND | |----------------------------|-----------=---|-------------| | arm64 (accelerated) | bw=42.4MiB/s | bw=212MiB/s | | arm64 (generic) | bw=16.5MiB/s | bw=48MiB/s | | x86_64 (generic) | bw=233MiB/s | bw=230MiB/s |Cc Sami Tolvanen <[email protected]>Cc Eric Biggers <[email protected]>Signed-off-by Nathan Huckleberry <[email protected]>--- drivers/md/dm-verity-target.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/md/dm-verity-target.c +2
-2@@ -1399,8 +1399,8 @@ static int verity_ctr(struct dm_target *ti, unsigned argc, char **argv) goto bad; } -/* WQ_UNBOUND greatly improves performance when running on ramdisk */ - wq_flags =WQ_MEM_RECLAIM |WQ_UNBOUND ; + wq_flags =WQ_MEM_RECLAIM ; +/* * Using WQ_HIGHPRI improves throughput and completion latency by * reducing wait times when reading from a dm-verity device. Signature · 1 line
2.39.1.456.gfc5497dd1b-goog
Hi,
I've discussed with Mikulas, tweaked your patch slightly but accepted your change, please see:
Thanks,
Mike
--
dm-devel mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/dm-devel
Looks good. Thanks.
Quoted 59 lines · Mike Snitzer
Quoted 44 lines · Nathan Huckleberry
Setting
WQ_UNBOUNDincreases scheduler latency on ARM64. This is likely due to the asymmetric architecture of ARM64 processors.I've been unable to reproduce the results that claim
WQ_UNBOUNDgives a performance boost on x86-64.This flag is causing performance issues for multiple subsystems within Android. Notably, the same slowdown exists for decompression with EROFS.
| open-prebuilt-camera | WQ_UNBOUND | ~WQ_UNBOUND | |-----------------------|------------|---------------| | verity wait time (us) | 11746 | 119 (-98%) | | erofs wait time (us) | 357805 | 174205 (-51%) || sha256 ramdisk random read | WQ_UNBOUND | ~WQ_UNBOUND | |----------------------------|-----------=---|-------------| | arm64 (accelerated) | bw=42.4MiB/s | bw=212MiB/s | | arm64 (generic) | bw=16.5MiB/s | bw=48MiB/s | | x86_64 (generic) | bw=233MiB/s | bw=230MiB/s |Cc Sami Tolvanen <[email protected]>Cc Eric Biggers <[email protected]>Signed-off-by Nathan Huckleberry <[email protected]>--- drivers/md/dm-verity-target.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/md/dm-verity-target.c +2
-3@@ -1399,8 +1399,8 @@ static int verity_ctr(struct dm_target *ti, unsigned argc, char **argv) goto bad; } -/* WQ_UNBOUND greatly improves performance when running on ramdisk */ - wq_flags =WQ_MEM_RECLAIM |WQ_UNBOUND ; + wq_flags =WQ_MEM_RECLAIM ; +/* * Using WQ_HIGHPRI improves throughput and completion latency by * reducing wait times when reading from a dm-verity device. -- Quoted 1 line
2.39.1.456.gfc5497dd1b-goog
Hi,
I've discussed with Mikulas, tweaked your patch slightly but accepted your change, please see:
Thanks,
Mike
Mikulas Patocka
maintainerQuoted 33 lines · Nathan Huckleberry
Setting
WQ_UNBOUNDincreases scheduler latency on ARM64. This is likely due to the asymmetric architecture of ARM64 processors.I've been unable to reproduce the results that claim
WQ_UNBOUNDgives a performance boost on x86-64.This flag is causing performance issues for multiple subsystems within Android. Notably, the same slowdown exists for decompression with EROFS.
| open-prebuilt-camera | WQ_UNBOUND | ~WQ_UNBOUND | |-----------------------|------------|---------------| | verity wait time (us) | 11746 | 119 (-98%) | | erofs wait time (us) | 357805 | 174205 (-51%) || sha256 ramdisk random read | WQ_UNBOUND | ~WQ_UNBOUND | |----------------------------|-----------=---|-------------| | arm64 (accelerated) | bw=42.4MiB/s | bw=212MiB/s | | arm64 (generic) | bw=16.5MiB/s | bw=48MiB/s | | x86_64 (generic) | bw=233MiB/s | bw=230MiB/s |Cc Sami Tolvanen <[email protected]>Cc Eric Biggers <[email protected]>Signed-off-by Nathan Huckleberry <[email protected]>--- drivers/md/dm-verity-target.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/md/dm-verity-target.c +0
-0
drivers/md/dm-verity-target.c static int verity_ctr(struct dm_target *ti, unsigned argc, char **argv) · line 1406
Quoted 10 lines
drivers/md/dm-verity-target.c +2
-2@@ -1399,8 +1399,8 @@ static int verity_ctr(struct dm_target *ti, unsigned argc, char **argv) goto bad; } -/* WQ_UNBOUND greatly improves performance when running on ramdisk */ - wq_flags =WQ_MEM_RECLAIM |WQ_UNBOUND ; + wq_flags =WQ_MEM_RECLAIM ; +/* * Using WQ_HIGHPRI improves throughput and completion latency by * reducing wait times when reading from a dm-verity device.
Hi
If you remove WQ_UNBOUND, you should also change the last argument of alloc_workqueue from num_online_cpus() to either 0 or 1. Try both 0 and 1 and tell us which performs better.
Mikulas
--
dm-devel mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/dm-devel
Quoted 51 lines · Mikulas Patocka
Quoted 33 lines · Nathan Huckleberry
Setting
WQ_UNBOUNDincreases scheduler latency on ARM64. This is likely due to the asymmetric architecture of ARM64 processors.I've been unable to reproduce the results that claim
WQ_UNBOUNDgives a performance boost on x86-64.This flag is causing performance issues for multiple subsystems within Android. Notably, the same slowdown exists for decompression with EROFS.
| open-prebuilt-camera | WQ_UNBOUND | ~WQ_UNBOUND | |-----------------------|------------|---------------| | verity wait time (us) | 11746 | 119 (-98%) | | erofs wait time (us) | 357805 | 174205 (-51%) || sha256 ramdisk random read | WQ_UNBOUND | ~WQ_UNBOUND | |----------------------------|-----------=---|-------------| | arm64 (accelerated) | bw=42.4MiB/s | bw=212MiB/s | | arm64 (generic) | bw=16.5MiB/s | bw=48MiB/s | | x86_64 (generic) | bw=233MiB/s | bw=230MiB/s |Cc Sami Tolvanen <[email protected]>Cc Eric Biggers <[email protected]>Signed-off-by Nathan Huckleberry <[email protected]>--- drivers/md/dm-verity-target.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/md/dm-verity-target.c +0
-0drivers/md/dm-verity-target.c static int verity_ctr(struct dm_target *ti, unsigned argc, char **argv) · line 1406
Quoted 10 lines
drivers/md/dm-verity-target.c +2
-2@@ -1399,8 +1399,8 @@ static int verity_ctr(struct dm_target *ti, unsigned argc, char **argv) goto bad; } -/* WQ_UNBOUND greatly improves performance when running on ramdisk */ - wq_flags =WQ_MEM_RECLAIM |WQ_UNBOUND ; + wq_flags =WQ_MEM_RECLAIM ; +/* * Using WQ_HIGHPRI improves throughput and completion latency by * reducing wait times when reading from a dm-verity device. Hi
Quoted 3 lines
If you remove
WQ_UNBOUND, you should also change the last argument ofalloc_workqueuefromnum_online_cpus()to either 0 or 1. Try both 0 and 1 and tell us which performs better.
They look roughly the same on ARM64. There's a slight advantage for using 1, but they're too close to conclusively say one is better.
Thanks,
Huck
Quoted 3 lines
Mikulas