Re: [PATCH 1/2] perf: Add closing sibling events' file descriptors

2020-08-11 Thread Andi Kleen
On Tue, Aug 11, 2020 at 07:21:13PM +0300, Alexander Shishkin wrote: > Andi Kleen writes: > > > On Tue, Aug 11, 2020 at 12:47:24PM +0300, Alexander Shishkin wrote: > >> > >> Right, but which bytes? One byte per event? That's > >> arbitrary. sizeof(struct perf_event)? Then, probably also sizeof(st

RE: [PATCH 1/2] perf: Add closing sibling events' file descriptors

2020-08-11 Thread David Laight
> On Tue, Aug 11, 2020 at 02:47:03PM +, David Laight wrote: > > From: Andi Kleen > > > On Mon, Aug 10, 2020 at 10:36:32PM +0200, Peter Zijlstra wrote: > > > > On Mon, Aug 10, 2020 at 07:45:18AM -0700, Andi Kleen wrote: > > > > > > > > > Unfortunately we're kind of stuck with the old NFILE=1024

Re: [PATCH 1/2] perf: Add closing sibling events' file descriptors

2020-08-11 Thread Andi Kleen
On Tue, Aug 11, 2020 at 02:47:03PM +, David Laight wrote: > From: Andi Kleen > > On Mon, Aug 10, 2020 at 10:36:32PM +0200, Peter Zijlstra wrote: > > > On Mon, Aug 10, 2020 at 07:45:18AM -0700, Andi Kleen wrote: > > > > > > > Unfortunately we're kind of stuck with the old NFILE=1024 default > >

Re: [PATCH 1/2] perf: Add closing sibling events' file descriptors

2020-08-11 Thread Alexander Shishkin
Andi Kleen writes: > On Tue, Aug 11, 2020 at 12:47:24PM +0300, Alexander Shishkin wrote: >> >> Right, but which bytes? One byte per event? That's >> arbitrary. sizeof(struct perf_event)? Then, probably also sizeof(struct >> perf_event_context). > > Yes the sum of all the sizeofs needed for a per

RE: [PATCH 1/2] perf: Add closing sibling events' file descriptors

2020-08-11 Thread David Laight
From: Andi Kleen > On Mon, Aug 10, 2020 at 10:36:32PM +0200, Peter Zijlstra wrote: > > On Mon, Aug 10, 2020 at 07:45:18AM -0700, Andi Kleen wrote: > > > > > Unfortunately we're kind of stuck with the old NFILE=1024 default > > > even though it makes little sense on modern servers. > > > > Why can't

Re: [PATCH 1/2] perf: Add closing sibling events' file descriptors

2020-08-11 Thread Andi Kleen
On Mon, Aug 10, 2020 at 10:36:32PM +0200, Peter Zijlstra wrote: > On Mon, Aug 10, 2020 at 07:45:18AM -0700, Andi Kleen wrote: > > > Unfortunately we're kind of stuck with the old NFILE=1024 default > > even though it makes little sense on modern servers. > > Why can't that be changed? It seems to

Re: [PATCH 1/2] perf: Add closing sibling events' file descriptors

2020-08-11 Thread Andi Kleen
On Tue, Aug 11, 2020 at 12:47:24PM +0300, Alexander Shishkin wrote: > Andi Kleen writes: > > >> It didn't. I can't figure out what to charge on the locked memory, as > >> all that memory is in kernel-side objects. It also needs to make sense > > > > I don't see how that makes a difference for the

Re: [PATCH 1/2] perf: Add closing sibling events' file descriptors

2020-08-11 Thread Alexander Shishkin
Andi Kleen writes: >> It didn't. I can't figure out what to charge on the locked memory, as >> all that memory is in kernel-side objects. It also needs to make sense > > I don't see how that makes a difference for the count. It just account > bytes. Can you elaborate? Right, but which bytes? One

Re: [PATCH 1/2] perf: Add closing sibling events' file descriptors

2020-08-11 Thread Alexey Budankov
On 10.08.2020 23:36, Peter Zijlstra wrote: > On Mon, Aug 10, 2020 at 07:45:18AM -0700, Andi Kleen wrote: > >> Unfortunately we're kind of stuck with the old NFILE=1024 default >> even though it makes little sense on modern servers. > > Why can't that be changed? It seems to me all of userspace

Re: [PATCH 1/2] perf: Add closing sibling events' file descriptors

2020-08-10 Thread Peter Zijlstra
On Mon, Aug 10, 2020 at 07:45:18AM -0700, Andi Kleen wrote: > Unfortunately we're kind of stuck with the old NFILE=1024 default > even though it makes little sense on modern servers. Why can't that be changed? It seems to me all of userspace changes all the time; heck that system-doofus thing flu

Re: [PATCH 1/2] perf: Add closing sibling events' file descriptors

2020-08-10 Thread Andi Kleen
> It didn't. I can't figure out what to charge on the locked memory, as > all that memory is in kernel-side objects. It also needs to make sense I don't see how that makes a difference for the count. It just account bytes. Can you elaborate? > as iirc the default MLOCK_LIMIT is quite low, you'd h

Re: [PATCH 1/2] perf: Add closing sibling events' file descriptors

2020-08-10 Thread Alexander Shishkin
Andi Kleen writes: >> > This adds an opt-in flag to the perf_event_open() syscall to retain >> > sibling events after their file descriptors are closed. In this case, the >> > actual events will be closed with the group leader. >> >> So having the 1:1 relation with filedesc imposes a resource li

Re: [PATCH 1/2] perf: Add closing sibling events' file descriptors

2020-08-06 Thread Andi Kleen
> > This adds an opt-in flag to the perf_event_open() syscall to retain > > sibling events after their file descriptors are closed. In this case, the > > actual events will be closed with the group leader. > > So having the 1:1 relation with filedesc imposes a resource limit on > userspace. > > T

Re: [PATCH 1/2] perf: Add closing sibling events' file descriptors

2020-08-06 Thread peterz
On Wed, Jul 08, 2020 at 06:16:34PM +0300, Alexander Shishkin wrote: > Currently, perf requires one file descriptor per event. In large groups, > this may mean running into the limit on open file descriptors. However, > the sibling events in a group only need file descriptors for the initial > confi

[PATCH 1/2] perf: Add closing sibling events' file descriptors

2020-07-08 Thread Alexander Shishkin
Currently, perf requires one file descriptor per event. In large groups, this may mean running into the limit on open file descriptors. However, the sibling events in a group only need file descriptors for the initial configuration stage, after which they may not be needed any more. This adds an o