Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1737275ybi; Sat, 8 Jun 2019 17:26:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqzhLh3i8r9+tBZXzWMGPA2QIopmFO8YFv0XYwcSRag5HXIHhvmFUwu7xZftyV1noRabavOK X-Received: by 2002:a17:90a:af8d:: with SMTP id w13mr13550754pjq.143.1560039978753; Sat, 08 Jun 2019 17:26:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560039978; cv=none; d=google.com; s=arc-20160816; b=S1tdv6jsHkPdB5P4+VTgwuva8lcdpWHxnu58LxkvGkC8CqqoRwWp/9v3oLtoyCw4pE MnXq01bzyzduyiFn3EoI4UkjBpIklV5v+FEzfw5tOKvE9puWxIce25DssyfHURhene7k kvhOUcBiQ2vBmjS69wZQ8TR+1k2eqvGK8ktyB902in+SFmLWIohKEHYUyOeCQl8EKr4l KQ2Nvx/b4JTgofFhYPjIj3+xA5NRBD/zNNe4FZjH4pSdIDXaajn6eSsFU3Bk6JNk5yqf hbKPvmWbRStDZMIbJpCR6e1PCJUHt7DDrhmYpqtSYAJu/qX1C/KBnfjsp09i844eDHNk AatQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=C+3zcOSI20hWPObsiSF7B1jjBYG49CwgDqF3xGgzIQU=; b=TZRxZ925cVXS1wTz5HOooiQ8471G8pOAbxdDXuf9H0eOF/EGE9c70RJ/vNhkaQtGwv 3YDj8R2/yPeP/nLjSrvV1J3S3eUvhhm34n7MhqOlRpFiSWmwX3Pw8RZ4lpoQ4E8DBXfr Kc/iiK+WXga1hicoTYVXN0ERjWTLgiFwNOrWlaNsYgbHIwkfgYWSTjBGC64QT3/akFlQ URf+SyXy4ey/j5pFCEiFZg5GXs2A9bo+JfToUCc0btJVSmRJg+ilW2BBgX8tzDoJ5/1j MjNk9JO/6HMLQAxz/rSElE0XdoyPK1zAy95QOXcq+PQwLo5CsRdLg0jU1EEUhL2EMn0w psTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b="M6/au7uo"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ce16si2248459plb.331.2019.06.08.17.26.00; Sat, 08 Jun 2019 17:26:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b="M6/au7uo"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727577AbfFIAYv (ORCPT + 99 others); Sat, 8 Jun 2019 20:24:51 -0400 Received: from mail-lf1-f68.google.com ([209.85.167.68]:38074 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726190AbfFIAYu (ORCPT ); Sat, 8 Jun 2019 20:24:50 -0400 Received: by mail-lf1-f68.google.com with SMTP id b11so4203945lfa.5 for ; Sat, 08 Jun 2019 17:24:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=C+3zcOSI20hWPObsiSF7B1jjBYG49CwgDqF3xGgzIQU=; b=M6/au7uo2exz13yab4j92HGMBe2Sel1so7WZYgdfPjfFUlmg4AnsR0s6jvN45DNX58 xcHY7SoYl0FpT4CkUJ27HpOCH/RJzHMTqJkbyoIVIoibBFPDgsDW5NYnVpcDaY61EdQl w3KiH/q4apRfu6r9lvRrR8mMgs51CqSIDZUQA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=C+3zcOSI20hWPObsiSF7B1jjBYG49CwgDqF3xGgzIQU=; b=jYqrYTNN1yVtIEZhTYkB9HdjFatIv0nDFNdZp+z8F8SjrIDNkE6vISWJsjKG5sfjpZ 2uAOjC7iMbaStuwPIPYWYHya79iBHFVQ3mv3KsKD9N3Ob4VjGUxXzHOYpurixmQjKRY+ 3JfPvR1eG5+hGARhF6Nj7Dgx7KucmtfUX657hGHxzOUGTRGit7lWYV2stZ5GnB+Hc3pN NGRIKaFHy6TS4kzHbN66rIwCvkdqCpSlrrMu0TL2oa7R/2wA8F5J5xm7HYOBjI7WTbSc g+EGHXNA+DBA9mAP/z0D6A5YA9w7wo5rpMXBt2jVXDBS8JAwCcLoburGBbV9yWDmnlIQ 3Gnw== X-Gm-Message-State: APjAAAWXolRx9zrdEEW0TgZFpqVVxGh4EIkkWxvlk/sxXcv7eFE7CFwG J63WQPgdD/QW5FuEN3wIQLFHjYcTTOZO+/YWkz2eZw== X-Received: by 2002:a19:4017:: with SMTP id n23mr33198876lfa.112.1560039888556; Sat, 08 Jun 2019 17:24:48 -0700 (PDT) MIME-Version: 1.0 References: <20190531135051.GL28207@linux.ibm.com> In-Reply-To: From: Joel Fernandes Date: Sat, 8 Jun 2019 20:24:36 -0400 Message-ID: Subject: Re: Question about cacheline bounching with percpu-rwsem and rcu-sync To: "Paul E. McKenney" Cc: Oleg Nesterov , Eric Dumazet , rcu , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 31, 2019 at 10:43 AM Joel Fernandes wrote: [snip] > > > > Either way, it would be good for you to just try it. Create a kernel > > module or similar than hammers on percpu_down_read() and percpu_up_read(), > > and empirically check the scalability on a largish system. Then compare > > this to down_read() and up_read() > > Will do! thanks. I created a test for this and the results are quite amazing just stressed read lock/unlock for rwsem vs percpu-rwsem. The test is conducted on a dual socket Intel x86_64 machine with 14 cores each socket. Test runs 10,000,000 loops of rwsem vs percpu-rwsem: https://github.com/joelagnel/linux-kernel/commit/8fe968116bd887592301179a53b7b3200db84424 Graphs/Results here: https://docs.google.com/spreadsheets/d/1cbVLNK8tzTZNTr-EDGDC0T0cnFCdFK3wg2Foj5-Ll9s/edit?usp=sharing The completion time of the test goes up somewhat exponentially with the number of threads, for the rwsem case, where as for percpu-rwsem it is the same. I could add this data to some of the documentation as well. Thanks! - Joel