Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Sat, 21 Dec 2002 12:20:58 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Sat, 21 Dec 2002 12:20:58 -0500 Received: from bjl1.asuk.net.64.29.81.in-addr.arpa ([81.29.64.88]:11246 "EHLO bjl1.asuk.net") by vger.kernel.org with ESMTP id ; Sat, 21 Dec 2002 12:20:56 -0500 Date: Sat, 21 Dec 2002 17:28:55 +0000 From: Jamie Lokier To: Ingo Molnar Cc: Linus Torvalds , Brian Gerst , Andi Kleen , linux-kernel@vger.kernel.org, davej@suse.de Subject: Re: Intel P6 vs P7 system call performance Message-ID: <20021221172855.GB23577@bjl1.asuk.net> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4i Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1535 Lines: 38 Ingo Molnar wrote: > > > How about this patch? Instead of making a per-cpu trampoline, write to > > > the msr during each context switch. > > > > I wanted to avoid slowing down the context switch, but I didn't actually > > time how much the MSR write hurts you (it needs to be conditional, > > though, I think). > > this is the solution i took in the original vsyscall patches. The syscall > entry cost is at least one factor more important than the context-switch > cost. The MSR write was not all that slow when i measured it (it was on > the range of 20 cycles), and it's definitely something the chip makers > should keep fast. I think it would be better to make NMI and Debug trap use task gates, if that does actually work, and let the NMI and debug handlers fix the stack if they trap in the entry paths. They are much rarer after all. My unreliable memory recalls about 40 cycles for an MSR write on my Celeron. However, I think you still need MSR writes _sometimes_ in the context switch to disable sysenter for vm86-mode tasks. Could the context switch be written like this?: if (unlikely((prev_task->flags | next_task->flags) & PF_SLOW_SWITCH)) { // Do rare stuff including debug registers // and sysenter/syscall MSR change for vm86. } // Other stuff. -- Jamie - 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/