From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 70F47C43464 for ; Fri, 18 Sep 2020 13:26:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 24AB023447 for ; Fri, 18 Sep 2020 13:26:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726757AbgIRN0i (ORCPT ); Fri, 18 Sep 2020 09:26:38 -0400 Received: from mx2.suse.de ([195.135.220.15]:56530 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726130AbgIRN0i (ORCPT ); Fri, 18 Sep 2020 09:26:38 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 5FF75B03F; Fri, 18 Sep 2020 13:27:10 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id A45CC1E12E1; Fri, 18 Sep 2020 15:26:35 +0200 (CEST) Date: Fri, 18 Sep 2020 15:26:35 +0200 From: Jan Kara To: Oleg Nesterov Cc: peterz@infradead.org, Jan Kara , Boaz Harrosh , Hou Tao , Ingo Molnar , Will Deacon , Dennis Zhou , Tejun Heo , Christoph Lameter , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [RFC PATCH] locking/percpu-rwsem: use this_cpu_{inc|dec}() for read_count Message-ID: <20200918132635.GI18920@quack2.suse.cz> References: <20200915160344.GH35926@hirez.programming.kicks-ass.net> <20200917120132.GA5602@redhat.com> <20200918090702.GB18920@quack2.suse.cz> <20200918100112.GN1362448@hirez.programming.kicks-ass.net> <20200918101216.GL35926@hirez.programming.kicks-ass.net> <20200918104824.GA23469@redhat.com> <20200918110310.GO1362448@hirez.programming.kicks-ass.net> <20200918130914.GA26777@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200918130914.GA26777@redhat.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri 18-09-20 15:09:14, Oleg Nesterov wrote: > On 09/18, Peter Zijlstra wrote: > > > But again, do we really want this? > > > > I like the two counters better, avoids atomics entirely, some archs > > hare horridly expensive atomics (*cough* power *cough*). > > I meant... do we really want to introduce percpu_up_read_irqsafe() ? > > Perhaps we can live with the fix from Hou? At least until we find a > "real" performance regression. I can say that for users of percpu rwsem in filesystems the cost of atomic inc/dec is unlikely to matter. The lock hold times there are long enough that it would be just lost in the noise. For other stuff using them like get_online_cpus() or get_online_mems() I'm not so sure... Honza -- Jan Kara SUSE Labs, CR