Skip to contentSkip to conversation

package/rt-tests: remove sched_setattr/sched_getattr API for SuperH arch

PATCH New Romain Naour 2 participants 6 messages Aug 7, 2016 – Aug 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 package/rt-tests: remove sched_setattr/sched_getattr API for SuperH arch

This commit remove rt-sched.o from librttest and pi_stress test program only for SuperH arch which doesn't have __NR_sched_setattr and __NR_sched_getattr syscalls defined.

Patch [1] adding these syscalls has not been merged in upstream kernel (4.7).

Fixes:
http://autobuild.buildroot.net/results/67fc16366717f34df492683a14ecd23376e23110

[1] http://www.spinics.net/lists/linux-sh/msg41990.html

---
 package/rt-tests/rt-tests.mk | 10 ++++++++++
 1 file changed, 10 insertions(+)
package/rt-tests/rt-tests.mk +10 -0
index 19f1021..1433106 100644
@@ -14,6 +14,16 @@ ifeq ($(BR2_PACKAGE_PYTHON),y)
 RT_TESTS_DEPENDENCIES = python
 endif
 
+# Deadline scheduler syscalls are not defined on SuperH.
+# Remove pi_stress which depends on deadline scheduler syscalls.
+ifeq ($(BR2_sh),y)
+define RT_TESTS_REMOVE_RT_SCHED_API
+	$(SED) "s/rt-sched.o//" $(@D)/Makefile
+	$(SED) "s/pi_stress.c//" $(@D)/Makefile
+endef
+endif
+RT_TESTS_POST_PATCH_HOOKS += RT_TESTS_REMOVE_RT_SCHED_API
+
 define RT_TESTS_BUILD_CMDS
 	$(MAKE) -C $(@D) 			\
 		CC="$(TARGET_CC)" 		\
Signature · 1 line
2.5.5
#1 lore raw

PATCH 2/2 package/rt-tests: remove dependency on headers >= 3.14

The dependency on kernel headers >= 3.14 was added by b9fa6c00b1213fd038f2aed52057f22c7e18fd4b since librttest requires __NR_sched_setattr and __NR_sched_getattr syscalls (rt-sched).

But a follow up patch allows to remove these syscalls from librttest. So keep rt-tests package available for old toolchains (pre 3.14) and remove pi-stress program if necessary.

---
 package/rt-tests/Config.in   |  5 ++---
 package/rt-tests/rt-tests.mk | 10 +++++++---
 2 files changed, 9 insertions(+), 6 deletions(-)
package/rt-tests/Config.in +2 -3
index b39856d..08967ce 100644
@@ -1,7 +1,6 @@
 config BR2_PACKAGE_RT_TESTS
 	bool "rt-tests"
 	depends on BR2_TOOLCHAIN_HAS_THREADS_NPTL
-	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_14 # deadline scheduler syscall
 	depends on BR2_USE_MMU # fork()
 	depends on !BR2_STATIC_LIBS # dlopen
 	depends on !BR2_TOOLCHAIN_USES_MUSL # cyclictest
@@ -29,7 +28,7 @@ comment "rt-tests may not work on MIPS with an external uClibc toolchain"
 	depends on BR2_TOOLCHAIN_EXTERNAL_UCLIBC
 	depends on BR2_mips || BR2_mipsel || BR2_mips64 || BR2_mips64el
 
-comment "rt-tests needs a uClibc or glibc toolchain w/ NPTL, headers >= 3.14, dynamic library"
+comment "rt-tests needs a uClibc or glibc toolchain w/ NPTL, dynamic library"
 	depends on !BR2_TOOLCHAIN_HAS_THREADS_NPTL || BR2_STATIC_LIBS \
-		|| BR2_TOOLCHAIN_USES_MUSL || !BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_14
+		|| BR2_TOOLCHAIN_USES_MUSL
 	depends on BR2_USE_MMU
package/rt-tests/rt-tests.mk +7 -3
index 1433106..6e42de1 100644
@@ -14,15 +14,19 @@ ifeq ($(BR2_PACKAGE_PYTHON),y)
 RT_TESTS_DEPENDENCIES = python
 endif
 
-# Deadline scheduler syscalls are not defined on SuperH.
 # Remove pi_stress which depends on deadline scheduler syscalls.
-ifeq ($(BR2_sh),y)
 define RT_TESTS_REMOVE_RT_SCHED_API
 	$(SED) "s/rt-sched.o//" $(@D)/Makefile
 	$(SED) "s/pi_stress.c//" $(@D)/Makefile
 endef
-endif
+
+# Deadline scheduler syscalls are not defined on SuperH.
+# Deadline scheduler syscalls needs a toolchain w/ headers >= 3.14.
+ifeq ($(BR2_sh),y)
 RT_TESTS_POST_PATCH_HOOKS += RT_TESTS_REMOVE_RT_SCHED_API
+else ifeq ($(BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_14),)
+RT_TESTS_POST_PATCH_HOOKS += RT_TESTS_REMOVE_RT_SCHED_API
+endif
 
 define RT_TESTS_BUILD_CMDS
 	$(MAKE) -C $(@D) 			\
Signature · 1 line
2.5.5
#2 lore raw

PATCH 1/2 package/rt-tests: remove sched_setattr/sched_getattr API for SuperH arch

In reply to Romain Naour

Hi Romain,

Quoted 6 lines · Romain Naour

This commit remove rt-sched.o from librttest and pi_stress test program only for SuperH arch which doesn't have __NR_sched_setattr and __NR_sched_getattr syscalls defined.

Patch [1] adding these syscalls has not been merged in upstream kernel (4.7).

But these syscalls were added for 4.8-rc1 (commit 74bdaa611fa69). This solution prevents sched_{set,get}attr use even for future v4.8+ kernels.

baruch

Quoted 31 lines

Fixes:
http://autobuild.buildroot.net/results/67fc16366717f34df492683a14ecd23376e23110

[1] http://www.spinics.net/lists/linux-sh/msg41990.html

---
 package/rt-tests/rt-tests.mk | 10 ++++++++++
 1 file changed, 10 insertions(+)
package/rt-tests/rt-tests.mk +10 -0
index 19f1021..1433106 100644
@@ -14,6 +14,16 @@ ifeq ($(BR2_PACKAGE_PYTHON),y)
 RT_TESTS_DEPENDENCIES = python
 endif
 
+# Deadline scheduler syscalls are not defined on SuperH.
+# Remove pi_stress which depends on deadline scheduler syscalls.
+ifeq ($(BR2_sh),y)
+define RT_TESTS_REMOVE_RT_SCHED_API
+	$(SED) "s/rt-sched.o//" $(@D)/Makefile
+	$(SED) "s/pi_stress.c//" $(@D)/Makefile
+endef
+endif
+RT_TESTS_POST_PATCH_HOOKS += RT_TESTS_REMOVE_RT_SCHED_API
+
 define RT_TESTS_BUILD_CMDS
 	$(MAKE) -C $(@D) 			\
 		CC="$(TARGET_CC)" 		\
Signature · 3 lines
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -
#3 lore raw

PATCH 1/2 package/rt-tests: remove sched_setattr/sched_getattr API for SuperH arch

Hi Baruch,

Le 08/08/2016 ? 06:42, Baruch Siach a ?crit :

Quoted 7 lines

Hi Romain,

Quoted 4 lines · Romain Naour

This commit remove rt-sched.o from librttest and pi_stress test program only for SuperH arch which doesn't have __NR_sched_setattr and __NR_sched_getattr syscalls defined.

Quoted 5 lines
Quoted 2 lines

Patch [1] adding these syscalls has not been merged in upstream kernel (4.7).

But these syscalls were added for 4.8-rc1 (commit 74bdaa611fa69). This solution prevents sched_{set,get}attr use even for future v4.8+ kernels.

Thanks for this info, I haven't checked the upcoming 4.8 kernel.

However, it means that pi_stress should depends on BR2_sh and BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_8. But this symbol doesn't exist yet in Buildroot.

I think this patch can be commited as is (kernel 4.8 will be released after 2016.08) and the dependency on BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_8 can be added in a follow up patch.

At least, I can improve the commit log with this info :)

Best regards,
Romain

Quoted 35 lines

baruch

Quoted 31 lines

Fixes:
http://autobuild.buildroot.net/results/67fc16366717f34df492683a14ecd23376e23110

[1] http://www.spinics.net/lists/linux-sh/msg41990.html

---
 package/rt-tests/rt-tests.mk | 10 ++++++++++
 1 file changed, 10 insertions(+)
package/rt-tests/rt-tests.mk +10 -0
index 19f1021..1433106 100644
@@ -14,6 +14,16 @@ ifeq ($(BR2_PACKAGE_PYTHON),y)
 RT_TESTS_DEPENDENCIES = python
 endif
 
+# Deadline scheduler syscalls are not defined on SuperH.
+# Remove pi_stress which depends on deadline scheduler syscalls.
+ifeq ($(BR2_sh),y)
+define RT_TESTS_REMOVE_RT_SCHED_API
+	$(SED) "s/rt-sched.o//" $(@D)/Makefile
+	$(SED) "s/pi_stress.c//" $(@D)/Makefile
+endef
+endif
+RT_TESTS_POST_PATCH_HOOKS += RT_TESTS_REMOVE_RT_SCHED_API
+
 define RT_TESTS_BUILD_CMDS
 	$(MAKE) -C $(@D) 			\
 		CC="$(TARGET_CC)" 		\
#4 lore raw

PATCH 1/2 package/rt-tests: remove sched_setattr/sched_getattr API for SuperH arch

Hi Romain,

Quoted 12 lines · Romain Naour

Le 08/08/2016 ? 06:42, Baruch Siach a ?crit :

Quoted 10 lines · Romain Naour
Quoted 6 lines

This commit remove rt-sched.o from librttest and pi_stress test program only for SuperH arch which doesn't have __NR_sched_setattr and __NR_sched_getattr syscalls defined.

Patch [1] adding these syscalls has not been merged in upstream kernel (4.7).

But these syscalls were added for 4.8-rc1 (commit 74bdaa611fa69). This solution prevents sched_{set,get}attr use even for future v4.8+ kernels.

Quoted 8 lines

Thanks for this info, I haven't checked the upcoming 4.8 kernel.

However, it means that pi_stress should depends on BR2_sh and BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_8. But this symbol doesn't exist yet in Buildroot.

I think this patch can be commited as is (kernel 4.8 will be released after 2016.08) and the dependency on BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_8 can be added in a follow up patch.

Alternatively, you may patch src/include/rt-sched.h to add sh syscall numbers, in addition to the existing i386, x86_64, and ARM ones. That would fix the current build issue, and would also be future proof. Such a patch might even be acceptable upstream.

baruch

Signature · 3 lines
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -
#5 lore raw

PATCH 1/2 package/rt-tests: remove sched_setattr/sched_getattr API for SuperH arch

Hi Baruch,

Le 09/08/2016 ? 20:30, Baruch Siach a ?crit :

Quoted 20 lines

Hi Romain,

Quoted 17 lines · Romain Naour

Le 08/08/2016 ? 06:42, Baruch Siach a ?crit :

Quoted 10 lines · Romain Naour
Quoted 6 lines

This commit remove rt-sched.o from librttest and pi_stress test program only for SuperH arch which doesn't have __NR_sched_setattr and __NR_sched_getattr syscalls defined.

Patch [1] adding these syscalls has not been merged in upstream kernel (4.7).

But these syscalls were added for 4.8-rc1 (commit 74bdaa611fa69). This solution prevents sched_{set,get}attr use even for future v4.8+ kernels.

Thanks for this info, I haven't checked the upcoming 4.8 kernel.

However, it means that pi_stress should depends on BR2_sh and BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_8. But this symbol doesn't exist yet in Buildroot.

Quoted 8 lines
Quoted 3 lines

I think this patch can be commited as is (kernel 4.8 will be released after 2016.08) and the dependency on BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_8 can be added in a follow up patch.

Alternatively, you may patch src/include/rt-sched.h to add sh syscall numbers, in addition to the existing i386, x86_64, and ARM ones. That would fix the current build issue, and would also be future proof. Such a patch might even be acceptable upstream.

Ok thanks, I'll do that.
I think I'll keep the kernel headers dependency on 3.14 since the next rt-tests version will add two new test program for SCHED_DEADLINE (cyclicdeadline and deadline_test). So RT_TESTS_REMOVE_RT_SCHED_API would be updated on each version bump.

Best regards,
Romain

Quoted 3 lines

baruch