From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752678AbaFJSNL (ORCPT ); Tue, 10 Jun 2014 14:13:11 -0400 Received: from cdptpa-outbound-snat.email.rr.com ([107.14.166.228]:28667 "EHLO cdptpa-oedge-vip.email.rr.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750897AbaFJSNJ (ORCPT ); Tue, 10 Jun 2014 14:13:09 -0400 Date: Tue, 10 Jun 2014 14:13:06 -0400 From: Steven Rostedt To: Thomas Gleixner Cc: Oleg Nesterov , Linus Torvalds , "Paul E. McKenney" , LKML , Peter Zijlstra , Andrew Morton , Ingo Molnar , Clark Williams Subject: Re: safety of *mutex_unlock() (Was: [BUG] signal: sighand unprotected when accessed by /proc) Message-ID: <20140610141306.04a4bcf3@gandalf.local.home> In-Reply-To: References: <20140603200125.GB1105@redhat.com> <20140606203350.GU4581@linux.vnet.ibm.com> <20140608130718.GA11129@redhat.com> <20140609162613.GE4581@linux.vnet.ibm.com> <20140609181553.GA13681@redhat.com> <20140609142956.3d79e9d1@gandalf.local.home> <20140609154114.20585056@gandalf.local.home> <20140610165704.GA3110@redhat.com> X-Mailer: Claws Mail 3.9.3 (GTK+ 2.24.23; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-RR-Connecting-IP: 107.14.168.118:25 X-Cloudmark-Score: 0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 10 Jun 2014 20:08:37 +0200 (CEST) Thomas Gleixner wrote: > > Perhaps it could simply do ->owner = RT_MUTEX_HAS_WAITERS to make this more > > clear... > > Good point. The new owner can cleanup the mess. > I thought about this too. It should work with the added overhead that every time we go into the unlock slow path, we guarantee that the next lock will go into the lock slowpath. As long as the new acquired lock does a fast unlock, then we get out of this spiral. -- Steve