Skip to content

Commit

Permalink
Migrate I/O scheduler parameters to task_profiles.json
Browse files Browse the repository at this point in the history
This patch preserves the CFQ I/O scheduler parameters:
* Foreground blkio.weight     (CfqWeight)    1000
* Foreground blkio.group_idle (CfqGroupIdle) 2000
* Background blkio.weight     (CfqWeight)     200
* Background blkio.group_idle (CfqGroupIdle)    0

This patch prepares for migration of the blkio controller to the v2
cgroup hierarchy.

Bug: 213617178
Change-Id: I868e766092d875813a5f5e448631d59c38915649
Signed-off-by: Bart Van Assche <[email protected]>
  • Loading branch information
Bart Van Assche committed Sep 15, 2022
1 parent dde9cdc commit b84b9b0
Show file tree
Hide file tree
Showing 3 changed files with 131 additions and 7 deletions.
3 changes: 3 additions & 0 deletions device-common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ PRODUCT_PRODUCT_PROPERTIES += \
PRODUCT_COPY_FILES += \
device/google/sunfish/init.logging.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.$(PRODUCT_PLATFORM).logging.rc

PRODUCT_COPY_FILES += \
device/google/sunfish/task_profiles.json:$(TARGET_COPY_OUT_VENDOR)/etc/task_profiles.json

# Pixelstats broken mic detection
PRODUCT_PROPERTY_OVERRIDES += vendor.audio.mic_break=true

Expand Down
7 changes: 0 additions & 7 deletions init.hardware.rc
Original file line number Diff line number Diff line change
Expand Up @@ -458,13 +458,6 @@ on property:sys.boot_completed=1
write /dev/cpuset/system-background/cpus 2-5
write /dev/cpuset/restricted/cpus 2-5

# Setup runtime blkio
# value for group_idle is us
write /dev/blkio/blkio.weight 1000
write /dev/blkio/background/blkio.weight 200
write /dev/blkio/blkio.group_idle 2000
write /dev/blkio/background/blkio.group_idle 0

# UFS health
chmod 755 /sys/kernel/debug/ufshcd0
chmod 644 /sys/kernel/debug/ufshcd0/show_hba
Expand Down
128 changes: 128 additions & 0 deletions task_profiles.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
{
"Profiles": [
{
"Name": "LowIoPriority",
"Actions": [
{
"Name": "JoinCgroup",
"Params":
{
"Controller": "blkio",
"Path": "background"
}
},
{
"Name": "SetAttribute",
"Params":
{
"Name": "CfqGroupIdle",
"Value": "0",
"Optional": "true"
}
},
{
"Name": "SetAttribute",
"Params":
{
"Name": "CfqWeight",
"Value": "200",
"Optional": "true"
}
}
]
},
{
"Name": "NormalIoPriority",
"Actions": [
{
"Name": "JoinCgroup",
"Params":
{
"Controller": "blkio",
"Path": ""
}
},
{
"Name": "SetAttribute",
"Params":
{
"Name": "CfqGroupIdle",
"Value": "2000",
"Optional": "true"
}
},
{
"Name": "SetAttribute",
"Params":
{
"Name": "CfqWeight",
"Value": "1000",
"Optional": "true"
}
}
]
},
{
"Name": "HighIoPriority",
"Actions": [
{
"Name": "JoinCgroup",
"Params":
{
"Controller": "blkio",
"Path": ""
}
},
{
"Name": "SetAttribute",
"Params":
{
"Name": "CfqGroupIdle",
"Value": "2000",
"Optional": "true"
}
},
{
"Name": "SetAttribute",
"Params":
{
"Name": "CfqWeight",
"Value": "1000",
"Optional": "true"
}
}
]
},
{
"Name": "MaxIoPriority",
"Actions": [
{
"Name": "JoinCgroup",
"Params":
{
"Controller": "blkio",
"Path": ""
}
},
{
"Name": "SetAttribute",
"Params":
{
"Name": "CfqGroupIdle",
"Value": "2000",
"Optional": "true"
}
},
{
"Name": "SetAttribute",
"Params":
{
"Name": "CfqWeight",
"Value": "1000",
"Optional": "true"
}
}
]
}
]
}

0 comments on commit b84b9b0

Please sign in to comment.