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

Commit 5841a96a authored by Josh Gao's avatar Josh Gao
Browse files

adbd: tune USB read/write sizes and queue depths.

Reduce the operation sizes to sizes that are small enough that the
kernel will run the OOM killer to try to make them succeed. Compensate
for the smaller operation sizes by increasing the queue depth.

Bug: http://b/126582877
Test: benchmark_device.py
Change-Id: I4d351f56c8f83fea882614238cc3fec8ba1e9bf9
parent b416f225
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -57,11 +57,11 @@ using android::base::StringPrintf;
// We can't find out whether we have support for AIO on ffs endpoints until we submit a read.
static std::optional<bool> gFfsAioSupported;

static constexpr size_t kUsbReadQueueDepth = 16;
static constexpr size_t kUsbReadSize = 16384;
static constexpr size_t kUsbReadQueueDepth = 32;
static constexpr size_t kUsbReadSize = 8 * PAGE_SIZE;

static constexpr size_t kUsbWriteQueueDepth = 16;
static constexpr size_t kUsbWriteSize = 16 * PAGE_SIZE;
static constexpr size_t kUsbWriteQueueDepth = 32;
static constexpr size_t kUsbWriteSize = 8 * PAGE_SIZE;

static const char* to_string(enum usb_functionfs_event_type type) {
    switch (type) {