Skip to content

Commit

Permalink
ring-buffer: only allocate buffers for online cpus
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Steven Rostedt <srostedt@redhat.com>
  • Loading branch information
Steven Rostedt committed Mar 12, 2009
1 parent 9aba60f commit 554f786
Show file tree
Hide file tree
Showing 2 changed files with 216 additions and 56 deletions.
Loading

0 comments on commit 554f786

Please sign in to comment.