All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: linux-kernel@vger.kernel.org, Ingo Molnar <mingo@elte.hu>,
	Andrew Morton <akpm@linux-foundation.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Wu Fengguang <fengguang.wu@intel.com>,
	Pierre Ossman <drzeus@drzeus.cx>, Pekka Paalanen <pq@iki.fi>,
	Steven Rostedt <srostedt@redhat.com>
Subject: Re: [PATCH 4/4] ring-buffer: only allocate buffers for online cpus
Date: Thu, 12 Mar 2009 09:38:39 -0400 (EDT)	[thread overview]
Message-ID: <alpine.DEB.2.00.0903120933400.3062@gandalf.stny.rr.com> (raw)
In-Reply-To: <20090312162722.43B1.A69D9226@jp.fujitsu.com>


On Thu, 12 Mar 2009, KOSAKI Motohiro wrote:

> > From: Steven Rostedt <srostedt@redhat.com>
> > 
> > Impact: save on memory
> > 
> > Currently, a ring buffer was allocated for each "possible_cpus". On
> > some systems, this is the same as NR_CPUS. Thus, if a system defined
> > NR_CPUS = 64 but it only had 1 CPU, we could have possibly 63 useless
> > ring buffers taking up space. With a default buffer of 3 megs, this
> > could be quite drastic.
> > 
> > This patch changes the ring buffer code to only allocate ring buffers
> > for online CPUs.  If a CPU goes off line, we do not free the buffer.
> > This is because the user may still have trace data in that buffer
> > that they would like to look at.
> > 
> > Perhaps in the future we could add code to delete a ring buffer if
> > the CPU is offline and the ring buffer becomes empty.
> 
> I don't like this patch.
> your [1/4] and [2/4] already solve Pierre's problem.
> 
> using online cpu (not possible cpu) increase performance overhead 
> and messiness.
> but nobody get benefit ;)

Well, the fact that you can have 15 buffers for non existent CPUs is a big 
benefit. And the overhead was only on the read side, not the write, and 
very limited in overhead for that matter.

But, looking at this, I realized I can get rid of all the 
"get_online_cpus". I originally had the CPU_DOWN_PREPARE remove the 
buffer. But I found it highly annoying during tests, that I lose my data 
when I brought down a CPU. Thus, I removed the code to free the buffer and 
replaced it with the comment explaining this.

The get_online_cpus is to prevent the race where we might remove a buffer. 
But since we do not do that anymore, those get_online_cpus are pretty 
useless.

I'll update the code in a bit.

-- Steve


  reply	other threads:[~2009-03-12 13:38 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-12  2:37 [PATCH 0/4] [GIT PULL] memory saving ring buffer for tip/tracing/ftrace Steven Rostedt
2009-03-12  2:37 ` [PATCH 1/4] tracing: keep ring buffer to minimum size till used Steven Rostedt
2009-03-12  3:26   ` Andrew Morton
2009-03-12 13:25     ` Steven Rostedt
2009-03-12 15:01   ` Frederic Weisbecker
2009-03-12 15:14     ` Steven Rostedt
2009-03-12  2:37 ` [PATCH 2/4] tracing: expand the ring buffers when an event is activated Steven Rostedt
2009-03-12  2:37 ` [PATCH 3/4] tracing: fix trace_wait to know to wait on all cpus or just one Steven Rostedt
2009-03-12  2:37 ` [PATCH 4/4] ring-buffer: only allocate buffers for online cpus Steven Rostedt
2009-03-12  3:32   ` Andrew Morton
2009-03-12 13:29     ` Steven Rostedt
2009-03-12  7:31   ` KOSAKI Motohiro
2009-03-12 13:38     ` Steven Rostedt [this message]
2009-03-12 23:47       ` KOSAKI Motohiro
2009-03-12  7:07 ` [PATCH 0/4] [GIT PULL] memory saving ring buffer for tip/tracing/ftrace Pierre Ossman
2009-03-12  7:34   ` KOSAKI Motohiro
2009-03-12  9:20     ` Pierre Ossman
2009-03-12 13:39       ` Steven Rostedt
2009-03-12 10:47   ` Neil Horman
2009-03-12 12:12     ` Pierre Ossman
2009-03-12 13:12       ` Neil Horman

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=alpine.DEB.2.00.0903120933400.3062@gandalf.stny.rr.com \
    --to=rostedt@goodmis.org \
    --cc=akpm@linux-foundation.org \
    --cc=drzeus@drzeus.cx \
    --cc=fengguang.wu@intel.com \
    --cc=fweisbec@gmail.com \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=pq@iki.fi \
    --cc=srostedt@redhat.com \
    /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.