lkml.org 
[lkml]   [2014]   [Feb]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH 3/7] perf: kill perf_event_context_type
On Mon, Feb 10, 2014 at 05:44:20PM +0000, Mark Rutland wrote:
> Currently perf_event_context::type is used to determine whether a
> context is cpu-bound or task-bound. However perf_event_context::task can
> be used to determine this just as cheaply, and requires no additional
> initialisation.
>
> This patch removes perf_event_context::type, and modifies existing users
> to check check perf_event_context::task instead. The now unused enum
> perf_event_context_type is removed.

> @@ -7130,7 +7129,7 @@ SYSCALL_DEFINE5(perf_event_open,
> * task or CPU context:
> */
> if (move_group) {
> - if (group_leader->ctx->type != ctx->type)
> + if (group_leader->ctx->task != ctx->task)
> goto err_context;
> } else {
> if (group_leader->ctx != ctx)

That's not an equivalent statement. ctx->task (t1) != ctx->task (t2)
while they're still both of the same type.

Now I don't think you'll ever end up with different tasks in this case
so it might still work out; but you don't mention this and I'd have to
like think to make sure.


\
 
 \ /
  Last update: 2014-02-25 13:41    [W:0.027 / U:0.884 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site