From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752514AbbF1X5k (ORCPT ); Sun, 28 Jun 2015 19:57:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34937 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753045AbbF1X5i (ORCPT ); Sun, 28 Jun 2015 19:57:38 -0400 Date: Mon, 29 Jun 2015 01:56:14 +0200 From: Oleg Nesterov To: Peter Zijlstra Cc: paulmck@linux.vnet.ibm.com, tj@kernel.org, mingo@redhat.com, linux-kernel@vger.kernel.org, der.herr@hofr.at, dave@stgolabs.net, riel@redhat.com, viro@ZenIV.linux.org.uk, torvalds@linux-foundation.org Subject: [PATCH 0/3] percpu-rwsem: introduce percpu_rw_semaphore->recursive mode Message-ID: <20150628235614.GA24454@redhat.com> References: <20150622121623.291363374@infradead.org> <20150622122256.480062572@infradead.org> <20150622225739.GA5582@redhat.com> <20150623071637.GA3644@twins.programming.kicks-ass.net> <20150623170122.GA26854@redhat.com> <20150623175318.GE3644@twins.programming.kicks-ass.net> <20150624135049.GA31992@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150624135049.GA31992@redhat.com> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/24, Oleg Nesterov wrote: > > So we need percpu_down_write_dont_block_readers(). I already thought > about this before, I'll try to make the patch tomorrow on top of your > changes. Never say tomorrow... > This means that we do not need task_struct->cpuhp_ref, but we can't > avoid livelock we currently have: cpu_hotplug_begin() can never succeed > if the new readers come fast enough. Like with any other "recursive" lock. Peter, I know you don't like the 1st patch. And yes, we could add another mutex into percpu_rw_semaphore instead. But I think it would be better to rely on rcu_sync_enter(). As for completion, we can remove it later. Nevermind, the actual change is 3/3 and it looks simple. Oleg.