Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753751AbcDUQ0e (ORCPT ); Thu, 21 Apr 2016 12:26:34 -0400 Received: from mail.skyhub.de ([78.46.96.112]:37278 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752114AbcDUQ0c (ORCPT ); Thu, 21 Apr 2016 12:26:32 -0400 Date: Thu, 21 Apr 2016 18:26:11 +0200 From: Borislav Petkov To: Andy Lutomirski Cc: Andy Lutomirski , X86 ML , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v2] x86/vdso: Use RDPID in preference to LSL when available Message-ID: <20160421162611.GJ28821@pd.tnic> References: <2452e4bba35cf473d975a90d90533cf580a012f3.1461201316.git.luto@kernel.org> <20160421121640.GC28821@pd.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1111 Lines: 34 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.