lkml.org 
[lkml]   [2014]   [Jul]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH V4 05/16] perf, core: pmu specific data for perf task context
On Mon, Jun 30, 2014 at 04:50:42PM +0800, Yan, Zheng wrote:

> @@ -3068,6 +3077,14 @@ alloc_perf_context(struct pmu *pmu, struct task_struct *task)
> if (!ctx)
> return NULL;
>
> + if (task && pmu->task_ctx_size > 0) {
> + ctx->task_ctx_data = kzalloc(pmu->task_ctx_size, GFP_KERNEL);
> + if (!ctx->task_ctx_data) {
> + kfree(ctx);
> + return NULL;
> + }
> + }

Can we delay this allocation until such time as that its actually
needed? Otherwise we're wasting all this memory..
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2014-07-02 12:41    [W:0.135 / U:24.520 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site