From b84b9b0a8b8f08c208e8784cba96bd7b6ac01ec4 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Thu, 15 Sep 2022 09:59:30 -0700 Subject: [PATCH] Migrate I/O scheduler parameters to task_profiles.json 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 --- device-common.mk | 3 ++ init.hardware.rc | 7 --- task_profiles.json | 128 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 131 insertions(+), 7 deletions(-) create mode 100644 task_profiles.json diff --git a/device-common.mk b/device-common.mk index f8d1074e..be064c90 100644 --- a/device-common.mk +++ b/device-common.mk @@ -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 diff --git a/init.hardware.rc b/init.hardware.rc index 9ff78fb5..f994731e 100644 --- a/init.hardware.rc +++ b/init.hardware.rc @@ -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 diff --git a/task_profiles.json b/task_profiles.json new file mode 100644 index 00000000..048994c4 --- /dev/null +++ b/task_profiles.json @@ -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" + } + } + ] + } + ] +}