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

If I do not acquire a spinlock in a softirq, is it then alright to sleep?

$
0
0

If I do not acquire a spinlock in softirq context, is it then alright to sleep?

I understand that it is incorrect to sleep after acquiring a spinlock. The process put to sleep might wake up on another CPU while the spinlock would've been acquired on some other cpu. Interrupts would have been disabled on the cpu where spinlock was acquired while restore happens on another cpu. (Will this cause a kernel panic immediately?) But if there is no spinlock involved, will the sleep or (schedule() call), work fine? Or is this wrong due to the way context saving/restoring works? If I call schedule() in a softirq, where does the interrupt context/stack gets saved? kernel mode stack of the current process? When the process gets to run again, will it be able to continue from where it left? Or is this where things will go wrong? That is, schedule() does not know about softirq/interrupt stack and will not save them. So when the process gets to run again, it would have no idea about the softirq?


Viewing all articles
Browse latest Browse all 12379

Trending Articles



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