public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: Andy Lutomirski <luto@amacapital.net>
Cc: Andy Lutomirski <luto@kernel.org>, X86 ML <x86@kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] x86/vdso: Use RDPID in preference to LSL when available
Date: Thu, 21 Apr 2016 18:26:11 +0200	[thread overview]
Message-ID: <20160421162611.GJ28821@pd.tnic> (raw)
In-Reply-To: <CALCETrV7ggSPR_LVBTzek4YkQWHrLUi_Y5xSrBd6t+m-jnpTBg@mail.gmail.com>

On Thu, Apr 21, 2016 at 08:25:45AM -0700, Andy Lutomirski wrote:
> Didn't I?

Bah, I cut off the line which has the "=a" and then did the commenting.
Sorry about the noise.

> I thought about it, and there were two reasons:
> 
> 1. I don't think we want to use __getcpu in the kernel.  LSL is fairly
> slow, and we'd still need to mask off the node number.
> raw_smp_processor_id(), in contrast, is a single load.

Right.

> 2. I have no way to benchmark this thing.  I'm assuming the RDPID will
> be faster than LSL, but that doesn't mean it's faster than a load.
> (It could be -- it will save a cache line.)

But the RDPID reads an MSR. So it probably is microcode and thus slower
than a load... I guess one of the reasons for the RDPID is to avoid the
serialization cost of RDTSCP.

> So we might actually want something that does an alternative where the
> two choices are the percpu load and RDPID ; AND, but that wouldn't end
> up sharing code.  But I'll leave that to someone with an actual
> RDPID-supporting CPU :)

Right.

-- 
Regards/Gruss,
    Boris.

ECO tip #101: Trim your mails when you reply.

      reply	other threads:[~2016-04-21 16:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-21  1:16 [PATCH v2] x86/vdso: Use RDPID in preference to LSL when available Andy Lutomirski
2016-04-21 12:16 ` Borislav Petkov
2016-04-21 15:25   ` Andy Lutomirski
2016-04-21 16:26     ` Borislav Petkov [this message]

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=20160421162611.GJ28821@pd.tnic \
    --to=bp@alien8.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=luto@kernel.org \
    --cc=x86@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