Re: [PATCH v1 1/2] perf/core: Use sysctl to turn on/off dropping leaked kernel samples

2018-06-19 Thread Stephane Eranian
On Fri, Jun 15, 2018 at 12:15 AM Jin, Yao wrote: > > > > On 6/15/2018 1:59 PM, Stephane Eranian wrote: > > On Thu, Jun 14, 2018 at 7:10 PM Jin Yao wrote: > >> > >> When doing sampling, for example: > >> > >> perf record -e cycles:u ... > >> > >> On workloads that do a lot of kernel entry/exits we

Re: [PATCH v1 1/2] perf/core: Use sysctl to turn on/off dropping leaked kernel samples

2018-06-18 Thread Mark Rutland
On Tue, Jun 19, 2018 at 09:39:02AM +0800, Jin, Yao wrote: > > > On 6/18/2018 6:45 PM, Peter Zijlstra wrote: > > On Mon, Jun 18, 2018 at 02:55:32PM +0800, Jin, Yao wrote: > > > Thanks for providing the patch. I understand this approach. > > > > > > In my opinion, the skid window is from counter o

Re: [PATCH v1 1/2] perf/core: Use sysctl to turn on/off dropping leaked kernel samples

2018-06-18 Thread Jin, Yao
On 6/18/2018 6:45 PM, Peter Zijlstra wrote: On Mon, Jun 18, 2018 at 02:55:32PM +0800, Jin, Yao wrote: Thanks for providing the patch. I understand this approach. In my opinion, the skid window is from counter overflow to interrupt delivered. While if the skid window is too *big* (e.g. user -

Re: [PATCH v1 1/2] perf/core: Use sysctl to turn on/off dropping leaked kernel samples

2018-06-18 Thread Peter Zijlstra
On Sat, Jun 16, 2018 at 10:27:27AM +0900, Linus Torvalds wrote: > On Fri, Jun 15, 2018 at 8:36 PM Mark Rutland wrote: > > > > At least for sampling the GPRs, we could do something like below > > unconditionally, which seems sufficient for my test cases. > > Ack. > > The PEBS case may need checki

Re: [PATCH v1 1/2] perf/core: Use sysctl to turn on/off dropping leaked kernel samples

2018-06-18 Thread Peter Zijlstra
On Mon, Jun 18, 2018 at 02:55:32PM +0800, Jin, Yao wrote: > Thanks for providing the patch. I understand this approach. > > In my opinion, the skid window is from counter overflow to interrupt > delivered. While if the skid window is too *big* (e.g. user -> kernel), it > should be not very useful.

Re: [PATCH v1 1/2] perf/core: Use sysctl to turn on/off dropping leaked kernel samples

2018-06-18 Thread Peter Zijlstra
On Fri, Jun 15, 2018 at 01:31:34PM +, Liang, Kan wrote: > > On Thu, Jun 14, 2018 at 11:02:53PM -0700, Stephane Eranian wrote: > > > On Thu, Jun 14, 2018 at 7:10 PM Jin Yao wrote: > > > > + /* > > > > +* Due to interrupt latency (AKA "skid"), we may enter the > > > > +* ke

Re: [PATCH v1 1/2] perf/core: Use sysctl to turn on/off dropping leaked kernel samples

2018-06-17 Thread Jin, Yao
On 6/15/2018 7:36 PM, Mark Rutland wrote: On Fri, Jun 15, 2018 at 06:03:22PM +0800, Jin Yao wrote: When doing sampling, for example: perf record -e cycles:u ... On workloads that do a lot of kernel entry/exits we see kernel samples, even though :u is specified. This is due to skid existing.

Re: [PATCH v1 1/2] perf/core: Use sysctl to turn on/off dropping leaked kernel samples

2018-06-15 Thread Linus Torvalds
On Fri, Jun 15, 2018 at 8:36 PM Mark Rutland wrote: > > At least for sampling the GPRs, we could do something like below > unconditionally, which seems sufficient for my test cases. Ack. The PEBS case may need checking, but maybe PEBS doesn't even have this issue? Linus

RE: [PATCH v1 1/2] perf/core: Use sysctl to turn on/off dropping leaked kernel samples

2018-06-15 Thread Liang, Kan
> On Thu, Jun 14, 2018 at 11:02:53PM -0700, Stephane Eranian wrote: > > On Thu, Jun 14, 2018 at 7:10 PM Jin Yao wrote: > > > + /* > > > +* Due to interrupt latency (AKA "skid"), we may enter the > > > +* kernel before taking an overflow, even if the PMU is only > > > +

Re: [PATCH v1 1/2] perf/core: Use sysctl to turn on/off dropping leaked kernel samples

2018-06-15 Thread Mark Rutland
On Fri, Jun 15, 2018 at 06:03:22PM +0800, Jin Yao wrote: > When doing sampling, for example: > > perf record -e cycles:u ... > > On workloads that do a lot of kernel entry/exits we see kernel > samples, even though :u is specified. This is due to skid existing. > > This might be a security issue

Re: [PATCH v1 1/2] perf/core: Use sysctl to turn on/off dropping leaked kernel samples

2018-06-15 Thread Peter Zijlstra
On Thu, Jun 14, 2018 at 11:02:53PM -0700, Stephane Eranian wrote: > On Thu, Jun 14, 2018 at 7:10 PM Jin Yao wrote: > > + /* > > +* Due to interrupt latency (AKA "skid"), we may enter the > > +* kernel before taking an overflow, even if the PMU is only > > +* counting

Re: [PATCH v1 1/2] perf/core: Use sysctl to turn on/off dropping leaked kernel samples

2018-06-15 Thread Jin, Yao
On 6/15/2018 1:59 PM, Stephane Eranian wrote: On Thu, Jun 14, 2018 at 7:10 PM Jin Yao wrote: When doing sampling, for example: perf record -e cycles:u ... On workloads that do a lot of kernel entry/exits we see kernel samples, even though :u is specified. This is due to skid existing. Th

Re: [PATCH v1 1/2] perf/core: Use sysctl to turn on/off dropping leaked kernel samples

2018-06-14 Thread Stephane Eranian
On Thu, Jun 14, 2018 at 7:10 PM Jin Yao wrote: > > When doing sampling, for example: > > perf record -e cycles:u ... > > On workloads that do a lot of kernel entry/exits we see kernel > samples, even though :u is specified. This is due to skid existing. > > This might be a security issue because i

Re: [PATCH v1 1/2] perf/core: Use sysctl to turn on/off dropping leaked kernel samples

2018-06-14 Thread Stephane Eranian
On Thu, Jun 14, 2018 at 7:10 PM Jin Yao wrote: > > When doing sampling, for example: > > perf record -e cycles:u ... > > On workloads that do a lot of kernel entry/exits we see kernel > samples, even though :u is specified. This is due to skid existing. > > This might be a security issue because i