summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHyeeun Jun <hyeeun.jun@samsung.corp-partner.google.com>2023-10-25 13:59:42 +0900
committerMartijn Coenen <maco@google.com>2023-12-05 08:11:21 +0000
commitfb014fc6e81b086c63398267d996d6972b7f35ce (patch)
tree6211622480ca98e4fc6fd16ed5a368ef58f4d2c7
parent1dd20644dcfb33b8f469853009f8a6e7b546234c (diff)
downloadvold-fb014fc6e81b086c63398267d996d6972b7f35ce.tar.gz
Reduce AppFuse max read size.
Since the max read size of FUSE is 128KB in default, the socket header of the appfuse epollcontroller is allocated in order 4 (64KB). When memory environment is in insufficient situation that has a lot of fragment, order 4 size memory allication is impossible, so more than several tens of seconds could take to allocate the socket header. To prevent the issue, limit the fuse read size to 64KB, so that the memory allocation order of the socket header is changed to order 2. Bug: 312503249 Test: atest AppFusePerfTest Change-Id: I7020801b7539d980515885396916f8be1f1008e9
-rw-r--r--AppFuseUtil.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/AppFuseUtil.cpp b/AppFuseUtil.cpp
index 711e70b5..a3beaec1 100644
--- a/AppFuseUtil.cpp
+++ b/AppFuseUtil.cpp
@@ -50,14 +50,15 @@ static android::status_t GetMountPath(uid_t uid, const std::string& name, std::s
static android::status_t Mount(int device_fd, const std::string& path) {
const auto opts = StringPrintf(
- "fd=%i,"
- "rootmode=40000,"
- "default_permissions,"
- "allow_other,"
- "user_id=0,group_id=0,"
- "context=\"u:object_r:app_fuse_file:s0\","
- "fscontext=u:object_r:app_fusefs:s0",
- device_fd);
+ "fd=%i,"
+ "rootmode=40000,"
+ "default_permissions,"
+ "allow_other,"
+ "max_read=65536,"
+ "user_id=0,group_id=0,"
+ "context=\"u:object_r:app_fuse_file:s0\","
+ "fscontext=u:object_r:app_fusefs:s0",
+ device_fd);
const int result =
TEMP_FAILURE_RETRY(mount("/dev/fuse", path.c_str(), "fuse",