<div dir="ltr">Thanks Andrea for the information<div>In this case, I'd like to confirm if this will be merged into 5.15 lowlatency-hwe kernel on Focal? not GA on Jammy</div><div>So I can provide some feedbacks to the customer</div><div><br></div><div>Thanks,</div><div>Gerald</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Oct 31, 2023 at 10:57 PM Andrea Righi <<a href="mailto:andrea.righi@canonical.com">andrea.righi@canonical.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Tue, Oct 31, 2023 at 09:48:55PM +0800, Gerald Yang wrote:<br>
> Hi Dimitri,<br>
> <br>
> Thanks for checking this!<br>
> And yes, that would be very helpful to enable it in focal lowlatency-hwe<br>
> and jammy lowlatency-hwe kernels,<br>
> at least users/customers could have a way to use this feature.<br>
> <br>
> Another question I'd like to ask is roughly when will 6.5 lowlatency-hwe<br>
> kernel be landed in Jammy? Should I also submit this to 6.2 lowlatency<br>
> kernel?<br>
<br>
We are working on hwe-6.5/lowlatency-hwe-6.5 right now, we are in the<br>
process of fixing the usual dkms breakage, reviewing test results,<br>
etc... at this point I think we need to wait after the sprint to have<br>
the 6.5's out in jammy.<br>
<br>
-Andrea<br>
<br>
> <br>
> Thanks,<br>
> Gerald<br>
> <br>
> <br>
> On Tue, Oct 31, 2023 at 8:36 PM Dimitri John Ledkov <<br>
> <a href="mailto:dimitri.ledkov@canonical.com" target="_blank">dimitri.ledkov@canonical.com</a>> wrote:<br>
> <br>
> > Hi,<br>
> ><br>
> > On Tue, 31 Oct 2023 at 10:54, Gerald Yang <<a href="mailto:gerald.yang@canonical.com" target="_blank">gerald.yang@canonical.com</a>><br>
> > wrote:<br>
> > ><br>
> > > Hi Andrea,<br>
> > ><br>
> > > Thanks for the feedback! please let me explain this in more detail<br>
> > ><br>
> > > I sent out this SRU because some of our customers need to use NO_HZ_FULL.<br>
> > > In their scenario, the CPU time is pretty sensitive, and must avoid as<br>
> > much noise as possible to keep<br>
> > > most CPUs doing only one single task.<br>
> > > I found some CPU steal time happen on their VM because RCU callback<br>
> > softirqs are still triggered on CPUs<br>
> > > with isolcpus, nohz_full and rcu_nocbs configured, and lead me to find<br>
> > NO_HZ_FULL is not built into generic kernel.<br>
> > ><br>
> > > I think the use case for NO_HZ_FULL should be different than generic<br>
> > kernel, e.g. performance vs low latency<br>
> > ><br>
> > > On generic kernel, we also did some tests with NO_HZ_FULL built-in here:<br>
> > > <a href="https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1919154" rel="noreferrer" target="_blank">https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1919154</a><br>
> > ><br>
> > > The results show performance degradation on AMD EPYC series machines only<br>
> > > when NO_HZ_FULL is built-in but not enabled, but this doesn't happen on<br>
> > Intel and arm64 machines.<br>
> > ><br>
> > > Because one of the customer is still on Focal, if it's possible to merge<br>
> > this into 5.15 kernel, it would be more convenient<br>
> > > for them to use HWE lowlatency kernel.<br>
> > > And if there are users need to use NO_HZ_FULL on Focal, lowlatency<br>
> > kernel could be a proper choice for them,<br>
> > > because so far there is no kernel with NO_HZ_FULL built-in on Focal.<br>
> ><br>
> > I am ok having this enabled in focal:lowlatency-hwe-5.15 and<br>
> > jammy:lowlatency-hwe-6.5<br>
> ><br>
> > but not change anything in focal:lowlatency (5.4 / ga)<br>
> > jammy:lowlatency (5.15 / ga).<br>
> ><br>
> > Would that help you? As an exception to our policy. I really feel<br>
> > uncomfortable changing default GA flavours, but risk levels of making<br>
> > hwe kernels more like the future sounds safer.<br>
> ><br>
> > ><br>
> > > Thanks,<br>
> > > Gerald<br>
> > ><br>
> > > On Tue, Oct 31, 2023 at 2:28 PM Andrea Righi <<a href="mailto:andrea.righi@canonical.com" target="_blank">andrea.righi@canonical.com</a>><br>
> > wrote:<br>
> > >><br>
> > >> On Tue, Oct 31, 2023 at 12:57:39AM +0800, Gerald Yang wrote:<br>
> > >> > BugLink: <a href="https://bugs.launchpad.net/bugs/2023007" rel="noreferrer" target="_blank">https://bugs.launchpad.net/bugs/2023007</a><br>
> > >> ><br>
> > >> > [Impact]<br>
> > >> ><br>
> > >> > The lowlatency kernel in Ubuntu is specifically designed to prioritize<br>
> > >> > high responsiveness, making it ideal for multimedia environments like<br>
> > >> > DAWs and audio processing platforms, as well as soft real-time<br>
> > >> > environments.<br>
> > >> ><br>
> > >> > With the introduction of a real-time kernel, it might be worth<br>
> > >> > reconsidering the role of the lowlatency kernel and potentially<br>
> > >> > including it as the default kernel in desktop images, focusing on its<br>
> > >> > suitability for desktop-oriented usage.<br>
> > >> ><br>
> > >> > To achieve this, we can enable additional configuration settings and<br>
> > >> > make it more focused for a low-latency and highly responsive desktop<br>
> > >> > environment.<br>
> > >> ><br>
> > >> > Optionally (for the future) provide also an additional user-space<br>
> > >> > package that would enable specific run-time kernel settings focused at<br>
> > >> > certain preset workload profiles (e.g, web navigation, gaming, audio<br>
> > >> > processing, etc.).<br>
> > >> ><br>
> > >> > [Test case]<br>
> > >> ><br>
> > >> > Use linux-lowlatency in a desktop environment and measure<br>
> > responsiveness<br>
> > >> > of interactive applications.<br>
> > >> ><br>
> > >> > [Fix]<br>
> > >> ><br>
> > >> > Enable the following additional .config settings to make this kernel<br>
> > >> > more suitable for a low-latency desktop kernel:<br>
> > >> ><br>
> > >> > - CONFIG_NO_HZ_FULL=y: enable access to "Full tickless mode"<br>
> > (shutdown<br>
> > >> > clock tick when possible across all the enabled CPUs if they are<br>
> > >> > either idle or running 1 task - reduce kernel jitter of running<br>
> > tasks<br>
> > >> > due to the periodic clock tick, must be enabled at boot time<br>
> > passing<br>
> > >> > `nohz_full=<cpu_list>`)<br>
> > >> ><br>
> > >> > - CONFIG_RCU_NOCB_CPU=y, CONFIG_RCU_NOCB_CPU_DEFAULT_ALL=y: move RCU<br>
> > >> > callbacks from softirq context to kthread context (reduce time<br>
> > spent<br>
> > >> > in softirqs with preemption disabled to improve the overall system<br>
> > >> > responsiveness, at the cost of introducing a potential performance<br>
> > >> > penalty, because RCU callbacks are not processed by kernel threads)<br>
> > >> ><br>
> > >> > [Regression potential]<br>
> > >> ><br>
> > >> > Enabling all these settings can introduce a potential performance<br>
> > >> > regression, but the kernel should result more responsive and make<br>
> > >> > it more suitable for a desktop/multimedia/gaming/audio processing<br>
> > >> > context.<br>
> > >> ><br>
> > >> > Signed-off-by: Gerald Yang <<a href="mailto:gerald.yang@canonical.com" target="_blank">gerald.yang@canonical.com</a>><br>
> > >><br>
> > >> It's worth mentioning that we already applied these configs to the<br>
> > >> lowlatency kernels in mantic and in general I don't see any downside if<br>
> > >> we apply this.<br>
> > >><br>
> > >> However, I'm not sure if a change like this is proper SRU material, we<br>
> > >> are basically saying "now lowlatency is a desktop kernel everywhere".<br>
> > >><br>
> > >> Certain workloads may experience regressions (especially with the<br>
> > >> RCU_NOCB_CPU), while NO_HZ_FULL is a lot safer (since it can be<br>
> > >> enabled/disabled via boot options).<br>
> > >><br>
> > >> We also need to keep in mind that Jammy will get these changes with the<br>
> > >> lowlatency-hwe-6.5 kernel, so I'm not still 100% convinced to backport<br>
> > >> this and apply it everywhere... opinions?<br>
> > >><br>
> > >> -Andrea<br>
> > >><br>
> > >> > ---<br>
> > >> > debian.lowlatency/config/annotations | 13 +++++++++++++<br>
> > >> > 1 file changed, 13 insertions(+)<br>
> > >> ><br>
> > >> > diff --git a/debian.lowlatency/config/annotations<br>
> > b/debian.lowlatency/config/annotations<br>
> > >> > index 694ae26b6745..3e1556d60809 100644<br>
> > >> > --- a/debian.lowlatency/config/annotations<br>
> > >> > +++ b/debian.lowlatency/config/annotations<br>
> > >> > @@ -15,12 +15,20 @@ CONFIG_HZ_250<br>
> > note<'Override default HZ used i<br>
> > >> > CONFIG_LATENCYTOP policy<{'amd64':<br>
> > 'y', 'arm64': 'y'}><br>
> > >> > CONFIG_LATENCYTOP note<'<br>
> > <a href="https://lists.ubuntu.com/archives/kernel-team/2014-July/045006.html" rel="noreferrer" target="_blank">https://lists.ubuntu.com/archives/kernel-team/2014-July/045006.html</a>,<br>
> > LP#1655986'><br>
> > >> ><br>
> > >> > +CONFIG_NO_HZ_FULL policy<{'amd64':<br>
> > 'y', 'arm64': 'y'}><br>
> > >> > +CONFIG_NO_HZ_FULL note<'Enable access<br>
> > to "Full tickless mode" (LP: #2023007)'><br>
> > >> > +<br>
> > >> > +CONFIG_NO_HZ_IDLE policy<{'amd64':<br>
> > 'n', 'arm64': 'n'}><br>
> > >> > +CONFIG_NO_HZ_IDLE note<'Disabled in<br>
> > favor of CONFIG_NO_HZ_FULL (LP: #2023007)'><br>
> > >> > +<br>
> > >> > CONFIG_PREEMPT policy<{'amd64':<br>
> > 'y', 'arm64': 'y'}><br>
> > >> > CONFIG_PREEMPT note<'Enable fully<br>
> > preemptible kernel'><br>
> > >> ><br>
> > >> > CONFIG_PREEMPT_VOLUNTARY policy<{'amd64':<br>
> > 'n', 'arm64': 'n'}><br>
> > >> > CONFIG_PREEMPT_VOLUNTARY note<'Disable<br>
> > voluntary preemption model'><br>
> > >> ><br>
> > >> > +CONFIG_RCU_NOCB_CPU policy<{'amd64':<br>
> > 'y', 'arm64': 'y'}><br>
> > >> > +CONFIG_RCU_NOCB_CPU note<'Move RCU<br>
> > callbacks from softirq context to kthread context (LP: #2023007)'><br>
> > >> ><br>
> > >> > # ---- Annotations without notes ----<br>
> > >> ><br>
> > >> > @@ -55,6 +63,8 @@ CONFIG_CEC_PIN<br>
> > policy<{'amd64': 'y', 'arm64': '<br>
> > >> > CONFIG_CEC_PIN_ERROR_INJ policy<{'amd64':<br>
> > 'n', 'arm64': 'n'}><br>
> > >> > CONFIG_COMEDI_TESTS_EXAMPLE policy<{'amd64':<br>
> > 'n', 'arm64': 'm'}><br>
> > >> > CONFIG_COMEDI_TESTS_NI_ROUTES policy<{'amd64':<br>
> > 'n', 'arm64': 'm'}><br>
> > >> > +CONFIG_CONTEXT_TRACKING policy<{'amd64':<br>
> > 'y', 'arm64': 'y'}><br>
> > >> > +CONFIG_CONTEXT_TRACKING_FORCE policy<{'amd64':<br>
> > 'n', 'arm64': 'n'}><br>
> > >> > CONFIG_DEBUG_PREEMPT policy<{'amd64':<br>
> > 'n', 'arm64': 'n'}><br>
> > >> > CONFIG_HZ policy<{'amd64':<br>
> > '1000', 'arm64': '1000'}><br>
> > >> > CONFIG_INLINE_READ_LOCK policy<{'arm64':<br>
> > '-'}><br>
> > >> > @@ -89,4 +99,7 @@ CONFIG_PREEMPT_RCU<br>
> > policy<{'amd64': 'y', 'arm64': '<br>
> > >> > CONFIG_PREEMPT_TRACER policy<{'amd64':<br>
> > 'n', 'arm64': 'n'}><br>
> > >> > CONFIG_TASKS_RCU policy<{'amd64':<br>
> > 'y', 'arm64': 'y'}><br>
> > >> > CONFIG_TEST_DIV64 policy<{'amd64':<br>
> > 'm', 'arm64': 'm'}><br>
> > >> > +CONFIG_TICK_CPU_ACCOUNTING policy<{'amd64':<br>
> > '-', 'arm64': '-'}><br>
> > >> > CONFIG_UNINLINE_SPIN_UNLOCK policy<{'amd64':<br>
> > 'y', 'arm64': 'y'}><br>
> > >> > +CONFIG_VIRT_CPU_ACCOUNTING policy<{'amd64':<br>
> > 'y', 'arm64': 'y'}><br>
> > >> > +CONFIG_VIRT_CPU_ACCOUNTING_GEN policy<{'amd64':<br>
> > 'y', 'arm64': 'y'}><br>
> > >> > --<br>
> > >> > 2.25.1<br>
> > >> ><br>
> > >> ><br>
> > >> > --<br>
> > >> > kernel-team mailing list<br>
> > >> > <a href="mailto:kernel-team@lists.ubuntu.com" target="_blank">kernel-team@lists.ubuntu.com</a><br>
> > >> > <a href="https://lists.ubuntu.com/mailman/listinfo/kernel-team" rel="noreferrer" target="_blank">https://lists.ubuntu.com/mailman/listinfo/kernel-team</a><br>
> > ><br>
> > > --<br>
> > > kernel-team mailing list<br>
> > > <a href="mailto:kernel-team@lists.ubuntu.com" target="_blank">kernel-team@lists.ubuntu.com</a><br>
> > > <a href="https://lists.ubuntu.com/mailman/listinfo/kernel-team" rel="noreferrer" target="_blank">https://lists.ubuntu.com/mailman/listinfo/kernel-team</a><br>
> ><br>
> ><br>
> ><br>
> > --<br>
> > okurrr,<br>
> ><br>
> > Dimitri<br>
> ><br>
</blockquote></div>