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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160112140519.GG6357@twins.programming.kicks-ass.net>
Date:	Tue, 12 Jan 2016 15:05:19 +0100
From:	Peter Zijlstra <peterz@...radead.org>
To:	"Wangnan (F)" <wangnan0@...wei.com>
Cc:	Alexei Starovoitov <alexei.starovoitov@...il.com>, acme@...nel.org,
	linux-kernel@...r.kernel.org, pi3orama@....com, lizefan@...wei.com,
	netdev@...r.kernel.org, davem@...emloft.net,
	Adrian Hunter <adrian.hunter@...el.com>,
	Arnaldo Carvalho de Melo <acme@...hat.com>,
	David Ahern <dsahern@...il.com>,
	Ingo Molnar <mingo@...nel.org>,
	Yunlong Song <yunlong.song@...wei.com>
Subject: Re: [PATCH 27/53] perf/core: Put size of a sample at the end of it
 by PERF_SAMPLE_TAILSIZE

On Tue, Jan 12, 2016 at 01:33:28PM +0800, Wangnan (F) wrote:
> >How about another idea:
> >. update data_tail pointer when head is about to overwrite it

> Even in the very first try at 2013 in [1], reading from the ring
> buffer is avoided. I don't think Peter changes his mind now.

So I don't object to that this approach per-se, as per:

 lkml.kernel.org/r/20151023151205.GW11639@...ns.programming.kicks-ass.net

The main concern is doing it so that the regular !overwrite mode doesn't
suffer in performance.

The patch above choses to sacrifice about half the buffer space to avoid
having to fwd parse events on every overwrite, but doing the fwd search
is certainly possible (just really expensive).

> >Another concern is validity of records stored. If user space messes
> >with ring-buffer, kernel won't be able to move data_tail properly
> >and would need to indicate that to userspace somehow.
> >But memory saving of 8 bytes per record could be sizable
> 
> Yes. But I have already discussed with Peter on this in [2].

So given the trade-off between loosing half the buffer and adding 8
bytes to every event I'm not sure which is the worst.

Also, the way its implemented means they're not in fact mutually
exclusive, both can be had.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ