Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751702AbbEZSfg (ORCPT ); Tue, 26 May 2015 14:35:36 -0400 Received: from mail-qk0-f171.google.com ([209.85.220.171]:32820 "EHLO mail-qk0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751614AbbEZSfY (ORCPT ); Tue, 26 May 2015 14:35:24 -0400 Date: Tue, 26 May 2015 14:35:20 -0400 From: Tejun Heo To: Linus Torvalds Cc: Peter Zijlstra , Oleg Nesterov , Paul McKenney , Ingo Molnar , Linux Kernel Mailing List , der.herr@hofr.at, Davidlohr Bueso Subject: Re: [RFC][PATCH 0/5] Optimize percpu-rwsem Message-ID: <20150526183520.GI7099@htj.duckdns.org> References: <20150526114356.609107918@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1518 Lines: 35 Hello, Linus. On Tue, May 26, 2015 at 11:12:04AM -0700, Linus Torvalds wrote: ... > Is there some new use that I don't know about? Have people really > looked at that uprobes code deeply? OF COURSE global locks will have > problems, I'm not at all convinced that "let's make that global lock > really complicated and clever" is the proper solution. I've posted a patchset to make threadgroup rwsem cgroup-specific (it is used only by cgroups) and replace the per-threadgroup rwsems with a global percpu_rwsem. This is primarily to allow either succeeding or failing migrations of multiple tasks atomically. We already try to do multiple task migrations in some corner cases and the unified hierarchy will make wider use of it. Currently, the implementation is broken as there's no easy way of reverting changes if the operation fails in the middle. Given that task migrations aren't particularly high frequency operations, a global percpu_rwsem is likely to be workable while being less tedious and slightly less costly for the usual fork/exit paths. That said, from cgroup's pov, write-locking per-threadgroup rwsems of all target tasks works too although we'd need an outer mutex to serialize down-write attempts to avoid locking order issues. Thanks. -- tejun -- 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/