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
This commit is contained in:
Hyeeun Jun 2023-10-25 13:59:42 +09:00 committed by Martijn Coenen
parent 1dd20644dc
commit fb014fc6e8

View file

@ -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",