jlaitine opened a new pull request, #16030: URL: https://github.com/apache/nuttx/pull/16030
## Summary This further optimizes mutexes: 1. If priority inheritance or priority protect are enabled in nuttx config, the fast atomic mutex path should be used, if priority adjusting is not enabled for the mutex. The sem->flags can be read/checked without locking 2. If CONFIG_LIBC_ARCH_ATOMIC is defined, the atomic mutex path should NOT be used, this defaults to spinlock implementation which makes the mutexes heavy 3. The atomic fast mutexes can be used directly from userspace, so add that logic into the libc. This optimizes the pthread_mutexes heavily in protected builds, as the priority inheritance and priority protection are disabled by default in those, and typically there is no need to do the syscall to the kernel at all. ## Impact Has no functional impact, but increases performance especially for: - pthread_mutexes in CONFIG_BUILD_KERNEL - pthread_mutexes when the CONFIG_PRIORITY_INHERITANCE and/or CONFIG_PRIORITY_PROTECT are enabled - in case CONFIG_LIBC_ARCH_ATOMIC is defined ## Testing - rv-virt:nsh: ostest passes - rv-virt64:nsh: ostest passes - log: "$ qemu-system-riscv64 -semihosting -M virt,aclint=on -cpu rv64 -bios none -kernel nuttx -nographic 2>&1 | tee log.txt" [log.txt](https://github.com/user-attachments/files/19387546/log.txt) + with TII custom mpfs targets w. application sw, with SMP 4 cores, CONFIG_BUILD_FLAT and CONFIG_BUILD_KERNEL -- 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: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org