Skip to content

SMP 下 rt_hw_interrupt_disable 的实现问题 #7173

Open
@grissiom

Description

@grissiom

当前 SMP 下面 rt_hw_interrupt_disable 的实现是禁用局部的中断,禁用其他核的调度器。这个有个问题是其他核的中断其实是没有被禁用的,所以其实如果在 ISR 里面用了资源的话其实是保护不到的…………

不过鉴于 rt_hw_interrupt_disable 用的太多了,用一次就禁用其他核的中断也不合适,所以最好的方式或许还是:

SMP 模式下每个 IPC 对象内嵌一个 spin lock,rt_hw_interrupt_disable 从 rt_cpus_lock 切换成 rt_spin_lock_irqsave,等在各个对象的锁里而不是全局锁。

非 SMP 模式下退化成当前的模式

貌似没捷径可以走哇

Metadata

Metadata

Assignees

No one assigned

    Labels

    discussionThis PR/issue needs to be discussed later

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions