Skip to content

sched/signals: improvements for when all signals are disabled#17991

Merged
xiaoxiang781216 merged 13 commits intoapache:masterfrom
wangchdo:fix_disable_all_signals_issue
Feb 26, 2026
Merged

sched/signals: improvements for when all signals are disabled#17991
xiaoxiang781216 merged 13 commits intoapache:masterfrom
wangchdo:fix_disable_all_signals_issue

Conversation

@wangchdo
Copy link
Contributor

Summary

THis PR includes below three updates:

  1. updatesleep()and usleep() to use nxsched_nanosleep() when all signals are disabled, so when all signals are disabled, sleep function can still be available and ostest can pass
  2. remove pthread_kill() and pthread_sigmask() implementations when all signals are disabled, since these two functions rely on signals
  3. remove the altmdm_timer related implementation and API definitions when all signals are disabled, since they rely on signals

Impact

Improve the implementation when all signals are disabled, only impact the functions when all signals are disabled.

Testing

ostest for when all signals are disabled depends on apache/nuttx-apps#3333

ostest passed on rv-virt:smp64

img_v3_02u2_8490fb47-4f24-475c-805c-1315797504dg

NuttShell (NSH)
nsh> 
nsh> 
nsh> uname -a 
NuttX 0.0.0 13e8f81f01-dirty Jan 18 2026 22:15:53 risc-v rv-virt
nsh> ostest

(...)

user_main: smp call test
smp_call_test: Test start
smp_call_test: Call cpu 0, nowait
smp_call_test: Call cpu 0, wait
smp_call_test: Call cpu 1, nowait
smp_call_test: Call cpu 1, wait
smp_call_test: Call cpu 2, nowait
smp_call_test: Call cpu 2, wait
smp_call_test: Call cpu 3, nowait
smp_call_test: Call cpu 3, wait
smp_call_test: Call cpu 4, nowait
smp_call_test: Call cpu 4, wait
smp_call_test: Call cpu 5, nowait
smp_call_test: Call cpu 5, wait
smp_call_test: Call cpu 6, nowait
smp_call_test: Call cpu 6, wait
smp_call_test: Call cpu 7, nowait
smp_call_test: Call cpu 7, wait
smp_call_test: Call multi cpu, nowait
smp_call_test: Call in interrupt, wait
smp_call_test: Call multi cpu, wait
smp_call_test: Test success

Final memory usage:
VARIABLE  BEFORE   AFTER
======== ======== ========
arena     1fc3780  1fc3780
ordblks         1        6
mxordblk  1fb86d8  1fa2b78
uordblks     b0a8    11f20
fordblks  1fb86d8  1fb1860
user_main: Exiting
ostest_main: Exiting with status 0
nsh> 

@github-actions github-actions bot added Area: Drivers Drivers issues Area: OS Components OS Components issues Size: S The size of the change in this PR is small labels Jan 18, 2026
@wangchdo wangchdo force-pushed the fix_disable_all_signals_issue branch 2 times, most recently from c53b84a to 6b46448 Compare January 18, 2026 15:17
@wangchdo wangchdo force-pushed the fix_disable_all_signals_issue branch from 6b46448 to a1c1f12 Compare January 19, 2026 02:36
@github-actions github-actions bot added Area: Networking Effects networking subsystem Area: File System File System issues Area: Sensors Sensors issues Area: Graphics Size: M The size of the change in this PR is medium labels Jan 19, 2026
@wangchdo wangchdo force-pushed the fix_disable_all_signals_issue branch 2 times, most recently from fb52bef to 286d12b Compare January 19, 2026 03:07
@github-actions github-actions bot removed Area: Sensors Sensors issues Size: S The size of the change in this PR is small Area: Graphics labels Feb 25, 2026
  When all signals are disabled, remove the altmdm_timer-related
  implementation and API definitions.

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
When all signals are disabled, nxsig_notification is not available and
should not be invoked. Remove the call to avoid build and runtime issues
in no-signal configurations.

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
DEV_GPIO_NSIGNALS relies on signal support. Add an explicit Kconfig
dependency on SIGNALS to prevent invalid no-signal configurations.

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
When all signals are disabled, nxsig_notification is not available and
should not be invoked. Remove the call to avoid build and runtime issues
in no-signal configurations.

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
Move the implementation of nxsig_clockwait() into a separate file
to decouple it from nxsig_timedwait().

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
Update nxsig_clockwait() to handle the case where all signals functions
are disabled.

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
When all signals are disabled, nxsig_notification is not available and
should not be invoked. Remove the call to avoid build and runtime issues
in no-signal configurations.

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
…abled

When all signals are disabled, nxsig_notification is not available and
should not be invoked. Remove the call to avoid build and runtime issues
in no-signal configurations.

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
…bled

 When all signals are disabled, nxsig_notification is not available and
 should not be invoked. Remove the call to avoid build and runtime issues
 in no-signal configurations.

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
When all signals are disabled, nxsig_notification is not available and
should not be invoked. Remove the call to avoid build and runtime issues
in no-signal configurations.

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
@wangchdo wangchdo force-pushed the fix_disable_all_signals_issue branch from d93decb to 94c3ea4 Compare February 26, 2026 03:22
@wangchdo wangchdo requested a review from anchao as a code owner February 26, 2026 03:22
@github-actions github-actions bot added Size: L The size of the change in this PR is large and removed Size: M The size of the change in this PR is medium labels Feb 26, 2026
 when all signals are disabled, aio should not be enabled

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
 disable fs automounter when no signals, since fs automounter
 depends on signals

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
 pthread_kill depends on signasl, so when all signals are disabled
 disable pthread_kill too

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
@wangchdo wangchdo force-pushed the fix_disable_all_signals_issue branch from 94c3ea4 to b8b00ec Compare February 26, 2026 04:54
@wangchdo
Copy link
Contributor Author

All comments fixed, please double check if this PR is ready to be mereged @jerpelea @anchao @acassis

@xiaoxiang781216 xiaoxiang781216 merged commit 5060ee8 into apache:master Feb 26, 2026
40 checks passed
@wangchdo wangchdo deleted the fix_disable_all_signals_issue branch February 26, 2026 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: Drivers Drivers issues Size: L The size of the change in this PR is large

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants