xiaoxiang781216 closed pull request #15705: sched/spin_lock: rename raw_spin_*
to spin_*_notrace
URL: https://github.com/apache/nuttx/pull/15705
--
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 s
anchao commented on PR #15705:
URL: https://github.com/apache/nuttx/pull/15705#issuecomment-2635565273
> boot time is a very short phase in the whole life cycle. If you really
want to squeeze the performance(I doubt), you can still call
spin_lock_irqsave_preempt.
>
> The major de
anchao commented on PR #15705:
URL: https://github.com/apache/nuttx/pull/15705#issuecomment-2627604862
> Hi @anchao
>
> About Espressif-related problems (#15688), #15728 and #15691 solves the
problem without changing the current locks. Can you please review it too?
>
> After fi
tmedicci commented on PR #15705:
URL: https://github.com/apache/nuttx/pull/15705#issuecomment-2627028204
Hi @hujun260
About Espressif-related problems
(https://github.com/apache/nuttx/issues/15688),
https://github.com/apache/nuttx/pull/15728 and
https://github.com/apache/nuttx/pull
xiaoxiang781216 commented on PR #15705:
URL: https://github.com/apache/nuttx/pull/15705#issuecomment-2625300160
> if your code does not enable the interrupt controller and schedler at boot
time, why does spin_lock require sched_lock and irq_save?
>
> bringup phase and ISR and schedule
xiaoxiang781216 commented on PR #15705:
URL: https://github.com/apache/nuttx/pull/15705#issuecomment-2625278109
> The advantage of the first option is that all code does not need to be
changed, including the ESP third-party library, and the historical API behavior
is the same as before.
xiaoxiang781216 commented on PR #15705:
URL: https://github.com/apache/nuttx/pull/15705#issuecomment-2625243987
> > I hope you read my reply carefully. Which of the following 2 options do
you pick?
> > ```
> > spin_lock: spin lock
> > spin_lock_nopreempt: spin_lock + sched_lock
>
hujun260 commented on PR #15705:
URL: https://github.com/apache/nuttx/pull/15705#issuecomment-2624748194
> @hujun260 could we use a new approach to avoid touching esp32 code?
done
https://github.com/apache/nuttx/pull/15691
--
This is an automated message from the Apache Git Serv
tmedicci commented on PR #15705:
URL: https://github.com/apache/nuttx/pull/15705#issuecomment-2624467782
> I hope you read my reply carefully. Which of the following 2 options do
you pick?
>
> ```
> spin_lock: spin lock
> spin_lock_nopreempt: spin_lock + sched_lock
> spin_loc
anchao commented on PR #15705:
URL: https://github.com/apache/nuttx/pull/15705#issuecomment-2623699281
> Ok, could you give me an example, when can you use spin_lock API? the
interrupt can be happened without your control, which mean spin_lock CAN'T BE
CALLED in any thread context.
anchao commented on PR #15705:
URL: https://github.com/apache/nuttx/pull/15705#issuecomment-2623693610
> > > so, you don't read my reply carefully, let me copy the example again:
> > >
> > > 1. thread0 on CPU0 hold a spinlock without hold sched lock
> > > 2. thread1 on CPU1 wake up
anchao commented on PR #15705:
URL: https://github.com/apache/nuttx/pull/15705#issuecomment-2623690211
The advantage of the first option is that all code does not need to be
changed, including the ESP third-party library, and the historical API behavior
is the same as before.
For the
xiaoxiang781216 commented on PR #15705:
URL: https://github.com/apache/nuttx/pull/15705#issuecomment-2623689075
> > so, you don't read my reply carefully, let me copy the example again:
> >
> > 1. thread0 on CPU0 hold a spinlock without hold sched lock
> > 2. thread1 on CPU1 wake up
anchao commented on PR #15705:
URL: https://github.com/apache/nuttx/pull/15705#issuecomment-2623684303
I hope you read my reply carefully. Which of the following 2 options do you
pick?
```
spin_lock: spin lock
spin_lock_nopreempt: spin_lock + sched_lock
spin_lock_irqsave: spi
anchao commented on PR #15705:
URL: https://github.com/apache/nuttx/pull/15705#issuecomment-2623681422
if your code does not enable the interrupt controller and schedler at boot
time, why does spin_lock require sched_lock and irq_save?
--
This is an automated message from the Apache Git S
anchao commented on PR #15705:
URL: https://github.com/apache/nuttx/pull/15705#issuecomment-2623678901
> so, you don't read my reply carefully, let me copy the example again:
>
> 1. thread0 on CPU0 hold a spinlock without hold sched lock
> 2. thread1 on CPU1 wake up thread2
>
xiaoxiang781216 commented on PR #15705:
URL: https://github.com/apache/nuttx/pull/15705#issuecomment-2623667231
> The current API definition is perfect, and the function name can identify
the implementation details of each function.
>
> ```
> spin_lock: spin lock
> spin_lock_nop
anchao commented on PR #15705:
URL: https://github.com/apache/nuttx/pull/15705#issuecomment-2623638885
The current API definition is perfect, and the function name can identify
the implementation details of each function.
```
spin_lock: spin lock
spin_lock_nopreempt: spin_lock +
anchao commented on PR #15705:
URL: https://github.com/apache/nuttx/pull/15705#issuecomment-2623616378
>No, it isn't truth. the critical section is a big lock which is a well
known SMP isssue and should be replaced by the fine grant lock step by step:
https://en.wikipedia.org/wiki/Giant_l
xiaoxiang781216 commented on PR #15705:
URL: https://github.com/apache/nuttx/pull/15705#issuecomment-2623557988
> > Yes, but you need first change the exuction of ALL IRQ from the interupt
context to the thread context. Before that happen, the sched lock must be taken
at the same time we ho
anchao commented on PR #15705:
URL: https://github.com/apache/nuttx/pull/15705#issuecomment-2623338648
> Yes, but you need first change the exuction of ALL IRQ from the interupt
context to the thread context. Before that happen, the sched lock must be taken
at the same time we hold spin
xiaoxiang781216 commented on PR #15705:
URL: https://github.com/apache/nuttx/pull/15705#issuecomment-2622074717
> > https://docs.kernel.org/locking/locktypes.html contain the detailed
information, here is the keypoint: https://private-user-images.githubusercontent.com/18066964/407624628-9c33
anchao commented on PR #15705:
URL: https://github.com/apache/nuttx/pull/15705#issuecomment-2621436685
> https://docs.kernel.org/locking/locktypes.html contain the detailed
information, here is the keypoint: https://private-user-images.githubusercontent.com/18066964/407624628-9c3314ff-e647-4
anchao commented on code in PR #15705:
URL: https://github.com/apache/nuttx/pull/15705#discussion_r1933726046
##
include/nuttx/spinlock.h:
##
@@ -278,8 +278,6 @@ spin_lock_nopreempt(FAR volatile spinlock_t *lock)
#ifdef CONFIG_SPINLOCK
static inline_function void spin_lock(FAR
anchao commented on code in PR #15705:
URL: https://github.com/apache/nuttx/pull/15705#discussion_r1933724025
##
fs/inode/fs_files.c:
##
@@ -72,9 +72,9 @@ static FAR struct file *files_fget_by_index(FAR struct
filelist *list,
FAR struct file *filep;
irqstate_t flags;
-
anchao commented on PR #15705:
URL: https://github.com/apache/nuttx/pull/15705#issuecomment-2621399977
> > 4. sched/spinlock: removed the semantics of disable preemption from
default spin_lock
> >
> > In the RTOS environment, spin_lock is simplified as much as possible to
improve per
xiaoxiang781216 commented on PR #15705:
URL: https://github.com/apache/nuttx/pull/15705#issuecomment-2620809436
https://docs.kernel.org/locking/locktypes.html contain the detailed
information, here is the keypoint:
https://github.com/user-attachments/assets/9c3314ff-e647-4578-a9b5-d4ed80b
xiaoxiang781216 commented on code in PR #15705:
URL: https://github.com/apache/nuttx/pull/15705#discussion_r1933312996
##
include/nuttx/spinlock.h:
##
@@ -278,8 +278,6 @@ spin_lock_nopreempt(FAR volatile spinlock_t *lock)
#ifdef CONFIG_SPINLOCK
static inline_function void spin
acassis commented on PR #15705:
URL: https://github.com/apache/nuttx/pull/15705#issuecomment-2619267720
@anchao nice work! Please update our Documentation/ (
https://nuttx.apache.org/docs/latest/implementation/critical_sections.html ) to
include these spinlock details!
--
This is an auto
anchao commented on code in PR #15705:
URL: https://github.com/apache/nuttx/pull/15705#discussion_r1931396688
##
arch/arm/src/am335x/am335x_can.c:
##
@@ -27,6 +27,7 @@
#include
#include
+#include
Review Comment:
done
##
arch/arm/src/am335x/am335x_can.c:
###
xiaoxiang781216 commented on code in PR #15705:
URL: https://github.com/apache/nuttx/pull/15705#discussion_r1931069766
##
arch/arm/src/am335x/am335x_can.c:
##
@@ -1082,7 +1083,7 @@ struct can_dev_s *am335x_can_initialize(int port)
syslog(LOG_DEBUG, "CAN%d\n", port);
- fl
xiaoxiang781216 commented on code in PR #15705:
URL: https://github.com/apache/nuttx/pull/15705#discussion_r1931070332
##
arch/arm/src/am335x/am335x_can.c:
##
@@ -27,6 +27,7 @@
#include
#include
+#include
Review Comment:
don't need add in ALL place
--
This is an
nuttxpr commented on PR #15705:
URL: https://github.com/apache/nuttx/pull/15705#issuecomment-2614794492
[**\[Experimental Bot, please feedback
here\]**](https://github.com/search?q=repo%3Aapache%2Fnuttx+13552&type=issues)
Yes, this PR appears to meet the NuttX requirements, al
anchao opened a new pull request, #15705:
URL: https://github.com/apache/nuttx/pull/15705
## Summary
1. sched/spin_lock: rename raw_spin_* to spin_*_notrace
raw_spin in the Linux kernel means disable the preemption before
holding the spin lock, not disable trace. Rename raw_s
34 matches
Mail list logo