mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>, Ingo Molnar <mingo@redhat.com>,
	linux-kernel@vger.kernel.org, vince@deater.net,
	eranian@google.com, Arnaldo Carvalho de Melo <acme@infradead.org>,
	tglx@linutronix.de
Subject: Re: [RFC PATCH 1/6] perf: Move mlock accounting to ring buffer allocation
Date: Mon, 26 Sep 2016 11:03:54 +0200	[thread overview]
Message-ID: <20160926090354.GK5012@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <878tufrrqb.fsf@ashishki-desk.ger.corp.intel.com>

On Mon, Sep 26, 2016 at 11:27:08AM +0300, Alexander Shishkin wrote:
> Peter Zijlstra <peterz@infradead.org> writes:
> 
> > Well, we could 'force' inject a VMA into the process's address space, we
> > do that for a few other things as well. It also makes for less
> > exceptions with the actual core dumping.
> 
> Threads then will end up with the same buffer (through sharing the mm),
> but they can't really share trace buffers.
> 
> Also, system core dump is still a problem.

Hurm, true on both counts.

> > But the worry I have is the total amount of pinned memory. If you want
> > to inherit this on fork(), as is a reasonable expectation, then its
> > possible to quickly exceed the total amount of pinnable memory.
> >
> > At which point we _should_ start failing fork(), which is a somewhat
> > unexpected, and undesirable side-effect.
> 
> I'm not sure I see why we should fail fork() when we run out of pinned
> memory.

Well, we cannot fully honour the inherit, what other option do we have?
Silently malfunctioning? That's far worse.

> > Ideally we'd unpin the old buffers and repin the new buffers on context
> > switch, but that's impossible since faulting needs scheduling,
> > recursion, we loose.
> 
> Or we can have per-cpu buffers for all user's tasks, record where each
> task starts and ends in each buffer and cut out only bits relevant to
> the task(s) that dump core.

Which gets you the problem that when a task dumps core there might not
be any state in the buffer, because the previous task flushed it all out
:/

  reply	other threads:[~2016-09-26  9:04 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-23 11:27 [RFC PATCH 0/6] perf: Add AUX data sampling Alexander Shishkin
2016-09-23 11:27 ` [RFC PATCH 1/6] perf: Move mlock accounting to ring buffer allocation Alexander Shishkin
2016-09-23 12:14   ` Peter Zijlstra
2016-09-23 14:27     ` Alexander Shishkin
2016-09-23 15:27       ` Peter Zijlstra
2016-09-23 15:58         ` Alexander Shishkin
2016-09-23 17:26     ` Andi Kleen
2016-09-23 20:28       ` Peter Zijlstra
2016-09-26  8:27         ` Alexander Shishkin
2016-09-26  9:03           ` Peter Zijlstra [this message]
2016-09-26 12:39             ` Alexander Shishkin
2016-09-26 16:13             ` Alexander Shishkin
2016-09-23 11:27 ` [RFC PATCH 2/6] perf: Add api to (de-)allocate AUX buffers for kernel counters Alexander Shishkin
2016-09-23 11:27 ` [RFC PATCH 3/6] perf: Add a helper for looking up pmus by type Alexander Shishkin
2016-09-23 11:27 ` [RFC PATCH 4/6] perf: Add infrastructure for using AUX data in perf samples Alexander Shishkin
2016-09-23 11:27 ` [RFC PATCH 5/6] perf: Disable PMU around address filter adjustment Alexander Shishkin
2016-09-23 11:27 ` [RFC PATCH 6/6] perf: Disable IRQs in address filter sync path Alexander Shishkin
2016-09-26 16:18   ` Alexander Shishkin
2016-10-04 16:49     ` Mathieu Poirier
2016-09-23 11:49 ` [RFC PATCH 0/6] perf: Add AUX data sampling Peter Zijlstra
2016-09-23 17:19   ` Andi Kleen
2016-09-23 20:35     ` Peter Zijlstra
2016-09-23 22:34       ` Andi Kleen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160926090354.GK5012@twins.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=acme@infradead.org \
    --cc=ak@linux.intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=eranian@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=vince@deater.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome