Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933290AbbDIS25 (ORCPT ); Thu, 9 Apr 2015 14:28:57 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:51318 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932861AbbDIS2y (ORCPT ); Thu, 9 Apr 2015 14:28:54 -0400 Date: Thu, 9 Apr 2015 20:28:38 +0200 From: Peter Zijlstra To: Kirill Tkhai Cc: linux-kernel@vger.kernel.org, Oleg Nesterov , Andrew Morton , Ingo Molnar , Michal Hocko , Rik van Riel , Ionut Alexa , Peter Hurley , Kirill Tkhai Subject: Re: [PATCH] exit: Use read lock for do_notify_parent() instead of write lock Message-ID: <20150409182838.GZ5029@twins.programming.kicks-ass.net> References: <1428602348.12166.29.camel@parallels.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1428602348.12166.29.camel@parallels.com> 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 Content-Length: 829 Lines: 21 On Thu, Apr 09, 2015 at 08:59:08PM +0300, Kirill Tkhai wrote: I've not really read your email yet, however: > Also, in the future we may think about new rwlock primitive, which atomically > drops write lock and acquires read lock. Something like this for example: > > include/asm-generic/qrwlock.h: > static inline void queue_reduce_locked_write_to_read(struct qrwlock *lock) > { > smp_mb__before_atomic(); > atomic_add(_QR_BIAS - _QW_LOCKED, &lock->cnts); > } we actually have that for the rwsems: downgrade_write(). So the consistent naming would be: queue_downgrade_write(). -- 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/