Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1197294pxk; Fri, 18 Sep 2020 06:28:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwvGKtxL5rkRrVHkV/pw7qQ9ScL16Hct+Ce44Q8P/eqOE6A3mKI6RLqXLCWbnMheGAd7L52 X-Received: by 2002:a17:906:3506:: with SMTP id r6mr35861654eja.55.1600435679954; Fri, 18 Sep 2020 06:27:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600435679; cv=none; d=google.com; s=arc-20160816; b=rz6UEteptSntkSZ1OCiBlooANllMjX6qQYNDpDVzKqT5YNqdriFmqKiaDKD6VzcosJ CrmIq2FMwK2AX6+Ogt1y1oXTKi4eBLQDVjA5r/TtvWzOyvPswAzZ+uhwSpYT1I0aYHwf ytYkDROD3BseCorTAD7zv31EXpRkvq+0A1/DBlzmCf/VTUUYAmYje/vGCrpxQvrNo7Cv w5C83stYQ+E25JCiqGsYMJ0ugRKtB8tNCwAwXZHDANk0+fglyqOrL3bPF6CMwAjK+4rt WmMq3fmCyPmTzWd1ja/qz1K7uGrsgfUuglBF4C0aY4sOWYNiVxlUXAlQGc3vKENg6fEn UVTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=lJJ/1lFmIW0W4TcfnJ4ZuQSQkyM2sLDpA4uBAkATVcg=; b=FP/jifZs3zC57CNbn6tLS3zkdzt14QRgXL4RH4nkJA4i7qB3e3jYJ18+Tq94vM2cZp Leg18HeT/pFlay2/JFh7og0E5BXQV9M0Tnnjube9354uRb7l1HA063YV3NTJa9OhuEaD ewyGmc5JNkXbxOvdmIu+FhTdELUwL46BV6WnwLaHUbpaA3F2/z4sw90KNPvydKPzgDFb EWA5UCpHCWNoeEELE+WbWlNgveET/mQtLPeEjqAtdda/xByBG2boz22xvknqjyFXvfdR GWyKj6KLuMUhHLU8q/Zwsk7KiIatv5R6m/MdFncaSPzKINzGpZ7kCvhQZQS6//pDXdLP Endg== 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 e6si2151816ejh.487.2020.09.18.06.27.36; Fri, 18 Sep 2020 06:27:59 -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 S1726537AbgIRN0i (ORCPT + 99 others); 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