From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755325AbcFQI0J (ORCPT ); Fri, 17 Jun 2016 04:26:09 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:58546 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753942AbcFQI0H (ORCPT ); Fri, 17 Jun 2016 04:26:07 -0400 Date: Fri, 17 Jun 2016 10:25:59 +0200 From: Peter Zijlstra To: Oleg Drokin Cc: Mailing List , mingo@redhat.com, arjan@linux.intel.com, "J . Bruce Fields" , Jeff Layton Subject: Re: initialize a mutex into locked state? Message-ID: <20160617082559.GD30935@twins.programming.kicks-ass.net> References: <55315ADD-4AE1-4EA4-8291-1B07F659BD99@linuxhacker.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55315ADD-4AE1-4EA4-8291-1B07F659BD99@linuxhacker.ru> User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 15, 2016 at 02:23:35PM -0400, Oleg Drokin wrote: > Hello! > > To my surprise I found out that it's not possible to initialise a mutex into > a locked state. > I discussed it with Arjan and apparently there's no fundamental reason > not to allow this. There is. A mutex _must_ have an owner. If you can initialize it in locked state, you could do so statically, ie. outside of the context of a task.