Re: [PR] spin_lock_irqsave+sched_lock [nuttx]

2025-01-23 Thread via GitHub
anchao commented on PR #14578: URL: https://github.com/apache/nuttx/pull/14578#issuecomment-2609691441 @hujun260 Great work, I think we can prepare a report showing the benefits of SMP mode after all spinlock changes -- This is an automated message from the Apache Git Service. To respond

Re: [PR] spin_lock_irqsave+sched_lock [nuttx]

2025-01-23 Thread via GitHub
xiaoxiang781216 merged PR #14578: URL: https://github.com/apache/nuttx/pull/14578 -- 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...@nu

Re: [PR] spin_lock_irqsave+sched_lock [nuttx]

2025-01-23 Thread via GitHub
hujun260 commented on code in PR #14578: URL: https://github.com/apache/nuttx/pull/14578#discussion_r1926571146 ## sched/sched/sched_unlock.c: ## @@ -288,30 +137,23 @@ int sched_unlock(void) if ((rtcb->flags & TCB_FLAG_POLICY_MASK) == TCB_FLAG_SCHED_SPORADIC

Re: [PR] spin_lock_irqsave+sched_lock [nuttx]

2025-01-22 Thread via GitHub
xiaoxiang781216 commented on code in PR #14578: URL: https://github.com/apache/nuttx/pull/14578#discussion_r1926505855 ## sched/sched/sched_unlock.c: ## @@ -53,48 +53,25 @@ * / -#ifdef CONFIG_SMP -

Re: [PR] spin_lock_irqsave+sched_lock [nuttx]

2025-01-22 Thread via GitHub
hujun260 commented on code in PR #14578: URL: https://github.com/apache/nuttx/pull/14578#discussion_r1926274691 ## sched/sched/sched_unlock.c: ## @@ -124,137 +94,13 @@ int sched_unlock(void) if ((rtcb->flags & TCB_FLAG_POLICY_MASK) == TCB_FLAG_SCHED_RR &&

Re: [PR] spin_lock_irqsave+sched_lock [nuttx]

2025-01-22 Thread via GitHub
xiaoxiang781216 commented on code in PR #14578: URL: https://github.com/apache/nuttx/pull/14578#discussion_r1925573021 ## sched/sched/sched_lock.c: ## @@ -64,112 +64,23 @@ * / -#ifdef CONFIG_SMP -

Re: [PR] spin_lock_irqsave+sched_lock [nuttx]

2025-01-22 Thread via GitHub
hujun260 commented on code in PR #14578: URL: https://github.com/apache/nuttx/pull/14578#discussion_r1925318933 ## sched/sched/sched_lock.c: ## @@ -64,112 +64,26 @@ * / -#ifdef CONFIG_SMP - -int sc

Re: [PR] spin_lock_irqsave+sched_lock [nuttx]

2025-01-22 Thread via GitHub
xiaoxiang781216 commented on code in PR #14578: URL: https://github.com/apache/nuttx/pull/14578#discussion_r1924956310 ## include/nuttx/spinlock.h: ## @@ -584,15 +584,15 @@ irqstate_t spin_lock_irqsave(FAR volatile spinlock_t *lock) #ifdef CONFIG_SPINLOCK static inline_func

Re: [PR] spin_lock_irqsave+sched_lock [nuttx]

2025-01-21 Thread via GitHub
hujun260 commented on code in PR #14578: URL: https://github.com/apache/nuttx/pull/14578#discussion_r1924656594 ## include/nuttx/spinlock.h: ## @@ -1003,7 +1048,15 @@ void read_unlock_irqrestore(FAR rwlock_t *lock, irqstate_t flags); #ifdef CONFIG_SPINLOCK irqstate_t write_lo

Re: [PR] spin_lock_irqsave+sched_lock [nuttx]

2025-01-21 Thread via GitHub
hujun260 commented on code in PR #14578: URL: https://github.com/apache/nuttx/pull/14578#discussion_r1924656070 ## include/nuttx/irq.h: ## @@ -75,16 +75,6 @@ #endif /* __ASSEMBLY__ */ -#ifdef CONFIG_SMP -# define cpu_irqlock_clear() \ Review Comment: done ##

Re: [PR] spin_lock_irqsave+sched_lock [nuttx]

2025-01-21 Thread via GitHub
hujun260 commented on code in PR #14578: URL: https://github.com/apache/nuttx/pull/14578#discussion_r1924655917 ## include/nuttx/irq.h: ## @@ -80,7 +80,7 @@ do \ { \ g_cpu_irqset = 0; \ Review Comment: We need g_cpu_irqlock not just to protect g_cpu_irqset, bu

Re: [PR] spin_lock_irqsave+sched_lock [nuttx]

2025-01-21 Thread via GitHub
hujun260 commented on code in PR #14578: URL: https://github.com/apache/nuttx/pull/14578#discussion_r1924654927 ## include/nuttx/spinlock.h: ## @@ -233,6 +233,8 @@ static inline_function void raw_spin_lock(FAR volatile spinlock_t *lock) #ifdef CONFIG_SPINLOCK static inline_fu

Re: [PR] spin_lock_irqsave+sched_lock [nuttx]

2025-01-21 Thread via GitHub
xiaoxiang781216 commented on code in PR #14578: URL: https://github.com/apache/nuttx/pull/14578#discussion_r1924172641 ## include/nuttx/spinlock.h: ## @@ -499,6 +499,50 @@ irqstate_t spin_lock_irqsave(FAR volatile spinlock_t *lock) # define spin_lock_irqsave(l) ((void)(l), up_

Re: [PR] spin_lock_irqsave+sched_lock [nuttx]

2025-01-20 Thread via GitHub
hujun260 commented on code in PR #14578: URL: https://github.com/apache/nuttx/pull/14578#discussion_r1923009168 ## include/nuttx/irq.h: ## @@ -80,7 +80,7 @@ do \ Review Comment: done in next patch -- This is an automated message from the Apache Git Service. To respond

Re: [PR] spin_lock_irqsave+sched_lock [nuttx]

2025-01-20 Thread via GitHub
hujun260 commented on code in PR #14578: URL: https://github.com/apache/nuttx/pull/14578#discussion_r1923008806 ## sched/sched/sched_lock.c: ## @@ -46,6 +46,29 @@ * Public Functions / +/***

Re: [PR] spin_lock_irqsave+sched_lock [nuttx]

2025-01-20 Thread via GitHub
xiaoxiang781216 commented on code in PR #14578: URL: https://github.com/apache/nuttx/pull/14578#discussion_r1922356013 ## sched/sched/sched_lock.c: ## @@ -64,112 +87,29 @@ * / -#ifdef CONFIG_SMP -

Re: [PR] spin_lock_irqsave+sched_lock [nuttx]

2025-01-19 Thread via GitHub
hujun260 commented on code in PR #14578: URL: https://github.com/apache/nuttx/pull/14578#discussion_r1921920146 ## include/nuttx/irq.h: ## @@ -80,7 +80,7 @@ do \ { \ g_cpu_irqset = 0; \ - spin_unlock_wo_note(&g_cpu_irqlock); \ + raw_spin_unlock(&g_cpu_ir

Re: [PR] spin_lock_irqsave+sched_lock [nuttx]

2025-01-19 Thread via GitHub
xiaoxiang781216 commented on code in PR #14578: URL: https://github.com/apache/nuttx/pull/14578#discussion_r1921911065 ## include/nuttx/irq.h: ## @@ -80,7 +80,7 @@ do \ { \ g_cpu_irqset = 0; \ - spin_unlock_wo_note(&g_cpu_irqlock); \ + raw_spin_unlock(&g

Re: [PR] spin_lock_irqsave+sched_lock [nuttx]

2025-01-19 Thread via GitHub
hujun260 commented on code in PR #14578: URL: https://github.com/apache/nuttx/pull/14578#discussion_r1921801015 ## include/nuttx/spinlock.h: ## @@ -680,6 +703,8 @@ void spin_unlock_irqrestore(FAR volatile spinlock_t *lock, static inline_function void read_lock(FAR volatile rw

Re: [PR] spin_lock_irqsave+sched_lock [nuttx]

2024-11-27 Thread via GitHub
anchao commented on code in PR #14578: URL: https://github.com/apache/nuttx/pull/14578#discussion_r1861512296 ## sched/irq/irq_csection.c: ## @@ -440,22 +434,34 @@ void leave_critical_section(irqstate_t flags) */ DEBUGASSERT(rtcb->irqcount > 0); - if (--rtc

Re: [PR] spin_lock_irqsave+sched_lock [nuttx]

2024-11-27 Thread via GitHub
hujun260 commented on code in PR #14578: URL: https://github.com/apache/nuttx/pull/14578#discussion_r1861441357 ## sched/irq/irq_csection.c: ## @@ -440,22 +435,40 @@ void leave_critical_section(irqstate_t flags) */ DEBUGASSERT(rtcb->irqcount > 0); - if (--r

Re: [PR] spin_lock_irqsave+sched_lock [nuttx]

2024-11-27 Thread via GitHub
anchao commented on code in PR #14578: URL: https://github.com/apache/nuttx/pull/14578#discussion_r1861372771 ## sched/irq/irq_csection.c: ## @@ -440,22 +435,40 @@ void leave_critical_section(irqstate_t flags) */ DEBUGASSERT(rtcb->irqcount > 0); - if (--rtc

[PR] spin_lock_irqsave+sched_lock [nuttx]

2024-11-27 Thread via GitHub
hujun260 opened a new pull request, #14578: URL: https://github.com/apache/nuttx/pull/14578 ## Summary 1 Accelerated the implementation of sched_lock, remove enter_critical_section in sched_lock and only enter_critical_section when task scheduling is required. 2 we add sched_lock_

Re: [PR] spin_lock_irqsave+sched_lock [nuttx]

2024-11-27 Thread via GitHub
hujun260 closed pull request #14578: spin_lock_irqsave+sched_lock URL: https://github.com/apache/nuttx/pull/14578 -- 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

Re: [PR] spin_lock_irqsave+sched_lock [nuttx]

2024-11-27 Thread via GitHub
hujun260 commented on PR #14578: URL: https://github.com/apache/nuttx/pull/14578#issuecomment-2503600114 > Have you tested this code with SCHED_INSTRUMENTATION_CSECTION? yes -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitH

Re: [PR] spin_lock_irqsave+sched_lock [nuttx]

2024-11-27 Thread via GitHub
hujun260 commented on code in PR #14578: URL: https://github.com/apache/nuttx/pull/14578#discussion_r1860472978 ## sched/irq/irq_csection.c: ## @@ -440,22 +435,40 @@ void leave_critical_section(irqstate_t flags) */ DEBUGASSERT(rtcb->irqcount > 0); - if (--r

Re: [PR] spin_lock_irqsave+sched_lock [nuttx]

2024-11-27 Thread via GitHub
anchao commented on code in PR #14578: URL: https://github.com/apache/nuttx/pull/14578#discussion_r1860224762 ## sched/irq/irq_csection.c: ## @@ -440,22 +435,40 @@ void leave_critical_section(irqstate_t flags) */ DEBUGASSERT(rtcb->irqcount > 0); - if (--rtc

Re: [PR] spin_lock_irqsave+sched_lock [nuttx]

2024-11-26 Thread via GitHub
hujun260 commented on code in PR #14578: URL: https://github.com/apache/nuttx/pull/14578#discussion_r1859522539 ## sched/sched/sched_unlock.c: ## @@ -37,281 +37,178 @@ #include "sched/sched.h" / - *

Re: [PR] spin_lock_irqsave+sched_lock [nuttx]

2024-11-26 Thread via GitHub
anchao commented on code in PR #14578: URL: https://github.com/apache/nuttx/pull/14578#discussion_r1859514078 ## sched/sched/sched_unlock.c: ## @@ -37,281 +37,178 @@ #include "sched/sched.h" / - * Pu

Re: [PR] spin_lock_irqsave+sched_lock [nuttx]

2024-11-26 Thread via GitHub
hujun260 commented on code in PR #14578: URL: https://github.com/apache/nuttx/pull/14578#discussion_r1859492547 ## sched/sched/sched_unlock.c: ## @@ -37,281 +37,178 @@ #include "sched/sched.h" / - *

Re: [PR] spin_lock_irqsave+sched_lock [nuttx]

2024-11-26 Thread via GitHub
anchao commented on code in PR #14578: URL: https://github.com/apache/nuttx/pull/14578#discussion_r1859485853 ## sched/sched/sched_unlock.c: ## @@ -37,281 +37,178 @@ #include "sched/sched.h" / - * Pu

Re: [PR] spin_lock_irqsave+sched_lock [nuttx]

2024-11-26 Thread via GitHub
patacongo commented on PR #14578: URL: https://github.com/apache/nuttx/pull/14578#issuecomment-2501657197 The spinlock has always been a very light weight way of waiting. In SMP, sched_lock() is heavy weight and and also calls enter_critical_section which is even heavier. This will effect

Re: [PR] spin_lock_irqsave+sched_lock [nuttx]

2024-11-26 Thread via GitHub
hujun260 commented on code in PR #14578: URL: https://github.com/apache/nuttx/pull/14578#discussion_r1858064950 ## sched/sched/sched_unlock.c: ## @@ -37,281 +37,178 @@ #include "sched/sched.h" / - *

Re: [PR] spin_lock_irqsave+sched_lock [nuttx]

2024-11-25 Thread via GitHub
anchao commented on code in PR #14578: URL: https://github.com/apache/nuttx/pull/14578#discussion_r1857900343 ## sched/sched/sched_unlock.c: ## @@ -37,281 +37,178 @@ #include "sched/sched.h" / - * Pu

Re: [PR] spin_lock_irqsave+sched_lock [nuttx]

2024-11-25 Thread via GitHub
hujun260 commented on code in PR #14578: URL: https://github.com/apache/nuttx/pull/14578#discussion_r1857850907 ## sched/sched/sched_unlock.c: ## @@ -37,281 +37,178 @@ #include "sched/sched.h" / - *

Re: [PR] spin_lock_irqsave+sched_lock [nuttx]

2024-11-25 Thread via GitHub
hujun260 commented on code in PR #14578: URL: https://github.com/apache/nuttx/pull/14578#discussion_r1857850942 ## sched/sched/sched_unlock.c: ## @@ -37,281 +37,178 @@ #include "sched/sched.h" / - *

Re: [PR] spin_lock_irqsave+sched_lock [nuttx]

2024-11-25 Thread via GitHub
hujun260 commented on code in PR #14578: URL: https://github.com/apache/nuttx/pull/14578#discussion_r1857850443 ## include/sys/syscall_lookup.h: ## @@ -41,10 +41,12 @@ SYSCALL_LOOKUP(sched_getparam, 2) SYSCALL_LOOKUP(sched_getscheduler, 1) SYSCALL_LOOKUP(sc

Re: [PR] spin_lock_irqsave+sched_lock [nuttx]

2024-11-25 Thread via GitHub
anchao commented on code in PR #14578: URL: https://github.com/apache/nuttx/pull/14578#discussion_r1857739020 ## sched/sched/sched_unlock.c: ## @@ -37,281 +37,178 @@ #include "sched/sched.h" / - * Pu

Re: [PR] spin_lock_irqsave+sched_lock [nuttx]

2024-11-25 Thread via GitHub
anchao commented on code in PR #14578: URL: https://github.com/apache/nuttx/pull/14578#discussion_r1857722335 ## include/sys/syscall_lookup.h: ## @@ -41,10 +41,12 @@ SYSCALL_LOOKUP(sched_getparam, 2) SYSCALL_LOOKUP(sched_getscheduler, 1) SYSCALL_LOOKUP(sche

Re: [PR] spin_lock_irqsave+sched_lock [nuttx]

2024-11-25 Thread via GitHub
hujun260 commented on code in PR #14578: URL: https://github.com/apache/nuttx/pull/14578#discussion_r1857550677 ## sched/sched/sched_unlock.c: ## @@ -40,278 +40,155 @@ * Public Functions / -/**

Re: [PR] spin_lock_irqsave+sched_lock [nuttx]

2024-11-25 Thread via GitHub
anchao commented on code in PR #14578: URL: https://github.com/apache/nuttx/pull/14578#discussion_r1857511553 ## sched/sched/sched_unlock.c: ## @@ -40,278 +40,155 @@ * Public Functions / -/

Re: [PR] spin_lock_irqsave+sched_lock [nuttx]

2024-11-25 Thread via GitHub
hujun260 commented on code in PR #14578: URL: https://github.com/apache/nuttx/pull/14578#discussion_r1856656096 ## sched/sched/sched_unlock.c: ## @@ -40,278 +40,155 @@ * Public Functions / -/**

Re: [PR] spin_lock_irqsave+sched_lock [nuttx]

2024-11-25 Thread via GitHub
hujun260 commented on code in PR #14578: URL: https://github.com/apache/nuttx/pull/14578#discussion_r1856656096 ## sched/sched/sched_unlock.c: ## @@ -40,278 +40,155 @@ * Public Functions / -/**

Re: [PR] spin_lock_irqsave+sched_lock [nuttx]

2024-11-25 Thread via GitHub
anchao commented on code in PR #14578: URL: https://github.com/apache/nuttx/pull/14578#discussion_r1856621316 ## sched/sched/sched_unlock.c: ## @@ -40,278 +40,155 @@ * Public Functions / -/

Re: [PR] spin_lock_irqsave+sched_lock [nuttx]

2024-11-25 Thread via GitHub
hujun260 commented on code in PR #14578: URL: https://github.com/apache/nuttx/pull/14578#discussion_r1856608098 ## sched/sched/sched_unlock.c: ## @@ -40,278 +40,155 @@ * Public Functions / -/**

Re: [PR] spin_lock_irqsave+sched_lock [nuttx]

2024-11-25 Thread via GitHub
hujun260 commented on code in PR #14578: URL: https://github.com/apache/nuttx/pull/14578#discussion_r1856608098 ## sched/sched/sched_unlock.c: ## @@ -40,278 +40,155 @@ * Public Functions / -/**

Re: [PR] spin_lock_irqsave+sched_lock [nuttx]

2024-11-25 Thread via GitHub
anchao commented on code in PR #14578: URL: https://github.com/apache/nuttx/pull/14578#discussion_r1856584409 ## sched/sched/sched_unlock.c: ## @@ -40,278 +40,155 @@ * Public Functions / -/

Re: [PR] spin_lock_irqsave+sched_lock [nuttx]

2024-11-25 Thread via GitHub
anchao commented on code in PR #14578: URL: https://github.com/apache/nuttx/pull/14578#discussion_r1856584409 ## sched/sched/sched_unlock.c: ## @@ -40,278 +40,155 @@ * Public Functions / -/

Re: [PR] spin_lock_irqsave+sched_lock [nuttx]

2024-11-25 Thread via GitHub
hujun260 commented on code in PR #14578: URL: https://github.com/apache/nuttx/pull/14578#discussion_r1856503862 ## sched/sched/sched_unlock.c: ## @@ -40,278 +40,155 @@ * Public Functions / -/**

Re: [PR] spin_lock_irqsave+sched_lock [nuttx]

2024-11-25 Thread via GitHub
hujun260 commented on code in PR #14578: URL: https://github.com/apache/nuttx/pull/14578#discussion_r1856503862 ## sched/sched/sched_unlock.c: ## @@ -40,278 +40,155 @@ * Public Functions / -/**

Re: [PR] spin_lock_irqsave+sched_lock [nuttx]

2024-11-25 Thread via GitHub
hujun260 commented on code in PR #14578: URL: https://github.com/apache/nuttx/pull/14578#discussion_r1856503862 ## sched/sched/sched_unlock.c: ## @@ -40,278 +40,155 @@ * Public Functions / -/**

Re: [PR] spin_lock_irqsave+sched_lock [nuttx]

2024-11-25 Thread via GitHub
anchao commented on code in PR #14578: URL: https://github.com/apache/nuttx/pull/14578#discussion_r1856455978 ## sched/sched/sched_unlock.c: ## @@ -40,278 +40,155 @@ * Public Functions / -/

Re: [PR] spin_lock_irqsave+sched_lock [nuttx]

2024-11-25 Thread via GitHub
hujun260 commented on code in PR #14578: URL: https://github.com/apache/nuttx/pull/14578#discussion_r1856401422 ## sched/sched/sched_unlock.c: ## @@ -40,278 +40,155 @@ * Public Functions / -/**

Re: [PR] spin_lock_irqsave+sched_lock [nuttx]

2024-11-25 Thread via GitHub
anchao commented on code in PR #14578: URL: https://github.com/apache/nuttx/pull/14578#discussion_r1856232209 ## sched/sched/sched_unlock.c: ## @@ -40,278 +40,155 @@ * Public Functions / -/

Re: [PR] spin_lock_irqsave+sched_lock [nuttx]

2024-11-25 Thread via GitHub
hujun260 commented on code in PR #14578: URL: https://github.com/apache/nuttx/pull/14578#discussion_r1856202442 ## sched/sched/sched_lock.c: ## @@ -64,112 +83,25 @@ * / -#ifdef CONFIG_SMP - -int sc

Re: [PR] spin_lock_irqsave+sched_lock [nuttx]

2024-11-25 Thread via GitHub
anchao commented on code in PR #14578: URL: https://github.com/apache/nuttx/pull/14578#discussion_r1856182442 ## sched/sched/sched_lock.c: ## @@ -64,112 +83,25 @@ * / -#ifdef CONFIG_SMP - -int sche

Re: [PR] spin_lock_irqsave+sched_lock [nuttx]

2024-11-25 Thread via GitHub
hujun260 commented on code in PR #14578: URL: https://github.com/apache/nuttx/pull/14578#discussion_r1856193301 ## sched/sched/sched_unlock.c: ## @@ -40,278 +40,155 @@ * Public Functions / -/**

Re: [PR] spin_lock_irqsave+sched_lock [nuttx]

2024-11-25 Thread via GitHub
anchao commented on code in PR #14578: URL: https://github.com/apache/nuttx/pull/14578#discussion_r1856149288 ## sched/sched/sched_unlock.c: ## @@ -40,278 +40,155 @@ * Public Functions / -/

Re: [PR] spin_lock_irqsave+sched_lock [nuttx]

2024-11-25 Thread via GitHub
anchao commented on code in PR #14578: URL: https://github.com/apache/nuttx/pull/14578#discussion_r1856149288 ## sched/sched/sched_unlock.c: ## @@ -40,278 +40,155 @@ * Public Functions / -/

Re: [PR] spin_lock_irqsave+sched_lock [nuttx]

2024-11-25 Thread via GitHub
hujun260 commented on code in PR #14578: URL: https://github.com/apache/nuttx/pull/14578#discussion_r1856145799 ## sched/sched/sched_unlock.c: ## @@ -40,278 +40,155 @@ * Public Functions / -/**

Re: [PR] spin_lock_irqsave+sched_lock [nuttx]

2024-11-25 Thread via GitHub
anchao commented on code in PR #14578: URL: https://github.com/apache/nuttx/pull/14578#discussion_r1856138788 ## sched/sched/sched_unlock.c: ## @@ -40,278 +40,155 @@ * Public Functions / -/

Re: [PR] spin_lock_irqsave+sched_lock [nuttx]

2024-11-25 Thread via GitHub
hujun260 commented on code in PR #14578: URL: https://github.com/apache/nuttx/pull/14578#discussion_r1856125741 ## sched/sched/sched_unlock.c: ## @@ -40,278 +40,160 @@ * Public Functions / -/**

Re: [PR] spin_lock_irqsave+sched_lock [nuttx]

2024-11-25 Thread via GitHub
hujun260 commented on code in PR #14578: URL: https://github.com/apache/nuttx/pull/14578#discussion_r1856127202 ## sched/sched/sched_unlock.c: ## @@ -40,278 +40,160 @@ * Public Functions / -/**

Re: [PR] spin_lock_irqsave+sched_lock [nuttx]

2024-11-25 Thread via GitHub
anchao commented on code in PR #14578: URL: https://github.com/apache/nuttx/pull/14578#discussion_r1856029168 ## sched/sched/sched_unlock.c: ## @@ -40,278 +40,160 @@ * Public Functions / -/