Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp312832pxk; Thu, 17 Sep 2020 03:55:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxBlyq+9Yk4zOGOPoCZNCm6aJz02FvKdHMS3N8DcFr+4O3or90iuNG2aJBw9FUUfWKwOFRE X-Received: by 2002:a17:906:a293:: with SMTP id i19mr30789243ejz.428.1600340117062; Thu, 17 Sep 2020 03:55:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600340117; cv=none; d=google.com; s=arc-20160816; b=AGT6gehGE1Udo900+J3qm1Unooj9NUAWAoLEgpT2vOAdNhn7P0IlGsmVz33BBOuZRZ LTZ5F+AOQmAKy49uGJaHKpMLWS9/s4rDJu1GPIMosKzbTcikzBFaMTqEvcXIt+ovERBd WnsT+WrLSQPQAyzZ4Lh4f/q2iybuCAwvmBRDqZp3cKYUzQ2862YezOmUsm7X+mBIn7d4 JqOnjKwUIIfRRPNlQg4ZSpMpnyHPHmJNgEys1cYYcueBh8RqL/XfdNPmuKnekT7wGRsb efoY+HeUOiugr3Y+kcsD6aIO9d3mj9NofNVLk3lLzXq+RziCbWD7lFJHNDe5V8NcALGP l1Rg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=RGELJOdeW4b71Bd2hOfjUNQx1LOgRfzHQbemIj8oBT0=; b=ouBv2RhXLDjTlg4JUp3rif1wZa6/m9tV8g9DH2+BkkFgxVrNdDcxDaHdLm8c9d/KWZ AhMmeDK3dgpBrXPKTP20vk7rRrWlHX3bv9L784FaDnNhyauGnnwSZGR3XV9lCcNUQ08b GIJeK0SMNAHk8/qvRKulWx1qtgVY5G2PyTPMlv/ebD2wBS/33D6gUdk53oO+7xd9/p4M P2enL5V0ECcz0CJAquUBhsWGvYV4EXYMf+ZUJubKc5aJqDac00uXqcVEvtaP0JCfJmXK NrkLnu7CerXbsfOVMcuuaX+QnCya4UGIQvgFJnohBvOB9IM+PTcefWiCRYwBM7UcmUv0 yOdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@plexistor-com.20150623.gappssmtp.com header.s=20150623 header.b=O0TtsmLM; 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 t17si14712040ejs.91.2020.09.17.03.54.52; Thu, 17 Sep 2020 03:55:17 -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; dkim=pass header.i=@plexistor-com.20150623.gappssmtp.com header.s=20150623 header.b=O0TtsmLM; 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 S1726756AbgIQKxC (ORCPT + 99 others); Thu, 17 Sep 2020 06:53:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53274 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726505AbgIQKwD (ORCPT ); Thu, 17 Sep 2020 06:52:03 -0400 Received: from mail-ej1-x644.google.com (mail-ej1-x644.google.com [IPv6:2a00:1450:4864:20::644]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0A015C06174A for ; Thu, 17 Sep 2020 03:51:47 -0700 (PDT) Received: by mail-ej1-x644.google.com with SMTP id p9so2613060ejf.6 for ; Thu, 17 Sep 2020 03:51:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=plexistor-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=RGELJOdeW4b71Bd2hOfjUNQx1LOgRfzHQbemIj8oBT0=; b=O0TtsmLM1mEFIkrW6anX3vSM03iH1kz/jz/9BRDaIXPnsJg4HNTPwrPH4S6h6v+QxH fo3b8B+eccCAlrXekzTvJqfBUJuYybnyedE9Wy9kbhmxLRc/11586mNEUSmOQHqYDEAK nl0xhJ3jWt3e9gODjq5Bwm9y12LpEoA/KHf1Egr2NupjbXOqGFf/r5r2GumD2Tc1Nm0v ECojT+VG2co/i0QGYzk4xjMUpNSHcROAkpbT/B/99nZwOcYcMjLZBo76NdBhz9fkwMCJ 9Z0ofblkD/ibR0p1939tW5trBtib1MJ64i+b3Ftxgph6z5pGoUswJBsy/bZW+JI81ZEq fXOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=RGELJOdeW4b71Bd2hOfjUNQx1LOgRfzHQbemIj8oBT0=; b=H+IieTWF50PqzCK3jp7AgFfEOV0VtMxFFP7EcIgcV9X+wfEU2xySreV7fAPiR3KyA8 DdwV3cluP5Qbol+waKTH/KPkUTkmelfAGfqAxKtQnVO5yCnK4LMgYXfwdaaCp48Gczjj VzgFhJSoCJ7Do7GvCPGVBS0xaKBIXNtrtm1PY46LAMG8NoUHzc+SGOuR/sxu/+gpvwaD dAJ/1UGCQTe1oZGHSL9TxJUd5MdSr6JKXKx+M1uUg/LTYK3n5oPkrxzu0ZpRZ9ERm1dD SqHebC5qxUMUCEDIyg4et6EV7DFborwe5bojp2GCHDNYx5Y/3xHwxQIEVoFBrHHWUy+g UqNg== X-Gm-Message-State: AOAM533NQJFS4I2zlG9JraTcY5MEI4/v8LHjtmrUzZaJ/N71KP2BWoPH zRlXy0KEqeb0lEtHy44bmUSC2A== X-Received: by 2002:a17:906:724b:: with SMTP id n11mr30523847ejk.328.1600339906107; Thu, 17 Sep 2020 03:51:46 -0700 (PDT) Received: from ?IPv6:2a02:587:d40:1d00:c424:9586:23a2:8162? ([2a02:587:d40:1d00:c424:9586:23a2:8162]) by smtp.gmail.com with ESMTPSA id x6sm14706311ejf.59.2020.09.17.03.51.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 17 Sep 2020 03:51:45 -0700 (PDT) Subject: Re: [RFC PATCH] locking/percpu-rwsem: use this_cpu_{inc|dec}() for read_count To: Hou Tao , peterz@infradead.org, Oleg Nesterov , Ingo Molnar , Will Deacon Cc: Dennis Zhou , Tejun Heo , Christoph Lameter , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Jan Kara References: <20200915140750.137881-1-houtao1@huawei.com> <20200915150610.GC2674@hirez.programming.kicks-ass.net> <20200915153113.GA6881@redhat.com> <20200915155150.GD2674@hirez.programming.kicks-ass.net> <20200915160344.GH35926@hirez.programming.kicks-ass.net> From: Boaz Harrosh Message-ID: Date: Thu, 17 Sep 2020 13:51:43 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 16/09/2020 15:32, Hou Tao wrote: <> > However the performance degradation is huge under aarch64 (4 sockets, 24 core per sockets): nearly 60% lost. > > v4.19.111 > no writer, reader cn | 24 | 48 | 72 | 96 > the rate of down_read/up_read per second | 166129572 | 166064100 | 165963448 | 165203565 > the rate of down_read/up_read per second (patched) | 63863506 | 63842132 | 63757267 | 63514920 > I believe perhaps Peter Z's suggestion of an additional percpu_down_read_irqsafe() API and let only those in IRQ users pay the penalty. Peter Z wrote: > My leading alternative was adding: percpu_down_read_irqsafe() / > percpu_up_read_irqsafe(), which use local_irq_save() instead of > preempt_disable(). Thanks Boaz