Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0109ef0c authored by Nathan Huckleberry's avatar Nathan Huckleberry Committed by Harshit Jain
Browse files

UPSTREAM: dm verity: stop using WQ_UNBOUND for verify_wq



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 |

Using a alloc_workqueue() @max_active arg of num_online_cpus() only
made sense with WQ_UNBOUND. Switch the @max_active arg to 0 (aka
default, which is 256 per-cpu).

Also, eliminate 'wq_flags' since it really doesn't serve a purpose.

Cc: Sami Tolvanen <samitolvanen@google.com>
Cc: Eric Biggers <ebiggers@kernel.org>
Signed-off-by: default avatarNathan Huckleberry <nhuck@google.com>
Reviewed-by: default avatarMikulas Patocka <mpatocka@redhat.com>
Signed-off-by: default avatarMike Snitzer <snitzer@kernel.org>

Bug: 233247259
(cherry picked from commit c25da5b7baf1d243e6612ba2b97e2a2c4a1376f6)
Signed-off-by: default avatarNathan Huckleberry <nhuck@google.com>
(cherry picked from https://android-review.googlesource.com/q/commit:0b8c60f03740004a9693d63a2d31618b00469107)
Merged-In: Iea437fcfaa978a1389a57ef4d4adcb976d89089c

Change-Id: Iecdc2ef25cc59ca53bfe3bca775f93cfda57f9d7
(cherry picked from commit 5824afe4ee4c1d5297f506b4c306a4abc0e5abbe)
(cherry picked from commit 1ddaaf82eb982798cbbb37f49e26ccd5bb82edac)
(cherry picked from commit a3730c0b9b04c62e1756cc8bcc732d9f0a562e5e)
(cherry picked from commit a065d61b07cec6a9bd067344322f8d29ff346fe4)
parent 1102ab5f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment