Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754642AbbGBTYu (ORCPT ); Thu, 2 Jul 2015 15:24:50 -0400 Received: from terminus.zytor.com ([198.137.202.10]:55519 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754413AbbGBTYl (ORCPT ); Thu, 2 Jul 2015 15:24:41 -0400 Message-ID: <55958F93.7020609@zytor.com> Date: Thu, 02 Jul 2015 12:22:59 -0700 From: "H. Peter Anvin" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: "Brown, Len" , Andy Lutomirski , Ingo Molnar , Prarit Bhargava CC: "linux-kernel@vger.kernel.org" , Thomas Gleixner , Ingo Molnar , X86 ML , "Chandramouli, Dasaratharaman" , Peter Zijlstra , Borislav Petkov , Andy Lutomirski , Denys Vlasenko , Brian Gerst , Arnaldo Carvalho de Melo Subject: Re: [PATCH] x86, msr: Allow read access to /dev/cpu/X/msr References: <1435341131-3279-1-git-send-email-prarit@redhat.com> <20150627083354.GA12834@gmail.com> <20150627083921.GA13074@gmail.com> <1A7043D5F58CCB44A599DFD55ED4C948468A477B@fmsmsx115.amr.corp.intel.com> In-Reply-To: <1A7043D5F58CCB44A599DFD55ED4C948468A477B@fmsmsx115.amr.corp.intel.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1299 Lines: 28 On 07/01/2015 09:38 AM, Brown, Len wrote: > > BTW. I've had a discussion w/ LLNL about their needs, > both for security and performance. For security, as concluded > by this thread, a white list is the only way to go. > I'm thinking a bit-vector of allowed MSR offsets... > For performance, they absolutely can not afford a system call > for every single MSR access. Here an ioctl to have the > msr driver perform a vector of accesses in a single system > call seems the way to go. I can prototype both of these > using turbostat as the customer. > Every time I have heard about people having issues with performance for MSR access, it is because they are doing cross-CPU accesses which means a neverending stream of IPIs. You get immensely better performance by tying a thread to a CPU and only accessing the local CPU from that thread. This has addressed any performance problems anyone has ever come to me with. As Andy and Ingo have already pointed out, the MSR access itself is pretty much as expensive as the system call overhead. -hpa -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/