From mboxrd@z Thu Jan 1 00:00:00 1970 From: j.neuschaefer@gmx.net (Jonathan =?utf-8?Q?Neusch=C3=A4fer?=) Date: Fri, 7 Oct 2011 18:44:17 +0200 Subject: When is to preempt safe? In-Reply-To: References: Message-ID: <20111007164417.GB1475@debian.debian> To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org On Fri, Oct 07, 2011 at 07:27:12PM +0800, Parmenides wrote: > 2. Another statement from Love is that "the kernel can preempt a task > running in the kernel so long as it does not hold a lock". Why is it > not safe while kernel code holding lock? If you preempt while a lock is being held, another task could try to acquire the same lock, causing a deadlock. HTH, Jonathan Neusch?fer