From 0b2b6cd70fe8a4663066054725685545625518f8 Mon Sep 17 00:00:00 2001 From: Sultan Alsawaf Date: Thu, 20 Feb 2020 08:53:54 -0800 Subject: [PATCH] Revert "usb: gadget: mtp: Increase RX transfer length to 1M" This reverts commit 0db49c2550a09458db188fb7312c66783c5af104. This results in kmalloc() abuse to find a large number of contiguous pages, which thrashes the page allocator and hurts overall performance. I couldn't reproduce the improved MTP throughput that this commit claimed either, so just revert it. Signed-off-by: Sultan Alsawaf Signed-off-by: Ruchit --- drivers/usb/gadget/function/f_mtp.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/usb/gadget/function/f_mtp.c b/drivers/usb/gadget/function/f_mtp.c index 78d2fe89b42b..4df6128be371 100755 --- a/drivers/usb/gadget/function/f_mtp.c +++ b/drivers/usb/gadget/function/f_mtp.c @@ -55,7 +55,6 @@ ipc_log_string(_mtp_ipc_log, "%s: " fmt, __func__, ##__VA_ARGS__) #endif -#define MTP_RX_BUFFER_INIT_SIZE 1048576 #define MTP_BULK_BUFFER_SIZE 16384 #define INTR_BUFFER_SIZE 28 #define MAX_INST_NAME_LEN 40 @@ -92,7 +91,7 @@ #define MAX_ITERATION 100 -unsigned int mtp_rx_req_len = MTP_RX_BUFFER_INIT_SIZE; +unsigned int mtp_rx_req_len = MTP_BULK_BUFFER_SIZE; module_param(mtp_rx_req_len, uint, 0644); unsigned int mtp_tx_req_len = MTP_BULK_BUFFER_SIZE;