public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Jesper Dangaard Brouer <brouer@redhat.com>
Cc: "Björn Töpel" <bjorn.topel@gmail.com>, bpf <bpf@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	"Christoph Lameter" <cl@linux.com>,
	"Dennis Zhou" <dennis@kernel.org>
Subject: Re: Percpu variables, benchmarking, and performance weirdness
Date: Fri, 20 Dec 2019 07:12:39 -0800	[thread overview]
Message-ID: <20191220151239.GE2914998@devbig004.ftw2.facebook.com> (raw)
In-Reply-To: <20191220103420.6f9304ab@carbon>

On Fri, Dec 20, 2019 at 10:34:20AM +0100, Jesper Dangaard Brouer wrote:
> > So, my question to the uarch/percpu folks out there: Why are percpu
> > accesses (%gs segment register) more expensive than regular global
> > variables in this scenario.
> 
> I'm also VERY interested in knowing the answer to above question!?
> (Adding LKML to reach more people)

No idea.  One difference is that percpu accesses are through vmap area
which is mapped using 4k pages while global variable would be accessed
through the fault linear mapping.  Maybe you're getting hit by tlb
pressure?

Thanks.

-- 
tejun

  reply	other threads:[~2019-12-20 15:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAJ+HfNgNAzvdBw7gBJTCDQsne-HnWm90H50zNvXBSp4izbwFTA@mail.gmail.com>
2019-12-20  9:34 ` Percpu variables, benchmarking, and performance weirdness Jesper Dangaard Brouer
2019-12-20 15:12   ` Tejun Heo [this message]
2019-12-20 15:36     ` Christopher Lameter
2019-12-20 17:10       ` Dennis Zhou
2019-12-20 16:22     ` Eric Dumazet
2019-12-20 16:34       ` Tejun Heo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191220151239.GE2914998@devbig004.ftw2.facebook.com \
    --to=tj@kernel.org \
    --cc=bjorn.topel@gmail.com \
    --cc=bpf@vger.kernel.org \
    --cc=brouer@redhat.com \
    --cc=cl@linux.com \
    --cc=dennis@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox