From: Clark Williams williams@redhat.com
redhat: enable changes to build rt variants
Set the %with_realtime specfile variable to be 1 and build the kernel-rt variant with ARK build jobs.
Add the CONFIG_PREEMPT_RT config and set default values for PREEMPT_AUTO and PREEMPT_RT for the stock kernels and variants.
Signed-off-by: Clark Williams williams@redhat.com
diff --git a/redhat/configs/common/generic/CONFIG_PREEMPT_AUTO b/redhat/configs/common/generic/CONFIG_PREEMPT_AUTO new file mode 100644 index blahblah..blahblah 100644 --- /dev/null +++ b/redhat/configs/common/generic/CONFIG_PREEMPT_AUTO @@ -0,0 +1 @@ +# CONFIG_PREEMPT_AUTO is not set diff --git a/redhat/configs/fedora/generic/CONFIG_PREEMPT_RT b/redhat/configs/fedora/generic/CONFIG_PREEMPT_RT new file mode 100644 index blahblah..blahblah 100644 --- /dev/null +++ b/redhat/configs/fedora/generic/CONFIG_PREEMPT_RT @@ -0,0 +1 @@ +# CONFIG_PREEMPT_RT is not set diff --git a/redhat/configs/rhel/generic/CONFIG_PREEMPT_RT b/redhat/configs/rhel/generic/CONFIG_PREEMPT_RT new file mode 100644 index blahblah..blahblah 100644 --- /dev/null +++ b/redhat/configs/rhel/generic/CONFIG_PREEMPT_RT @@ -0,0 +1 @@ +# CONFIG_PREEMPT_RT is not set diff --git a/redhat/configs/rhel/rt/generic/CONFIG_PREEMPT_AUTO b/redhat/configs/rhel/rt/generic/CONFIG_PREEMPT_AUTO new file mode 100644 index blahblah..blahblah 100644 --- /dev/null +++ b/redhat/configs/rhel/rt/generic/CONFIG_PREEMPT_AUTO @@ -0,0 +1 @@ +# CONFIG_PREEMPT_AUTO is not set diff --git a/redhat/configs/rhel/rt/generic/CONFIG_PREEMPT_RT b/redhat/configs/rhel/rt/generic/CONFIG_PREEMPT_RT index blahblah..blahblah 100644 --- a/redhat/configs/rhel/rt/generic/CONFIG_PREEMPT_RT +++ b/redhat/configs/rhel/rt/generic/CONFIG_PREEMPT_RT @@ -1 +1 @@ -# CONFIG_PREEMPT_RT is not set +CONFIG_PREEMPT_RT=y diff --git a/redhat/kernel.spec.template b/redhat/kernel.spec.template index blahblah..blahblah 100644 --- a/redhat/kernel.spec.template +++ b/redhat/kernel.spec.template @@ -207,7 +207,7 @@ Summary: The Linux kernel # kernel-64k (aarch64 kernel with 64K page_size) %define with_arm64_64k %{?_without_arm64_64k: 0} %{?!_without_arm64_64k: 1} # kernel-rt (x86_64 and aarch64 only PREEMPT_RT enabled kernel) -%define with_realtime %{?_with_realtime: 1} %{?!_with_realtime: 0} +%define with_realtime %{?_without_realtime: 0} %{?!_without_realtime: 1}
# Supported variants # with_base with_debug with_gcov @@ -1871,7 +1871,7 @@ chmod +x scripts/checkpatch.pl mv COPYING COPYING-%{specrpmversion}-%{release}
# on linux-next prevent scripts/setlocalversion from mucking with our version numbers -rm -f localversion-next +rm -f localversion-next localversion-rt
# Mangle /usr/bin/python shebangs to /usr/bin/python3 # Mangle all Python shebangs to be Python 3 explicitly
-- https://gitlab.com/cki-project/kernel-ark/-/merge_requests/3416
From: Jan Stancek on gitlab.com https://gitlab.com/cki-project/kernel-ark/-/merge_requests/3416#note_2132062...
So, by default enabled on both Fedora and RHEL? I thought it would be opt-in on Fedora initially.
From: Jan Stancek on gitlab.com https://gitlab.com/cki-project/kernel-ark/-/merge_requests/3416#note_2132073...
Is CONFIG_PREEMPT_AUTO in Linus' tree? I can't seem to find where it's defined, so I'm wondering if we need to set this at all in ARK.
From: Justin M. Forbes on gitlab.com https://gitlab.com/cki-project/kernel-ark/-/merge_requests/3416#note_2132082...
This is turned off for Fedora in another chunk of code later in the spec.
From: Jan Stancek on gitlab.com https://gitlab.com/cki-project/kernel-ark/-/merge_requests/3416#note_2132093...
I see.
From: Clark Williams on gitlab.com https://gitlab.com/cki-project/kernel-ark/-/merge_requests/3416#note_2132133...
I'm doing a little digging on CONFIG_PREEMPT_AUTO, starting with:
https://lore.kernel.org/lkml/20240213055554.1802415-1-ankur.a.arora@oracle.c... /
It's a loooong thread from February - May of 2024, discussing adding the patchset for PREEMPT_AUTO. I haven't made it through the thread yet but I kinda suspect that in the changes the PREEMPT_AUTO config went away and we may be dealing with a remnant.
From: Clark Williams on gitlab.com https://gitlab.com/cki-project/kernel-ark/-/merge_requests/3416#note_2132329...
I see it referred to in kernel/rcu/Kconfig, in a commit by Paul McKenny: 1b4e9fdf9ed48
default NEED_TASKS_RCU && (PREEMPTION || PREEMPT_AUTO)
I'll admit to being puzzled by it since the only other place(s) I see PREEMPT_AUTO are in comments where someone calls preempt_disable() in kernel/rcu/srcutiny.c
From: Jan Stancek on gitlab.com https://gitlab.com/cki-project/kernel-ark/-/merge_requests/3416#note_2132649...
It comes from this linux-rt-devel patch: https://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git/diff/k... nel/Kconfig.preempt?id=5ac85c1e95f0334f2b6932388880398526edefe9
It's the same patch you listed in your c10s backport list, so we'll need the config in c10s.
commit 1b4e9fdf9ed489c779259734e0b47f408c7786f2 from February says "anticipate a likely future change by adding PREEMPT_AUTO", but it appears to be still work in progress.
From: Clark Williams on gitlab.com https://gitlab.com/cki-project/kernel-ark/-/merge_requests/3416#note_2133439...
Ok, found it. CONFIG_PREEMPT_AUTO is part of a lazy reschedule change set that Thomas Gleixner has sitting in the linux-rt-devel tree.
sched: define TIF_ALLOW_RESCHED
It's not used right now but will be coming in as we pull in danging stuff from linux-rt-devel (and we definitely want this one). Shouldn't hurt to leave it in place in the configs.
From: Clark Williams on gitlab.com https://gitlab.com/cki-project/kernel-ark/-/merge_requests/3416#note_2133440...
See my comment below about CONFIG_PREEMPT_AUTO
From: Clark Williams on gitlab.com https://gitlab.com/cki-project/kernel-ark/-/merge_requests/3416#note_2133478...
Here's the start of the thread (patch v2) that discusses the changes, if anyone is interested: https://lore.kernel.org/lkml/20240528003521.979836-1-ankur.a.arora@oracle.co...
From: GitLab Security Bot on gitlab.com https://gitlab.com/cki-project/kernel-ark/-/merge_requests/3416#note_2137491...
<!-- policy_violation_comment --> <!-- violated_reports: scan_finding --> <!-- optional_approvals: scan_finding -->
Clark Williams, this merge request has policy violations and errors.
- Resolve all violations in the following merge request approval policies: SAST. - Resolve the errors and re-run the pipeline.
Consider including optional reviewers based on the policy rules in the MR widget.
:exclamation: **Errors**
- Pipeline configuration error: Security reports required by policy `SAST` could not be found. - Pipeline configuration error: Security reports required by policy `SAST` could not be found.
:information_source: **Comparison pipelines**
- Target branch (`os-build`): None - Source branch (`os-build-rt-rebase`): [#1475893024](https://gitlab.com/cki- project/kernel-ark/-/pipelines/1475893024)
From: GitLab Security Bot on gitlab.com https://gitlab.com/cki-project/kernel-ark/-/merge_requests/3416#note_2137491...
<!-- policy_violation_comment --> Security policy violations have been resolved.
kernel@lists.fedoraproject.org