casaroli opened a new pull request, #21426:
URL: https://github.com/apache/nuttx/pull/21426

   ## Summary
   
   Some settings of the SCHED_CRITMONITOR_MAXTIME_* options do not build on 
master. Documentation/os/interrupts/critical_sections.rst gives -1 as the value 
that disables each monitor.
   
   - SCHED_CRITMONITOR_MAXTIME_THREAD -1: struct tcb_s has no run_start, 
run_time and run_max, but nxsched_switch_critmon() and nxsched_update_critmon() 
use them. The first commit computes the time slice only for the thread monitor, 
and builds nxsched_update_critmon() only then (its only caller is 
SCHED_CPULOAD_CRITMONITOR, which depends on SCHED_CRITMONITOR_MAXTIME_THREAD >= 
0).
   - SCHED_CRITMONITOR_MAXTIME_BUSYWAIT >= 0 with 
SCHED_CRITMONITOR_MAXTIME_CSECTION -1: irq.h makes leave_critical_section() a 
macro for leave_critical_section_notrace(), but irq_csection.c still defines 
the function, so leave_critical_section_notrace() is defined twice. The second 
commit builds leave_critical_section() with the condition of irq.h (it does 
nothing for the busy-wait time).
   - With FS_PROCFS, proc_critmon() has unused variables when the thread 
monitor is -1, and when all its monitors are -1 (an error with -Werror). The 
third commit fixes them as critmon_read_cpu() in fs_procfscritmon.c does.
   
   ## Impact
   
   Build fixes only. The code of the settings that build on master does not 
change. No API change, no documentation change.
   
   ## Testing
   
   Builds with EXTRAFLAGS="-Wno-cpp -Werror", SCHED_CRITMONITOR and FS_PROCFS. 
"The others" are WQUEUE, BUSYWAIT, IRQ and WDOG.
   
   | config | settings | builds | this PR |
   |---|---|---|---|
   | stm32f4discovery:nsh (arm, flat) | THREAD, PREEMPTION, CSECTION each -1 / 
0, the others together -1 / 0 | 16 | all OK |
   | stm32f4discovery:nsh | only one of the others at 0, all else -1 | 4 | all 
OK |
   | stm32f4discovery:nsh | SCHED_CPULOAD_CRITMONITOR with THREAD 0 and the 
others -1 / 0; everything at 100 | 3 | all OK |
   | qemu-armv8a:nsh_smp (arm64, SMP) | THREAD -1; THREAD 0 + 
SCHED_CPULOAD_CRITMONITOR | 2 | all OK |
   | qemu-armv8a:knsh (arm64, kernel) | THREAD -1 | 1 | OK |
   
   On master, nucleo-l432kc:nsh fails with THREAD -1 (sched_critmonitor.c: no 
member run_start) and with THREAD 0 + BUSYWAIT 0 (irq_csection.c: redefinition 
of leave_critical_section_notrace). The proc_critmon() errors show with the 
first two commits only, on qemu-armv8a:nsh_smp and qemu-armv8a:knsh with THREAD 
-1.
   
   Run: qemu-armv8a:nsh (HVF) with SCHED_CRITMONITOR_MAXTIME_THREAD -1 
(PREEMPTION and CSECTION 0) boots, and ostest exits with status 0. With the 
default THREAD 0, ostest also exits with status 0.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to