From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932836AbdDQGu3 (ORCPT ); Mon, 17 Apr 2017 02:50:29 -0400 Received: from merlin.infradead.org ([205.233.59.134]:58128 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932574AbdDQGuZ (ORCPT ); Mon, 17 Apr 2017 02:50:25 -0400 Date: Mon, 17 Apr 2017 08:50:22 +0200 From: Peter Zijlstra To: Thomas Gleixner Cc: LKML , Ingo Molnar , Steven Rostedt , Sebastian Siewior Subject: Re: [patch 20/20] cpu/hotplug: Convert hotplug locking to percpu rwsem Message-ID: <20170417065022.ucihdhfazq7bxib4@hirez.programming.kicks-ass.net> References: <20170415170107.643253702@linutronix.de> <20170415171652.917813561@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170415171652.917813561@linutronix.de> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Apr 15, 2017 at 07:01:27PM +0200, Thomas Gleixner wrote: > There are no more (known) nested calls to get_online_cpus() so it's > possible to remove the nested call magic and convert the mutex to a > percpu-rwsem, which speeds up get/put_online_cpus() significantly for the > uncontended case. > > The contended case (write locked for hotplug operations) is slow anyway, so > the slightly more expensive down_write of the percpu rwsem does not matter. So the previous thing was reader biassed and thus prone to writer starvation. So a slightly more expensive write path doesn't matter; esp. as its now fair and provides a guarantee it will happen, unlike the previous one.