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.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,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 8E966C43461 for ; Thu, 17 Sep 2020 10:53:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 50F95204FD for ; Thu, 17 Sep 2020 10:53:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=plexistor-com.20150623.gappssmtp.com header.i=@plexistor-com.20150623.gappssmtp.com header.b="O0TtsmLM" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726704AbgIQKxI (ORCPT ); Thu, 17 Sep 2020 06:53:08 -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-Google-Smtp-Source: ABdhPJzJfw93qfgF7JBy0y8RzBEbFoASNUOTDTI5xFQKbX5C9c6f9EmP5lkwoB3UUsK73XcUntjoWw== 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