[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140702101852.GX6758@twins.programming.kicks-ass.net>
Date: Wed, 2 Jul 2014 12:18:52 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: "Yan, Zheng" <zheng.z.yan@...el.com>
Cc: linux-kernel@...r.kernel.org, mingo@...nel.org, acme@...radead.org,
eranian@...gle.com, andi@...stfloor.org
Subject: Re: [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..
Content of type "application/pgp-signature" skipped
Powered by blists - more mailing lists