Re: [PATCH 2/9] perf_counter: fix update_userpage()

From: Peter Zijlstra
Date: Thu Apr 02 2009 - 05:28:20 EST


On Thu, 2009-04-02 at 20:21 +1100, Paul Mackerras wrote:
> Peter Zijlstra writes:
>
> > The below might work:
> >
> > u32 seq;
> > s64 count;
> >
> > again:
> > seq = pc->lock;
> >
> > if (unlikely(seq & 1)) {
>
> I don't believe we can ever see this condition, since pc->lock is
> updated in the kernel either at interrupt level on the cpu this task
> is running on, or in the kernel in the context of this task. So this
> userspace code can never run in the middle of the kernel updating
> things.

Colour me paranoid ;-)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/