apache / apache/nuttx

[BUG] [spinlock] spin_lock should imply sched_lock to avoid dead lock

Open
#16,107 4 comments 0 reactions 0 assignees View on GitHub
Arch: all Arch: arm Area: Kernel OS: Linux Type: Bug
Dominant language
C
Stars
4k
Forks
1.7k
Avg merge
1d 17h
Merged PRs (30d)
237

Description

### Description / Steps to reproduce the issue

Task A takes a spinlock, however it may still preempted by higher priority task, that's very dangerous! If the higher priority task acquire the same spinlock, then dead lock occurs.

spin_lock api behave like linux's spinlock, that imply preempt_disable. That's different api with spin_lock_irqsave.

If there are no objections, I will fix this bug.

### On which OS does this issue occur?

[OS: Linux]

### What is the version of your OS?

ubuntu 20.04

### NuttX Version

master

### Issue Architecture

[Arch: arm], [Arch: all]

### Issue Area

[Area: Kernel]

### Host information

_No response_

### Verification

- [x] I have verified before submitting the report.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.