-
Notifications
You must be signed in to change notification settings - Fork 164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PREEMPT_RT support for EVE #3254
Conversation
4bc287f
to
c87aa23
Compare
+# CONFIG_SLUB_DEBUG is not set | ||
+# CONFIG_SLUB_MEMCG_SYSFS_ON is not set | ||
# CONFIG_COMPAT_BRK is not set | ||
-CONFIG_SLAB=y |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't notice we were using SLAB before.... but I guess you are changing to SLUB only for improvements, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the default, comes with the preemt_rt. I left untouched.
# end of Scheduler Debugging | ||
|
||
# CONFIG_DEBUG_TIMEKEEPING is not set | ||
+CONFIG_DEBUG_PREEMPT=y |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Enable DEBUG here will increase overhead and affect the performance, I don't think we should enabled by default...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left as is intentionally. Want to catch any complains from kernel if preempted in unsafe way. Want to see the whole virtualization stack in action. Will disable later.
preempt_lazy_disable(); | ||
preempt_enable(); | ||
} | ||
-EXPORT_SYMBOL_GPL(migrate_disable); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this change was not needed before?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before those methods were declared as static inline in the header, so no export beeded
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
*needed
0ae507e
to
e2ae120
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Should we do a separate PR which applies this to new-kernel as well?
@eriknordmark Frankly I don't want to bother with a new kernel now, because it is used for risc only and the future of the whole new-kernel is not clear: do we drop it and switch the main kernel to a 5.15? Update: or better to invest time and unify both Dockerfile and do the same trick with building a 5.15 on demand by 'KERNEL=5.15' make argument? |
Over the next few months we should update the kernel. But if we keep them in synch that can be done by "rm -rf kernel; mv new-kernel kernel; mkdir new-kernel; // fill new-kernel with next kernel LTS" Don't know if it is worth the effort to keep them in synch for that reason.
Probably not worth while if we are going to externalize the kernel build from the repo. |
This does not eliminate the dockerfile and all the efforts to keep both in sync, we just skip the step of downloading the kernel sources and applying patches. Other than that stays the same. |
…0.131 In the next patches I introduce the preempt-rt patches, which can be applied without conflicts on the nearest stable 131 version. Signed-off-by: Roman Penyaev <r.peniaev@gmail.com>
Parlez-vous francais? Ich auch. Signed-off-by: Roman Penyaev <r.peniaev@gmail.com>
Signed-off-by: Roman Penyaev <r.peniaev@gmail.com>
kernel-yml: | ||
$(QUIET)if [ ! -f "pkg/kernel/build.yml" ] || [ ! -f "pkg/new-kernel/build.yml" ]; then tools/kernel-build-yml.sh; fi | ||
|
||
$(QUIET)$(KERNEL_BUILD_YML_TOOL) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do I get it right, that now kernel-yml will always be quiet?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems nothing has been changed, QUIET was always there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess I like python more than bash :D But nevertheless, you are removing check if pkg/kernel/build.yml
and pkg/new-kernel/build.yml
files exist and instead we always put tools/kernel-build-yml.sh
with PREEMT_RT variable. Why do we skip it now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The commit message should tell the whole story: e66a85a
What's probably is missing in the description is the following line: "We need to generate the build.yml each time to reflect the changes in the PREEMPT_RT_SUPPORT build argument"
@rouming you say this PR targets only amd64, do we need to include some checks that PREEMT_RT will not build for arm or did I miss them? |
The config for other arches is missing, so no worries, you get an error :) |
Difference to the previous version:
|
Tidy up how we call the kernel-build-yml.sh. Also don't check the existence of generated files and re-generate them unconditionally to reflect possible changes of the PREEMPT_RT_SUPPORT build argument. Re-generated build.yml files should not differ in other build arguments, which are passed for making reproducible kernel builds. Signed-off-by: Roman Penyaev <r.peniaev@gmail.com>
…RT kernel Generate build.yml with the "eve-rt-kernel" image and PREEMPT_RT_SUPPORT build args set to true. In the future patches the Dockerfile will be modified to support the PREEMPT_RT flavour of the kernel. To build the "eve-rt-kernel" the following has to be called: make pkg/kernel PREEMPT_RT=1 Signed-off-by: Roman Penyaev <r.peniaev@gmail.com>
No functional change, just tidy the dockerfile up and make the procedure of keys copy before actual patches applying and building. This is needed for the next patches, which introduce the PREEMPT_RT patching. Signed-off-by: Roman Penyaev <r.peniaev@gmail.com>
This patch introduces the PREEMPT_RT support for the main EVE kernel for the x86_64 architecture by: 1. Adding the official `patch-5.10.131-rt72.patch.gz` set of patches 2. Adding the patch which does not export the migrate_enable() and migrate_disable() kernel calls as GPL. OpenZFS is not GPL but uses those calls. 3. Once the 'make pkg/kernel PREEMPT_RT=1' is specified the PREEMPT_RT kernel flavour is built in the 'eve-rt-kernel' docker image. 4. To build a live image with the PREEMPT_RT kernel call as the following: 'make live PREEMPT_RT=1'. The same applies for the installer images, e.g.: 'make installer-iso PREEMPT_RT=1' Signed-off-by: Roman Penyaev <r.peniaev@gmail.com>
Difference to the previous version:
|
I pay 5 euro for approval. Offer is valid today only. |
They are not in that sync anyways, I don't think is worth to introduce all these change in new-kernel right now.... |
preempt_enable(); | ||
} | ||
-EXPORT_SYMBOL_GPL(migrate_disable); | ||
+EXPORT_SYMBOL(migrate_disable); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we sure that from a law/license point of view this is allowed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Until we don't ship the product - why not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or even we ship the product
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be worth to ask a lawyer ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this raises questions I can drop the compilation of the openzfs for preempt_rt.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@eriknordmark interesting question from Christoph
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm trying to understand why in the RT case you need to export migrate_{enabled,disabled} to ZFS, but that is not needed in the non-RT case. Are there some RT patches to the zfs module?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before the PREEMPT_RT patches the "migrate_{enabled,disbled}" calls were defined as "static inline" in the header file (defined and declared!), so basically ANY driver with ANY license can use these API calls.
With the PREEMPT_RT patches those two calls were moved and defined in a sched/core.c. Since this is a public API, the exporting should be done. Authors of the PREEMPT_RT exported those two calls as GPL (basically limiting to only GPL users), so any driver which announce itself as non-GPL is not able to be linked with those two calls (since they are GPL).
I removed GPL export suffix to let the openzfs use those calls. If we think, this is dangerous etc, then I will remove a patch and exclude openzfs from compilation for the PREEMPT_RT case.
But frankly, this is pure debug feature. Who cares?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM after the issue with docker tag is resolved
Just a line, which exposes the possibility to build PREEMPT_RT EVE for x86_64 only. make pkg/kernel PREEMPT_RT=1 make live PREEMPT_RT=1 Signed-off-by: Roman Penyaev <r.peniaev@gmail.com>
Difference to the previous version:
|
LGTM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This PR introduces the PREEMPT_RT support for the main EVE kernel (pkg/kernel) for the x86_64 architecture by
Bumping up the minor version of the main kernel to the 5.1.131 to be aligned with PREEMPT_RT patches.
Adding the official
patch-5.10.131-rt72.patch.gz
set of patches.Adding the patch which does not export the migrate_enable() and migrate_disable() kernel calls as GPL. OpenZFS is not GPL but uses those calls. Before the PREEMPT_RT patches those two calls were declared as "static inline" in the header, thus no export was needed.
Once the 'make pkg/kernel PREEMPT_RT=1' is specified the PREEMPT_RT kernel flavour is built in the 'eve-rt-kernel' docker image.
To build a live image with the PREEMPT_RT kernel call as the following: 'make live PREEMPT_RT=1'. The same applies for the installer images, e.g.: 'make installer-iso PREEMPT_RT=1'.
The PR is quite conservative and introduces a new kernel flavor which can be enabled on demand, so that by default other functionality is not touched.
This PR targets only amd64, since PREEMPT_RT scheduler can't be enabled on arm64 along with the KVM support (what a bummer).
There are a few changes in Dockerfile (recent security improvements) and kernel-build-yml.sh script, so @shjala please take a look.