Re: [PATCH 4/4] ring-buffer: only allocate buffers for online cpus

From: Steven Rostedt
Date: Thu Mar 12 2009 - 09:29:42 EST



On Wed, 11 Mar 2009, Andrew Morton wrote:

> On Wed, 11 Mar 2009 22:37:24 -0400 Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:
>
> > From: Steven Rostedt <srostedt@xxxxxxxxxx>
> >
> > 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.
> >
> > ...
> >
> > +#ifdef CONFIG_HOTPLUG
> > +#ifdef CONFIG_HOTPLUG
> > +#ifdef CONFIG_HOTPLUG
> > +#ifdef CONFIG_HOTPLUG
> > +#ifdef CONFIG_HOTPLUG
>
> CONFIG_HOTPLUG_CPU

Oops, well I did have both in my config to 'y'.

Thanks, will fix.

-- Steve

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/