From mboxrd@z Thu Jan 1 00:00:00 1970 From: buyit@live.cn (buyitian) Date: Fri, 15 Feb 2013 16:52:21 +0800 Subject: spinlock deadlock Message-ID: To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org is it possible that printk cause deadlock? the path is as below: 1. taskA runs on CPU0, and run schedule to acqire the rq->lock.2. taskA calls printk while holding rq->lock.3. taskA holds console_sem.4. taskB runs on CPU1, and call console_lock(), which is blocked by console_sem and queue itslef to the wait list.5. taskB migrates from CPU1 to cpu0. will this step occur?6. taskA calls up(&console_sem)--> wake_up_process()-->try_to_wake_up()-->ttwu_queue()-->raw_spin_lock(&rq->lock). here taskA tries to acquire the rq->lock of CPU0 again. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20130215/f5658f4a/attachment.html