Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752413AbdGDPcl (ORCPT ); Tue, 4 Jul 2017 11:32:41 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:49053 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752315AbdGDPck (ORCPT ); Tue, 4 Jul 2017 11:32:40 -0400 Date: Tue, 4 Jul 2017 17:32:37 +0200 (CEST) From: Thomas Gleixner To: Davidlohr Bueso cc: LKML , linux-mm@kvack.org, Andrey Ryabinin , Michal Hocko , Andrew Morton , Vlastimil Babka , Vladimir Davydov , Peter Zijlstra Subject: Re: [patch V2 2/2] mm/memory-hotplug: Switch locking to a percpu rwsem In-Reply-To: <20170704152206.GB11168@linux-80c1.suse> Message-ID: References: <20170704093232.995040438@linutronix.de> <20170704093421.506836322@linutronix.de> <20170704150106.GA11168@linux-80c1.suse> <20170704152206.GB11168@linux-80c1.suse> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 486 Lines: 11 On Tue, 4 Jul 2017, Davidlohr Bueso wrote: > On Tue, 04 Jul 2017, Davidlohr Bueso wrote: > > > As a side effect you end up optimizing get/put_online_mems() at the cost > > of more overhead for the actual hotplug operation, which is rare and of less > > performance importance. > > So nm this, the reader side actually gets _more_ expensive with pcpu-rwsems > due to at least two full barriers for each get/put operation. Compared to a mutex_lock/unlock() pair on a global mutex ....