Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2765067pxk; Sun, 20 Sep 2020 16:54:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxC4RVF+5otMUl6YffcnMyclwCHXYPlFwnCoEcY1bDA3vJfr2n+atE+oLWQXCu3zrHd26sq X-Received: by 2002:aa7:db47:: with SMTP id n7mr50115738edt.315.1600646059683; Sun, 20 Sep 2020 16:54:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600646059; cv=none; d=google.com; s=arc-20160816; b=j2HIOS+sNxdmRbd2o7qEhEVJCNRt4Z1BuUI7eZ4WXb0v3riqfK4sg1vAqiZMv8u66e eAa8PSuknakor/vaSoYgPBeYgVdQ6Nycl0TtcRN7hIMZU5Rw/T59JPeTxKZVaM2OH2d+ lOQcFgNygD3wO9b/BYgBuIQa6DIjfkRi/kc4lyt4vDjbwQjF7lJiotvsEi/o4vRXEehe 8D6US6xp/48+d5wimP3bqGsys95h9LOxX9ymy4uptHfMV+W/62NXVMYwOUNER8VG5pTZ CCF6XcKo9a4hBm7jzOEO7nY7XX2XxoYOkRTVB0r7ddXi2Erm6m8WzYNgi7bDKH261zE1 pIgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=r7QYxty9LukmzM3eCyPE6O0TBLGSmi6+TrVGVtIKZXY=; b=D0q5CHvM4NMAXphJwuFtGBf4ORmbjWoAL2vuLGxSLDn47m/q5RuSZ6dr81HKRUnQjl 9wrAMwRfXyQmY+duxT7XUkpUMG5+hSx8KsmUO9RfEUctjPenNdGK5QJUuBADq0eWatzk 7zhiB5p21aGTtjwHEf0mNNG5KOLUBwkBSgipygm/QArvn0Fl7UKl9A20KfrwqagC153I 9y6NKhU/Ei9/OQK0+N2TqTRM4d142WjdNld3YygTEfScLsknAXGiaO95118kqBxnCRVh hE+cD4LjjztodNd6lp4TjNIXStR3/Qyui36EwYJZ4uffV6xJ8RI3je8Jq5j4mx0gtljp iYSQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r15si6640387ejx.326.2020.09.20.16.53.55; Sun, 20 Sep 2020 16:54:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726360AbgITXuA (ORCPT + 99 others); Sun, 20 Sep 2020 19:50:00 -0400 Received: from mail105.syd.optusnet.com.au ([211.29.132.249]:47977 "EHLO mail105.syd.optusnet.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726156AbgITXt7 (ORCPT ); Sun, 20 Sep 2020 19:49:59 -0400 Received: from dread.disaster.area (pa49-195-191-192.pa.nsw.optusnet.com.au [49.195.191.192]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 393C13A9E86; Mon, 21 Sep 2020 09:49:56 +1000 (AEST) Received: from dave by dread.disaster.area with local (Exim 4.92.3) (envelope-from ) id 1kK95e-0005lx-FN; Mon, 21 Sep 2020 09:49:54 +1000 Date: Mon, 21 Sep 2020 09:49:54 +1000 From: Dave Chinner To: Jan Kara Cc: Oleg Nesterov , peterz@infradead.org, 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: <20200920234954.GY12096@dread.disaster.area> References: <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> <20200918132635.GI18920@quack2.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200918132635.GI18920@quack2.suse.cz> X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.3 cv=IuRgj43g c=1 sm=1 tr=0 cx=a_idp_d a=vvDRHhr1aDYKXl+H6jx2TA==:117 a=vvDRHhr1aDYKXl+H6jx2TA==:17 a=kj9zAlcOel0A:10 a=reM5J-MqmosA:10 a=7-415B0cAAAA:8 a=QF-8DhSd7u3_DeGXtgMA:9 a=CjuIK1q_8ugA:10 a=biEYGPWJfzWAr4FL6Ov7:22 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 18, 2020 at 03:26:35PM +0200, Jan Kara wrote: > 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. I'm not sure that is correct. We do an inc/dec pair per AIO, so if we are running millions of IOPS through the AIO subsystem, then the cost of doing millions of extra atomic ops every second is going to be noticable... Cheers, Dave. -- Dave Chinner david@fromorbit.com