Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751323Ab0HSAwv (ORCPT ); Wed, 18 Aug 2010 20:52:51 -0400 Received: from ozlabs.org ([203.10.76.45]:53991 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751249Ab0HSAws (ORCPT ); Wed, 18 Aug 2010 20:52:48 -0400 From: Rusty Russell To: Stefan Richter Subject: Re: [PATCH] Documentation: kernel-locking: mutex_trylock cannot be used in interrupt context Date: Thu, 19 Aug 2010 10:22:42 +0930 User-Agent: KMail/1.13.2 (Linux/2.6.32-24-generic; KDE/4.4.2; i686; ; ) Cc: linux-kernel@vger.kernel.org, Matthew Wilcox , Randy Dunlap , linux-doc@vger.kernel.org References: In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201008191022.43524.rusty@rustcorp.com.au> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 874 Lines: 21 On Thu, 19 Aug 2010 07:38:15 am Stefan Richter wrote: > Chapter 6 is right about mutex_trylock, but chapter 10 wasn't. > This error was introduced during semaphore-to-mutex conversion of the > Unreliable guide. :-) > > If user context which performs mutex_lock() or mutex_trylock() is > preempted by interrupt context which performs mutex_trylock() on the > same mutex instance, a deadlock occurs. This is because these functions > do not disable local IRQs when they operate on mutex->wait_lock. Acked-by: Rusty Russell I'm assuming Andrew Morton or Randy Dunlap will pick this up... Thanks! Rusty. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/