1
0
Fork 0
forked from nuttx/nuttx-update
local-nuttx-update/include
hujun5 b4cc9fb11b sched: change nxsched_islocked_global to nxsched_islocked_tcb
reason:
1 To improve efficiency, we mimic Linux's behavior where preemption disabling is only applicable to the current CPU and does not affect other CPUs.
2 In the future, we will implement "spinlock+sched_lock", and use it extensively. Under such circumstances, if preemption is still globally disabled, it will seriously impact the scheduling efficiency.
3 We have removed g_cpu_lockset and used irqcount in order to eliminate the dependency of schedlock on critical sections in the future, simplify the logic, and further enhance the performance of sched_lock.
4 We set lockcount to 1 in order to lock scheduling on all CPUs during startup, without the need to provide additional functions to disable scheduling on other CPUs.
5 Cpu1~n must wait for cpu0 to enter the idle state before enabling scheduling because it prevents CPUs1~n from competing with cpu0 for the memory manager mutex, which could cause the cpu0 idle task to enter a wait state and trigger an assert.

size nuttx
before:
   text    data     bss     dec     hex filename
 265396   51057   63646  380099   5ccc3 nuttx
after:
   text    data     bss     dec     hex filename
 265184   51057   63642  379883   5cbeb nuttx

size -216

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

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2024-10-05 13:49:55 +08:00
..
android include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00
arpa include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00
crypto include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00
cxx include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00
net include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00
netinet include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00
netpacket include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00
nuttx sched: change nxsched_islocked_global to nxsched_islocked_tcb 2024-10-05 13:49:55 +08:00
ssp include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00
sys include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00
.gitignore .gitignore: add ignore 2024-03-14 22:47:55 +08:00
aio.h include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00
alloca.h include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00
assert.h include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00
byteswap.h include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00
ctype.h include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00
debug.h include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00
dirent.h include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00
dlfcn.h include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00
dsp.h include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00
dspb16.h include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00
elf.h include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00
elf32.h include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00
elf64.h include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00
endian.h include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00
err.h include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00
errno.h include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00
execinfo.h include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00
fcntl.h include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00
fixedmath.h include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00
fnmatch.h include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00
ftw.h include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00
getopt.h include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00
glob.h include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00
grp.h include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00
hex2bin.h include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00
iconv.h include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00
ifaddrs.h include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00
inttypes.h include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00
iso646.h include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00
langinfo.h include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00
libgen.h include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00
libintl.h include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00
limits.h include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00
locale.h include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00
lzf.h include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00
malloc.h include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00
mqueue.h include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00
netdb.h include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00
nl_types.h include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00
nxflat.h include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00
obstack.h include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00
poll.h include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00
pthread.h include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00
pty.h include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00
pwd.h include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00
regex.h include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00
resolv.h include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00
sched.h include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00
search.h hcreate: add alloc/free func hook for user to deallocate memory 2024-08-22 20:25:30 +08:00
semaphore.h include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00
signal.h include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00
spawn.h include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00
stdbool.h include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00
stddef.h include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00
stdint.h include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00
stdio.h include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00
stdlib.h include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00
stdnoreturn.h include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00
string.h include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00
strings.h include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00
syscall.h include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00
syslog.h include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00
termios.h include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00
threads.h include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00
time.h include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00
unistd.h include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00
utime.h include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00
uuid.h include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00
wchar.h include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00
wctype.h include: migrate to SPDX identifier 2024-10-04 08:18:42 +08:00