lkml.org 
[lkml]   [2009]   [May]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v4] perf_counter: Fix race in attaching counters to tasks and exiting
Peter Zijlstra writes:

> The poor task will now have to wait for yet another RCU grace period,
> but yeah :-)

I moved the put_task_struct into put_ctx, inside the if, so the poor
task won't get impatient. :)

> Looks good, although lockdep will complain, the proper annotation would
> be spin_lock_nested_lock(&ctx->lock, &rq->lock), but since we don't have
> access to the rq here, we should change the second spin_lock, to:
>
> spin_lock_nested(&next_ctx->lock, SINGLE_DEPTH_NESTING);

Ah OK, thanks.

> You jump into an rcu_read_lock() section there.

Oops. I'll fix that. I also need to use spin_[un]lock_irq in there.
New version coming. Thanks for the review.

Paul.


\
 
 \ /
  Last update: 2009-05-28 14:21    [W:0.042 / U:0.940 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site