Re: [PATCH] seqlock: fix raw_read_seqcount_latch()
From: Tejun Heo
Date: Wed May 25 2016 - 15:57:53 EST
Hello,
On Mon, May 23, 2016 at 11:36:18AM +0200, Peter Zijlstra wrote:
> > include/linux/percpu-refcount.h:146:36: warning: initialization makes pointer from integer without a cast [-Wint-conversion]
> > percpu_ptr = lockless_dereference(ref->percpu_count_ptr);
>
> TJ; would you prefer casting or not using lockless_dereference() here?
Casting is nasty - *(unsigned long __percpu **)& - because the macro
expects an lvalue. I think it'd be better to revert to opencoding
READ_ONCE() and barrier there. It's a pretty special case anyway.
Thanks.
--
tejun