From: Ingo Molnar <mingo@elte.hu>
To: Stephane Eranian <eranian@google.com>
Cc: linux-kernel@vger.kernel.org, peterz@infradead.org,
perfmon2-devel@lists.sf.net, paulus@samba.org,
davem@davemloft.net
Subject: Re: [PATCH] perf_events: fix cgrp stale pointer in update_cgrp_time_from_cpuctx()
Date: Wed, 23 Mar 2011 12:36:01 +0100 [thread overview]
Message-ID: <20110323113601.GA27809@elte.hu> (raw)
In-Reply-To: <20110321151126.GA5084@quad>
* Stephane Eranian <eranian@google.com> wrote:
> - if (is_cgroup_event(event))
> + if (is_cgroup_event(event)) {
> ctx->nr_cgroups--;
> + cpuctx = __get_cpu_context(ctx);
> + /*
> + * if there are no more cgroup events
> + * then clear cgrp to avoid stale pointer
> + * in update_cgrp_time_from_cpuctx()
> + */
> + if (!ctx->nr_cgroups)
> + cpuctx->cgrp = NULL;
> + }
The ->cgrp pointer does not exist on !CGROUPS kernels. I suspect the cleanest
approach would be to make those two cgrp fields available unconditionally in
struct perf_event.
Thanks,
Ingo
next prev parent reply other threads:[~2011-03-23 11:36 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-21 15:11 [PATCH] perf_events: fix cgrp stale pointer in update_cgrp_time_from_cpuctx() Stephane Eranian
2011-03-23 11:36 ` Ingo Molnar [this message]
2011-03-23 12:47 ` Stephane Eranian
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110323113601.GA27809@elte.hu \
--to=mingo@elte.hu \
--cc=davem@davemloft.net \
--cc=eranian@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=paulus@samba.org \
--cc=perfmon2-devel@lists.sf.net \
--cc=peterz@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.