lkml.org 
[lkml]   [2009]   [May]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH RFC] perf_counter: Don't swap contexts containing locked mutex
From
Date
On Fri, 2009-05-29 at 10:06 +0200, Peter Zijlstra wrote:
> > @@ -919,7 +919,8 @@ static int context_equiv(struct perf_counter_context *ctx1,
> > struct perf_counter_context *ctx2)
> > {
> > return ctx1->parent_ctx && ctx1->parent_ctx == ctx2->parent_ctx
> > - && ctx1->parent_gen == ctx2->parent_gen;
> > + && ctx1->parent_gen == ctx2->parent_gen
> > + && ctx1->parent_gen != ~0ull;
> > }
>
> There's a nasty surprise for people a few generations down the line. All
> of a sudden performance drops for a while for some unknown reason, and
> then its good again,.. how odd ;-)

OK, so I was joking, but my brain just came up with:

static void inc_generation(struct perf_counter_ctx *ctx)
{
ctx->generation = ++ctx->generation & 0x7FFFFFFFFFFFFFFF;
}




\
 
 \ /
  Last update: 2009-05-29 10:13    [W:0.074 / U:2.880 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site