All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: linux-kernel@vger.kernel.org, Ingo Molnar <mingo@elte.hu>,
	Andrew Morton <akpm@linux-foundation.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Frederic Weisbecker <fweisbec@gmail.com>
Subject: Re: [PATCH 0/3][RFC] trace_printk() using percpu buffers
Date: Mon, 10 Oct 2011 13:04:57 +0200	[thread overview]
Message-ID: <1318244697.14400.18.camel@laptop> (raw)
In-Reply-To: <20111008170227.792806635@goodmis.org>

On Sat, 2011-10-08 at 13:02 -0400, Steven Rostedt wrote:
> 
> Peter,
> 
> You had issues with the previous version of my trace_printk() code.
> I rewrote it to do the following.
> 
> By default, it still uses the single buffer protected by a spinlock
> and an atomic (for NMIs). The NMI case can cause dropped prints if
> the NMI happens while a trace_printk() is processing.

Why bother keeping that?

> When trace_printk_percpu is enabled, either via the trace options or
> the kernel command line, then two sets of percpu buffers are made,
> one for normal and irqs (interrupts are still disabled), and the other
> is for NMIs. These can be added or removed at anytime.

So why not allocate 4, one for {task, softirq, irq, NMI} resp, then all
you need to do is disable preemption.

depending on tracing/options/trace_printk ?

> The last patch adds a CONFIG_TRACE_PRINTK_PERCPU that makes trace_printk()
> permanently use two sets of per_cpu buffers, and these can not be
> removed. This will give the least amount of overhead for trace_printk()
> with the sacrifice of memory overhead. This is an option I could imagine
> you would just set and forget about.

Is that one dereference really that expensive?


  parent reply	other threads:[~2011-10-10 10:59 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-08 17:02 [PATCH 0/3][RFC] trace_printk() using percpu buffers Steven Rostedt
2011-10-08 17:02 ` [PATCH 1/3][RFC] tracing: Do not allocate buffer for trace_marker Steven Rostedt
2011-10-08 17:02 ` [PATCH 2/3][RFC] tracing: Add optional percpu buffers for trace_printk() Steven Rostedt
2011-10-10 11:08   ` Peter Zijlstra
2011-10-10 12:37     ` Steven Rostedt
2011-10-10 13:04       ` Peter Zijlstra
2011-10-10 13:17         ` Steven Rostedt
2011-10-08 17:02 ` [PATCH 3/3][RFC] tracing: Add config to permanently have trace_printk() use percpu Steven Rostedt
2011-10-10 11:04 ` Peter Zijlstra [this message]
2011-10-10 12:31   ` [PATCH 0/3][RFC] trace_printk() using percpu buffers Steven Rostedt
2011-10-10 13:03     ` Peter Zijlstra
2011-10-10 13:06       ` Steven Rostedt

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=1318244697.14400.18.camel@laptop \
    --to=peterz@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.