public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* x86, perf, pmu: make reserve_ds_buffers() allocate memory dynamically
@ 2011-06-24 16:01 Don Zickus
  2011-06-28 10:38 ` Peter Zijlstra
  0 siblings, 1 reply; 2+ messages in thread
From: Don Zickus @ 2011-06-24 16:01 UTC (permalink / raw)
  To: peterz, eranian, fweisbec; +Cc: linux-kernel

Hi guys,

Some kdump folks noticed that on large machines (say 80 cpu threads), the
kernel reserved a good chunk of memory in the kdump kernel with the call
to reserve_ds_buffers(). About 64k per cpu.

Normally the kdump kernel boots with maxcpus=1 to limit the amount of
processing and memory usage it needs.  However, with reserve_ds_buffers()
it seems to allocate a giant chunk of memory due to its use of
for_each_possible_cpu().

I was wondering if it was possible to move some of that allocation to the
cpu_prepare/cpu_starting routines and allocate during a cpu hotplug event.
I am not sure if some of this allocation is on a per cpu basis (which
includes multiple cores) or if there is some sort of other restriction
that required the code to be statically allocated at boot time.

Thanks,
Don


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: x86, perf, pmu: make reserve_ds_buffers() allocate memory dynamically
  2011-06-24 16:01 x86, perf, pmu: make reserve_ds_buffers() allocate memory dynamically Don Zickus
@ 2011-06-28 10:38 ` Peter Zijlstra
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Zijlstra @ 2011-06-28 10:38 UTC (permalink / raw)
  To: Don Zickus; +Cc: eranian, fweisbec, linux-kernel

On Fri, 2011-06-24 at 12:01 -0400, Don Zickus wrote:
> Hi guys,
> 
> Some kdump folks noticed that on large machines (say 80 cpu threads), the
> kernel reserved a good chunk of memory in the kdump kernel with the call
> to reserve_ds_buffers(). About 64k per cpu.
> 
> Normally the kdump kernel boots with maxcpus=1 to limit the amount of
> processing and memory usage it needs.  However, with reserve_ds_buffers()
> it seems to allocate a giant chunk of memory due to its use of
> for_each_possible_cpu().
> 
> I was wondering if it was possible to move some of that allocation to the
> cpu_prepare/cpu_starting routines and allocate during a cpu hotplug event.
> I am not sure if some of this allocation is on a per cpu basis (which
> includes multiple cores) or if there is some sort of other restriction
> that required the code to be statically allocated at boot time.

The only complication I can remember is that the BTS buffers are an
order 4 allocation, so the later you allocate them the less likely they
are to be available.

Other than that there isn't anything magical about any of it.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-06-28 10:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-24 16:01 x86, perf, pmu: make reserve_ds_buffers() allocate memory dynamically Don Zickus
2011-06-28 10:38 ` Peter Zijlstra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox