Quantcast
Channel: Active questions tagged kernel - Stack Overflow
Viewing all articles
Browse latest Browse all 6333

why spin_lock_irqsave needs to disable preemption on multiprocessor

$
0
0

Just curious why spin_lock_irqsave needs to disable the preemption after disabling local interrupt.

static inline unsigned long __raw_spin_lock_irqsave(raw_spinlock_t *lock){    unsigned long flags;    local_irq_save(flags);    preempt_disable(); ===> can preemption happen with interrupt disabled?    spin_acquire(&lock->dep_map, 0, 0, _RET_IP_);    ...}

Preemption should only be possible with interrupt enabled, thus there should be no need to worry about preemption after disabling interrupt.


Viewing all articles
Browse latest Browse all 6333

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>