From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932784AbbHKWtL (ORCPT ); Tue, 11 Aug 2015 18:49:11 -0400 Received: from mail-wi0-f181.google.com ([209.85.212.181]:33053 "EHLO mail-wi0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932249AbbHKWtJ (ORCPT ); Tue, 11 Aug 2015 18:49:09 -0400 Date: Wed, 12 Aug 2015 00:49:06 +0200 From: Frederic Weisbecker To: Andy Lutomirski Cc: Denys Vlasenko , Rik van Riel , Borislav Petkov , Peter Zijlstra , Brian Gerst , Denys Vlasenko , Kees Cook , Thomas Gleixner , Oleg Nesterov , Andrew Lutomirski , Linus Torvalds , Ingo Molnar , "H. Peter Anvin" , "linux-kernel@vger.kernel.org" , "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: <20150811224905.GC15639@lerouge> References: <60e90901eee611e59e958bfdbbe39969b4f88fe5.1435952415.git.luto@kernel.org> <20150811221822.GA15639@lerouge> 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 On Tue, Aug 11, 2015 at 03:25:04PM -0700, Andy Lutomirski wrote: > Can you explain to me what context tracking does that rcu_irq_enter > and vtime_account_irq_enter don't do that's expensive? Frankly, I'd > rather drop everything except the context tracking callback. Irqs have their own hooks in the generic code. irq_enter() and irq_exit(). And those take care of RCU and time accounting already. So arch code really doesn't need to care about that. context tracking exists for the sole purpose of tracking states that don't have generic hooks. Those are syscalls and exceptions. Besides, rcu_user_exit() is more costly than rcu_irq_enter() which have been designed for the very purpose of providing a fast RCU tracking for non sleepable code (which needs rcu_user_exit()). > > We also need this for the deletion of exception_enter from the trap > entries to be correct. I'm not sure we can really delete exception_enter(). See my other email. > Like I said in the other thread, there are too many hooks for arch > code to juggle. Grumble. Well, archs don't need to care about irq hooks. They only need to track syscalls and exception. I've been thinking about pushing down syscalls and exceptions to generic handlers. It might work for syscalls btw. But many exceptions have only arch handlers, or significant amount of work is done on the arch level which might make use of RCU (eg: breakpoint handlers on x86).