diff mbox series

[J/realtime,v3] UBUNTU: [Config] realtime: tweak config for realtime tasks

Message ID 20220222130631.130684-1-krzysztof.kozlowski@canonical.com
State New
Headers show
Series [J/realtime,v3] UBUNTU: [Config] realtime: tweak config for realtime tasks | expand

Commit Message

Krzysztof Kozlowski Feb. 22, 2022, 1:06 p.m. UTC
BugLink: https://bugs.launchpad.net/bugs/1961588

Change kernel config to fit Realtime use cases:

1. CONFIG_WQ_POWER_EFFICIENT_DEFAULT disable: energy saving is not that
   important for Realtime workload but locality of any workqueues (thus
   cache locality and maybe lower latencies) is.

2. CONFIG_TIMERLAT_TRACER and CONFIG_OSNOISE_TRACER enable: for
   debugging latency issues.

3. CONFIG_BLK_CGROUP_IOLATENCY enable: for users wanting to have
   guarantees on IO latencies.

4. CONFIG_IRQ_TIME_ACCOUNTING enable: for fine granularity task IRQ
   accounting.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>

---

Changes since v2:
1. Add ack
2. Add annotations

Changes since v1:
1. Correct subject
---
 debian.realtime/config/annotations          | 18 ++++++++++++++++++
 debian.realtime/config/config.common.ubuntu | 11 ++++++-----
 2 files changed, 24 insertions(+), 5 deletions(-)

Comments

Tim Gardner Feb. 22, 2022, 1:12 p.m. UTC | #1
I find that a 'note<LP: #1961588>' in the annotations to be quite handy.

On 2/22/22 06:06, Krzysztof Kozlowski wrote:
> BugLink: https://bugs.launchpad.net/bugs/1961588
> 
> Change kernel config to fit Realtime use cases:
> 
> 1. CONFIG_WQ_POWER_EFFICIENT_DEFAULT disable: energy saving is not that
>     important for Realtime workload but locality of any workqueues (thus
>     cache locality and maybe lower latencies) is.
> 
> 2. CONFIG_TIMERLAT_TRACER and CONFIG_OSNOISE_TRACER enable: for
>     debugging latency issues.
> 
> 3. CONFIG_BLK_CGROUP_IOLATENCY enable: for users wanting to have
>     guarantees on IO latencies.
> 
> 4. CONFIG_IRQ_TIME_ACCOUNTING enable: for fine granularity task IRQ
>     accounting.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
> Acked-by: Tim Gardner <tim.gardner@canonical.com>
> 
> ---
> 
> Changes since v2:
> 1. Add ack
> 2. Add annotations
> 
> Changes since v1:
> 1. Correct subject
> ---
>   debian.realtime/config/annotations          | 18 ++++++++++++++++++
>   debian.realtime/config/config.common.ubuntu | 11 ++++++-----
>   2 files changed, 24 insertions(+), 5 deletions(-)
> 
> diff --git a/debian.realtime/config/annotations b/debian.realtime/config/annotations
> index 82c1e5ed49ae..636440041348 100644
> --- a/debian.realtime/config/annotations
> +++ b/debian.realtime/config/annotations
> @@ -25,3 +25,21 @@ CONFIG_NO_HZ_FULL                               policy<{'amd64': 'y', 'arm64': '
>   CONFIG_NO_HZ_FULL                               mark<ENFORCED>
>   CONFIG_RCU_NOCB_CPU                             policy<{'amd64': 'y', 'arm64': 'y'}>
>   CONFIG_RCU_NOCB_CPU                             mark<ENFORCED>
> +
> +# For users wanting to have guarantees on IO latencies:
> +CONFIG_BLK_CGROUP_IOLATENCY                     policy<{'amd64': 'y', 'arm64': 'y'}>
> +CONFIG_BLK_CGROUP_IOLATENCY                     mark<ENFORCED>
> +# For fine granularity task IRQ accounting:
> +CONFIG_IRQ_TIME_ACCOUNTING                      policy<{'amd64': 'y', 'arm64': 'y'}>
> +CONFIG_IRQ_TIME_ACCOUNTING                      mark<ENFORCED>
> +
> +# For debugging latency issues:
> +CONFIG_OSNOISE_TRACER                           policy<{'amd64': 'y', 'arm64': 'y'}>
> +CONFIG_OSNOISE_TRACER                           mark<ENFORCED>
> +CONFIG_TIMERLAT_TRACER                          policy<{'amd64': 'y', 'arm64': 'y'}>
> +CONFIG_TIMERLAT_TRACER                          mark<ENFORCED>
> +
> +# Energy saving is not that important for Realtime workload but locality of any
> +# workqueues (thus cache locality and maybe lower latencies) is:
> +CONFIG_WQ_POWER_EFFICIENT_DEFAULT               policy<{'amd64': 'n', 'arm64': 'n'}>
> +CONFIG_WQ_POWER_EFFICIENT_DEFAULT               mark<ENFORCED>
> diff --git a/debian.realtime/config/config.common.ubuntu b/debian.realtime/config/config.common.ubuntu
> index 9d325d4ab744..9cb2a8111c51 100644
> --- a/debian.realtime/config/config.common.ubuntu
> +++ b/debian.realtime/config/config.common.ubuntu
> @@ -983,7 +983,7 @@ CONFIG_BITREVERSE=y
>   CONFIG_BLK_CGROUP=y
>   CONFIG_BLK_CGROUP_FC_APPID=y
>   CONFIG_BLK_CGROUP_IOCOST=y
> -# CONFIG_BLK_CGROUP_IOLATENCY is not set
> +CONFIG_BLK_CGROUP_IOLATENCY=y
>   CONFIG_BLK_CGROUP_IOPRIO=y
>   CONFIG_BLK_CGROUP_RWSTAT=y
>   CONFIG_BLK_DEBUG_FS=y
> @@ -3848,6 +3848,7 @@ CONFIG_HAVE_PREEMPT_LAZY=y
>   CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y
>   CONFIG_HAVE_RELIABLE_STACKTRACE=y
>   CONFIG_HAVE_RSEQ=y
> +CONFIG_HAVE_SCHED_AVG_IRQ=y
>   CONFIG_HAVE_SETUP_PER_CPU_AREA=y
>   CONFIG_HAVE_SOFTIRQ_ON_OWN_STACK=y
>   CONFIG_HAVE_STACKPROTECTOR=y
> @@ -4894,7 +4895,7 @@ CONFIG_IRQ_FORCED_THREADING=y
>   CONFIG_IRQ_MSI_IOMMU=y
>   CONFIG_IRQ_POLL=y
>   CONFIG_IRQ_REMAP=y
> -# CONFIG_IRQ_TIME_ACCOUNTING is not set
> +CONFIG_IRQ_TIME_ACCOUNTING=y
>   CONFIG_IRQ_WORK=y
>   CONFIG_IR_ENE=m
>   CONFIG_IR_FINTEK=m
> @@ -7012,7 +7013,7 @@ CONFIG_OPTPROBES=y
>   CONFIG_ORANGEFS_FS=m
>   CONFIG_ORINOCO_USB=m
>   CONFIG_OSF_PARTITION=y
> -# CONFIG_OSNOISE_TRACER is not set
> +CONFIG_OSNOISE_TRACER=y
>   CONFIG_OUTPUT_FORMAT="elf64-x86-64"
>   CONFIG_OVERLAY_FS=m
>   # CONFIG_OVERLAY_FS_INDEX is not set
> @@ -10468,7 +10469,7 @@ CONFIG_TIFM_CORE=m
>   CONFIG_TIGON3=m
>   CONFIG_TIGON3_HWMON=y
>   CONFIG_TIMERFD=y
> -# CONFIG_TIMERLAT_TRACER is not set
> +CONFIG_TIMERLAT_TRACER=y
>   CONFIG_TIMER_ACPI=y
>   CONFIG_TIMER_IMX_SYS_CTR=y
>   CONFIG_TIMER_OF=y
> @@ -11806,7 +11807,7 @@ CONFIG_WM831X_WATCHDOG=m
>   CONFIG_WM8350_POWER=m
>   CONFIG_WM8350_WATCHDOG=m
>   CONFIG_WMI_BMOF=m
> -CONFIG_WQ_POWER_EFFICIENT_DEFAULT=y
> +# CONFIG_WQ_POWER_EFFICIENT_DEFAULT is not set
>   # CONFIG_WQ_WATCHDOG is not set
>   CONFIG_WWAN=y
>   CONFIG_WWAN_HWSIM=m
Krzysztof Kozlowski Feb. 22, 2022, 1:31 p.m. UTC | #2
On 22/02/2022 14:12, Tim Gardner wrote:
> I find that a 'note<LP: #1961588>' in the annotations to be quite handy.
> 

I'll add it.


Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/debian.realtime/config/annotations b/debian.realtime/config/annotations
index 82c1e5ed49ae..636440041348 100644
--- a/debian.realtime/config/annotations
+++ b/debian.realtime/config/annotations
@@ -25,3 +25,21 @@  CONFIG_NO_HZ_FULL                               policy<{'amd64': 'y', 'arm64': '
 CONFIG_NO_HZ_FULL                               mark<ENFORCED>
 CONFIG_RCU_NOCB_CPU                             policy<{'amd64': 'y', 'arm64': 'y'}>
 CONFIG_RCU_NOCB_CPU                             mark<ENFORCED>
+
+# For users wanting to have guarantees on IO latencies:
+CONFIG_BLK_CGROUP_IOLATENCY                     policy<{'amd64': 'y', 'arm64': 'y'}>
+CONFIG_BLK_CGROUP_IOLATENCY                     mark<ENFORCED>
+# For fine granularity task IRQ accounting:
+CONFIG_IRQ_TIME_ACCOUNTING                      policy<{'amd64': 'y', 'arm64': 'y'}>
+CONFIG_IRQ_TIME_ACCOUNTING                      mark<ENFORCED>
+
+# For debugging latency issues:
+CONFIG_OSNOISE_TRACER                           policy<{'amd64': 'y', 'arm64': 'y'}>
+CONFIG_OSNOISE_TRACER                           mark<ENFORCED>
+CONFIG_TIMERLAT_TRACER                          policy<{'amd64': 'y', 'arm64': 'y'}>
+CONFIG_TIMERLAT_TRACER                          mark<ENFORCED>
+
+# Energy saving is not that important for Realtime workload but locality of any
+# workqueues (thus cache locality and maybe lower latencies) is:
+CONFIG_WQ_POWER_EFFICIENT_DEFAULT               policy<{'amd64': 'n', 'arm64': 'n'}>
+CONFIG_WQ_POWER_EFFICIENT_DEFAULT               mark<ENFORCED>
diff --git a/debian.realtime/config/config.common.ubuntu b/debian.realtime/config/config.common.ubuntu
index 9d325d4ab744..9cb2a8111c51 100644
--- a/debian.realtime/config/config.common.ubuntu
+++ b/debian.realtime/config/config.common.ubuntu
@@ -983,7 +983,7 @@  CONFIG_BITREVERSE=y
 CONFIG_BLK_CGROUP=y
 CONFIG_BLK_CGROUP_FC_APPID=y
 CONFIG_BLK_CGROUP_IOCOST=y
-# CONFIG_BLK_CGROUP_IOLATENCY is not set
+CONFIG_BLK_CGROUP_IOLATENCY=y
 CONFIG_BLK_CGROUP_IOPRIO=y
 CONFIG_BLK_CGROUP_RWSTAT=y
 CONFIG_BLK_DEBUG_FS=y
@@ -3848,6 +3848,7 @@  CONFIG_HAVE_PREEMPT_LAZY=y
 CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y
 CONFIG_HAVE_RELIABLE_STACKTRACE=y
 CONFIG_HAVE_RSEQ=y
+CONFIG_HAVE_SCHED_AVG_IRQ=y
 CONFIG_HAVE_SETUP_PER_CPU_AREA=y
 CONFIG_HAVE_SOFTIRQ_ON_OWN_STACK=y
 CONFIG_HAVE_STACKPROTECTOR=y
@@ -4894,7 +4895,7 @@  CONFIG_IRQ_FORCED_THREADING=y
 CONFIG_IRQ_MSI_IOMMU=y
 CONFIG_IRQ_POLL=y
 CONFIG_IRQ_REMAP=y
-# CONFIG_IRQ_TIME_ACCOUNTING is not set
+CONFIG_IRQ_TIME_ACCOUNTING=y
 CONFIG_IRQ_WORK=y
 CONFIG_IR_ENE=m
 CONFIG_IR_FINTEK=m
@@ -7012,7 +7013,7 @@  CONFIG_OPTPROBES=y
 CONFIG_ORANGEFS_FS=m
 CONFIG_ORINOCO_USB=m
 CONFIG_OSF_PARTITION=y
-# CONFIG_OSNOISE_TRACER is not set
+CONFIG_OSNOISE_TRACER=y
 CONFIG_OUTPUT_FORMAT="elf64-x86-64"
 CONFIG_OVERLAY_FS=m
 # CONFIG_OVERLAY_FS_INDEX is not set
@@ -10468,7 +10469,7 @@  CONFIG_TIFM_CORE=m
 CONFIG_TIGON3=m
 CONFIG_TIGON3_HWMON=y
 CONFIG_TIMERFD=y
-# CONFIG_TIMERLAT_TRACER is not set
+CONFIG_TIMERLAT_TRACER=y
 CONFIG_TIMER_ACPI=y
 CONFIG_TIMER_IMX_SYS_CTR=y
 CONFIG_TIMER_OF=y
@@ -11806,7 +11807,7 @@  CONFIG_WM831X_WATCHDOG=m
 CONFIG_WM8350_POWER=m
 CONFIG_WM8350_WATCHDOG=m
 CONFIG_WMI_BMOF=m
-CONFIG_WQ_POWER_EFFICIENT_DEFAULT=y
+# CONFIG_WQ_POWER_EFFICIENT_DEFAULT is not set
 # CONFIG_WQ_WATCHDOG is not set
 CONFIG_WWAN=y
 CONFIG_WWAN_HWSIM=m