I'm trying to build the RT kernel source RPM from the link "http://vault.centos.org/7.3.1611/rt/Sou ... l7.src.rpm".
In default "CONFIG_PREEMPT_RT_FULL" is enabled. But when "CONFIG_PREEMPT_RTB" is enabled there is a COMPILATION ISSUE, I have to apply the below source patch to fix the build.
There are two RT source RPMs in the repository, both seems to have the same issue.
This seems a kernel source bug, please clarify. Please also let me know if there is a patch available that fix the issue or if I'm doing anything wrong.
The way I update the kernel config was using "make oldconfig" and "make menuconfig" Patch used to fix the build issue with PREEMT_RTB enabled
---------------------------------------------------------------------------
MCP Custom Changes - 5/8/2017
The following changes are to support compiling Linux with the basic realtime preemption scheme.
Without these changes, compilation errors occurred when building Linux with RT basic.
Code: Select all
diff -uNr linux-3.10.0.x86_64/include/drm/drm_backport.h linux-patch-dir/include/drm/drm_backport.h
--- linux-3.10.0.x86_64/include/drm/drm_backport.h 2016-12-14 15:12:03.000000000 -0500
+++ linux-patch-dir/include/drm/drm_backport.h 2017-05-08 10:25:08.453144931 -0400
@@ -164,9 +164,17 @@
}
#define cpu_relax_lowlatency() cpu_relax()
-#ifndef CONFIG_PREEMPT_RT_FULL
-#define pagefault_disabled() in_atomic()
-#endif
+/*
+ * MCP Custom Change
+ * Comment out the definition of pagefault_disabled.
+ * Without this line being commented out, the compiler
+ * complains because pagefault_disabled() is defined in two places.
+ * One place is here as a macro. The other place is in include/sched.h
+ * as a function definition.
+ */
+//#ifndef CONFIG_PREEMPT_RT_FULL
+//#define pagefault_disabled() in_atomic()
+//#endif
static inline int arch_phys_wc_index(int handle)
{
diff -uNr linux-3.10.0.x86_64/kernel/sched/core.c linux-patch-dir/kernel/sched/core.c
--- linux-3.10.0.x86_64/kernel/sched/core.c 2016-12-14 15:12:03.000000000 -0500
+++ linux-patch-dir/kernel/sched/core.c 2017-05-08 10:23:23.955151340 -0400
@@ -5519,7 +5519,15 @@
#if defined(CONFIG_PREEMPT_RT_BASE)
/* As we have the actual cpumask trimmed down to nr_cpu_ids bits, we need
to zero the remaining bits to avoid garbage being sent to userspace */
- memset(mask, 0, sizeof(mask));
+
+ /* MCP Custom Change
+ * Comment out this memset.
+ * Without it being commented out, the compiler complains that the sizeof
+ * argument is referencing the size of a pointer rather than the underlying
+ * data type. This is correct since the data type of mask is typedef'd to
+ * a pointer.
+ */
+ //memset(mask, 0, sizeof(mask));
#endif
if ((len * BITS_PER_BYTE) < nr_cpu_ids)
return -EINVAL;
diff -uNr linux-3.10.0.x86_64/net/core/dev.c linux-patch-dir/net/core/dev.c
--- linux-3.10.0.x86_64/net/core/dev.c 2016-12-14 15:12:03.000000000 -0500
+++ linux-patch-dir/net/core/dev.c 2017-05-08 10:21:58.075156608 -0400
@@ -2935,7 +2935,11 @@
__this_cpu_inc(xmit_recursion);
}
-static inline int xmit_rec_dec(void)
+/* MCP Custom Change
+ * Change return type from int to void
+ * so that the compiler doesn't complain. This looks like an typo.
+ */
+static inline void xmit_rec_dec(void)
{
__this_cpu_dec(xmit_recursion);
}