Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753551AbbHKWS3 (ORCPT ); Tue, 11 Aug 2015 18:18:29 -0400 Received: from mail-wi0-f171.google.com ([209.85.212.171]:35952 "EHLO mail-wi0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752731AbbHKWS1 (ORCPT ); Tue, 11 Aug 2015 18:18:27 -0400 Date: Wed, 12 Aug 2015 00:18:24 +0200 From: Frederic Weisbecker To: dvlasenk@redhat.com, riel@redhat.com, bp@alien8.de, peterz@infradead.org, brgerst@gmail.com, vda.linux@googlemail.com, keescook@chromium.org, tglx@linutronix.de, oleg@redhat.com, luto@kernel.org, luto@amacapital.net, torvalds@linux-foundation.org, mingo@kernel.org, hpa@zytor.com, linux-kernel@vger.kernel.org Cc: linux-tip-commits@vger.kernel.org Subject: Re: [tip:x86/asm] x86/asm/entry/64: Migrate error and IRQ exit work to C and remove old assembly code Message-ID: <20150811221822.GA15639@lerouge> References: <60e90901eee611e59e958bfdbbe39969b4f88fe5.1435952415.git.luto@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2860 Lines: 67 On Tue, Jul 07, 2015 at 03:53:29AM -0700, tip-bot for Andy Lutomirski wrote: > Commit-ID: 02bc7768fe447ae305e924b931fa629073a4a1b9 > Gitweb: http://git.kernel.org/tip/02bc7768fe447ae305e924b931fa629073a4a1b9 > Author: Andy Lutomirski > AuthorDate: Fri, 3 Jul 2015 12:44:31 -0700 > Committer: Ingo Molnar > CommitDate: Tue, 7 Jul 2015 10:59:08 +0200 > > x86/asm/entry/64: Migrate error and IRQ exit work to C and remove old assembly code > > Signed-off-by: Andy Lutomirski > Cc: Andy Lutomirski > Cc: Borislav Petkov > Cc: Brian Gerst > Cc: Denys Vlasenko > Cc: Denys Vlasenko > Cc: Frederic Weisbecker > Cc: H. Peter Anvin > Cc: Kees Cook > Cc: Linus Torvalds > Cc: Oleg Nesterov > Cc: Peter Zijlstra > Cc: Rik van Riel > Cc: Thomas Gleixner > Cc: paulmck@linux.vnet.ibm.com > Link: http://lkml.kernel.org/r/60e90901eee611e59e958bfdbbe39969b4f88fe5.1435952415.git.luto@kernel.org > Signed-off-by: Ingo Molnar > --- > arch/x86/entry/entry_64.S | 64 +++++++++++----------------------------- > arch/x86/entry/entry_64_compat.S | 5 ++++ > 2 files changed, 23 insertions(+), 46 deletions(-) > > diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S > index 83eb63d..168ee26 100644 > --- a/arch/x86/entry/entry_64.S > +++ b/arch/x86/entry/entry_64.S > @@ -508,7 +508,16 @@ END(irq_entries_start) > > testb $3, CS(%rsp) > jz 1f > + > + /* > + * IRQ from user mode. Switch to kernel gsbase and inform context > + * tracking that we're in kernel mode. > + */ > SWAPGS > +#ifdef CONFIG_CONTEXT_TRACKING > + call enter_from_user_mode > +#endif There have been a lot of patches going there lately so I couldn't follow everything and since you just started a discussion on context tracking, I just had a look on the latest change. So it seems we're now calling user_exit() on IRQ entry. This is not something we want. We already have everything we need with rcu_irq_enter() and vtime_account_irq_enter(). user_exit() brings a lot of overhead here that we don't need. Plus this is called unconditionally since CONFIG_CONTEXT_TRACKING=y on most distros now. We really want the context tracking code to be called on syscall slow path only (and exceptions with static keys but an exception slow path would be desired as well). -- 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/