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: <5543CFE5.1030509@redhat.com>
Date:	Fri, 01 May 2015 15:11:33 -0400
From:	Rik van Riel <riel@...hat.com>
To:	Ingo Molnar <mingo@...nel.org>
CC:	Andy Lutomirski <luto@...capital.net>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	X86 ML <x86@...nel.org>, williams@...hat.com,
	Andrew Lutomirski <luto@...nel.org>, fweisbec@...hat.com,
	Peter Zijlstra <peterz@...radead.org>,
	Heiko Carstens <heiko.carstens@...ibm.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	Ingo Molnar <mingo@...hat.com>,
	Paolo Bonzini <pbonzini@...hat.com>,
	"Paul E. McKenney" <paulmck@...ibm.com>,
	Linus Torvalds <torvalds@...ux-foundation.org>
Subject: Re: [PATCH 3/3] context_tracking,x86: remove extraneous irq disable
 & enable from context tracking on syscall entry

On 05/01/2015 02:40 PM, Ingo Molnar wrote:

> Or we could do that in the syscall path with a single store of a 
> constant flag to a location in the task struct. We have a number of 
> natural flags that get written on syscall entry, such as:
> 
>         pushq_cfi $__USER_DS                    /* pt_regs->ss */
> 
> That goes to a constant location on the kernel stack. On return from 
> system calls we could write 0 to that location.
> 
> So the remote CPU would have to do a read of this location. There are 
> two cases:
> 
>  - If it's 0, then it has observed quiescent state on that CPU. (It 
>    does not have to be atomics anymore, as we'd only observe the value 
>    and MESI coherency takes care of it.)

That should do the trick.

>  - If it's not 0 then the remote CPU is not executing user-space code 
>    and we can install (remotely) a TIF_NOHZ flag in it and expect it 
>    to process it either on return to user-space or on a context 
>    switch.

I may have to think about this a little more, but
it seems like it should work.

Can we use a separate byte in the flags word for
flags that can get set remotely, so we can do
stores and clearing of local-only flags without
atomic instructions?

> This way, unless I'm missing something, reduces the overhead to a 
> single store to a hot cacheline on return-to-userspace - which 
> instruction if we place it well might as well be close to zero cost. 
> No syscall entry cost. Slow-return cost only in the (rare) case of 
> someone using synchronize_rcu().

I think that should take care of the RCU aspect of
nohz_full.

-- 
All rights reversed
--
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