From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Zijlstra Date: Thu, 31 Mar 2016 08:44:12 +0000 Subject: Re: [PATCH 03/11] locking, rwsem: introduce basis for down_write_killable Message-Id: <20160331084412.GF3430@twins.programming.kicks-ass.net> List-Id: References: <1456750705-7141-1-git-send-email-mhocko@kernel.org> <1456750705-7141-4-git-send-email-mhocko@kernel.org> <20160330132549.GU3408@twins.programming.kicks-ass.net> <20160331083336.GA27831@dhcp22.suse.cz> In-Reply-To: <20160331083336.GA27831@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Michal Hocko Cc: LKML , Ingo Molnar , Thomas Gleixner , "H. Peter Anvin" , "David S. Miller" , Tony Luck , Andrew Morton , Chris Zankel , Max Filippov , x86@kernel.org, linux-alpha@vger.kernel.org, linux-ia64@vger.kernel.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, linux-xtensa@linux-xtensa.org, linux-arch@vger.kernel.org On Thu, Mar 31, 2016 at 10:33:36AM +0200, Michal Hocko wrote: > > __mutex_lock_common() has it before the call to schedule and after the > > 'trylock'. > > > > The difference is that rwsem will now respond to the KILL and return > > -EINTR even if the lock is available, whereas mutex will acquire it and > > ignore the signal (for a little while longer). > > > > Neither is wrong per se, but I feel all the locking primitives should > > behave in a consistent manner in this regard. > > Agreed! What about the following on top? I will repost the full patch > if it looks OK. Yep, that seems to have the right shape to it. Thanks! From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752706AbcCaIoe (ORCPT ); Thu, 31 Mar 2016 04:44:34 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:34026 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750971AbcCaIo2 (ORCPT ); Thu, 31 Mar 2016 04:44:28 -0400 Date: Thu, 31 Mar 2016 10:44:12 +0200 From: Peter Zijlstra To: Michal Hocko Cc: LKML , Ingo Molnar , Thomas Gleixner , "H. Peter Anvin" , "David S. Miller" , Tony Luck , Andrew Morton , Chris Zankel , Max Filippov , x86@kernel.org, linux-alpha@vger.kernel.org, linux-ia64@vger.kernel.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, linux-xtensa@linux-xtensa.org, linux-arch@vger.kernel.org Subject: Re: [PATCH 03/11] locking, rwsem: introduce basis for down_write_killable Message-ID: <20160331084412.GF3430@twins.programming.kicks-ass.net> References: <1456750705-7141-1-git-send-email-mhocko@kernel.org> <1456750705-7141-4-git-send-email-mhocko@kernel.org> <20160330132549.GU3408@twins.programming.kicks-ass.net> <20160331083336.GA27831@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160331083336.GA27831@dhcp22.suse.cz> User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 31, 2016 at 10:33:36AM +0200, Michal Hocko wrote: > > __mutex_lock_common() has it before the call to schedule and after the > > 'trylock'. > > > > The difference is that rwsem will now respond to the KILL and return > > -EINTR even if the lock is available, whereas mutex will acquire it and > > ignore the signal (for a little while longer). > > > > Neither is wrong per se, but I feel all the locking primitives should > > behave in a consistent manner in this regard. > > Agreed! What about the following on top? I will repost the full patch > if it looks OK. Yep, that seems to have the right shape to it. Thanks!