From mboxrd@z Thu Jan 1 00:00:00 1970 From: lchen@suse.com (Larry Chen) Date: Sun, 2 Sep 2018 18:54:42 +0800 Subject: Queries on bottom halves In-Reply-To: References: Message-ID: To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org Hello Abhinav, On 09/01/2018 04:05 PM, Abhinav Misra wrote: > Hi, > > Sorry for the delay in the reply. > I think the question is not correctly framed. Will try to do it again. > > 1. Which stack does the tasklet, softriq and workqueue use for their > execution ? > Softirq actually is a group of N kernel threads(N equals to your cpu number), each thread is restricted to run on its corresponding cpu. A tasklet is a call-back function that runs on softirq thread. In the latest kernel version, a tasklet uses softirq thread stack. A workqueue is almost the same, a work is almost the same as the a tasklet, it runs on a worker thread and shares the stack with worker thread. > 2. Why can't we sleep in tasklet and softriq ? Yes, you can. Tasklet runs on softirq thread, it has its own task_struct, you can sleep or call schedule in your tasklet. When you sleep in your tasklet, the softirq thread that the tasklet is running on will sleep, the sequential tasklet could not be executed until next schedule. BR, Larry