nuttx icon indicating copy to clipboard operation
nuttx copied to clipboard

sched/sched: simplify the implementation of the function nxsched_readytorun_setpriority

Open hujun260 opened this issue 1 year ago • 3 comments

Summary

If the type of tcb is TSTATE_TASK_ASSIGNED, removing it using nxsched_remove_not_running and then putting it back into the queue may result in a context switch.

Impact

Testing

Configuring NuttX and compile:

$ ./tools/configure.sh -l qemu-armv8a:nsh_smp
$ make
Running with qemu
$ qemu-system-aarch64 -cpu cortex-a53 -smp 4 -nographic \
   -machine virt,virtualization=on,gic-version=3 \
   -net none -chardev stdio,id=con,mux=on -serial chardev:con \
   -mon chardev=con,mode=readline -kernel ./nuttx

hujun260 avatar Aug 19 '24 13:08 hujun260

@hujun260 How did you test the change? As far as I have investigated, the ostest does not test the function.

masayuki2009 avatar Aug 19 '24 23:08 masayuki2009

@hujun260 How did you test the change? As far as I have investigated, the ostest does not test the function.

The bug was found during our internal monkey testing. In some cases, it would trigger DEBUGASSERT(check == false), so we changed it to a more general implementation and passed the internal monkey testing.

hujun260 avatar Aug 20 '24 05:08 hujun260

@hujun260 How did you test the change? As far as I have investigated, the ostest does not test the function.

do you have better suggestion? @masayuki2009

xiaoxiang781216 avatar Aug 26 '24 18:08 xiaoxiang781216