lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALCETrXHNwYT9b4RWWw3TSO_7LqX9csn=sE-Sa7oyy860BL0UQ@mail.gmail.com>
Date:	Tue, 11 Aug 2015 15:59:37 -0700
From:	Andy Lutomirski <luto@...capital.net>
To:	Frederic Weisbecker <fweisbec@...il.com>,
	Paul McKenney <paulmck@...ux.vnet.ibm.com>
Cc:	Denys Vlasenko <dvlasenk@...hat.com>,
	Rik van Riel <riel@...hat.com>,
	Borislav Petkov <bp@...en8.de>,
	Peter Zijlstra <peterz@...radead.org>,
	Brian Gerst <brgerst@...il.com>,
	Denys Vlasenko <vda.linux@...glemail.com>,
	Kees Cook <keescook@...omium.org>,
	Thomas Gleixner <tglx@...utronix.de>,
	Oleg Nesterov <oleg@...hat.com>,
	Andrew Lutomirski <luto@...nel.org>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Ingo Molnar <mingo@...nel.org>,
	"H. Peter Anvin" <hpa@...or.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"linux-tip-commits@...r.kernel.org" 
	<linux-tip-commits@...r.kernel.org>
Subject: Re: [tip:x86/asm] x86/asm/entry/64: Migrate error and IRQ exit work
 to C and remove old assembly code

On Tue, Aug 11, 2015 at 3:49 PM, Frederic Weisbecker <fweisbec@...il.com> wrote:
> 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.

I'd love to have irq_enter_from_user and irq_enter_from_kernel instead.

>
> 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()).
>

So rcu_user_exit is slower because it's okay to sleep after calling it?

Would it be possible to defer the overhead until we actually try to
sleep rather than doing it on entry?  (I have no idea what's going on
under the hood.)

Anyway, irq_enter_from_user would solve this problem completely.

>
> 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).

I'm trying to port the meat of the x86 syscall code to C.  Maybe the
result will generalize.  The exit code is already in C (in -tip).

--Andy

-- 
Andy Lutomirski
AMA Capital Management, LLC
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ