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: <alpine.DEB.2.10.1410240835200.15577@pianoman.cluster.toy>
Date:	Fri, 24 Oct 2014 08:41:12 -0400 (EDT)
From:	Vince Weaver <vince@...ter.net>
To:	Peter Zijlstra <peterz@...radead.org>
cc:	Andy Lutomirski <luto@...capital.net>,
	Valdis Kletnieks <Valdis.Kletnieks@...edu>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Paul Mackerras <paulus@...ba.org>,
	Arnaldo Carvalho de Melo <acme@...nel.org>,
	Ingo Molnar <mingo@...hat.com>,
	Kees Cook <keescook@...omium.org>,
	Andrea Arcangeli <aarcange@...hat.com>,
	Erik Bosman <ebn310@....vu.nl>
Subject: Re: [RFC 0/5] CR4 handling improvements

On Thu, 23 Oct 2014, Peter Zijlstra wrote:

> On Tue, Oct 21, 2014 at 01:05:49PM -0400, Vince Weaver wrote:

> > There are various reasons why you might want to start events at times
> > other than the beginning of the program.  Some people don't like kernel 
> > multiplexing so they start/stop manually if they want to switch eventsets.
> 
> I suppose you could pre-create all events and use ioctl()s to start/stop
> them where/when desired, this should be faster I think. But yes, this is
> not a use-case I've though much about.

The scheduling step is most of what makes the perf_event start call have 
high overhead.  The other annoyance is the fact that due to the NMI 
watchdog your can successfully perf_event_open() an event group but still 
have it fail at start time, so a lot of code has to be done that does 
extraneous open/start/close calls to make sure the events really fit.

> MAP_POPULATE is your friend there, but yes manually prefaulting is
> perfectly fine too, and the HPC people are quite familiar with the
> concept, they do it for a lot of things.

MAP_POPULATE actually has noticably more overhead than manually 
prefaulting.  It's on my todo list to drop ftrace on there and find out 
why, but I've been stuck chasing kernel-crashing fuzzer bugs instead in my 
spare time.

perfctr and possibly perfmon2 would automatically pre-fault the mmap page 
for you in the kernel, so there was no need for the user to do it.


In any case I wasn't really trying to make trouble here, it's just I came 
across the people using rdpmc w/o perf_event just the other day (on USENET 
of all places).  They were so happy it worked w/o patches now, that I felt 
bad breaking it to them that there were patches floating around that were 
going to make their usecase not work anymore.

I guess like all things though, you can't have anything fun and useful in 
the kernel without the security people taking it away.

Vince
--
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