Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1668204 > unrolled thread

Re: [PATCH v3 4/7] x86: switch atomic.h to use atomic-instrumented.h

Started byDmitry Vyukov <dvyukov@google.com>
First post2017-06-17 11:20 +0200
Last post2017-06-17 11:20 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH v3 4/7] x86: switch atomic.h to use atomic-instrumented.h Dmitry Vyukov <dvyukov@google.com> - 2017-06-17 11:20 +0200

#1668204 — Re: [PATCH v3 4/7] x86: switch atomic.h to use atomic-instrumented.h

FromDmitry Vyukov <dvyukov@google.com>
Date2017-06-17 11:20 +0200
SubjectRe: [PATCH v3 4/7] x86: switch atomic.h to use atomic-instrumented.h
Message-ID<tTi3E-4Xc-7@gated-at.bofh.it>
On Fri, Jun 16, 2017 at 5:54 PM, Andrey Ryabinin
<aryabinin@virtuozzo.com> wrote:
> On 06/06/2017 01:11 PM, Dmitry Vyukov wrote:
>> Add arch_ prefix to all atomic operations and include
>> <asm-generic/atomic-instrumented.h>. This will allow
>> to add KASAN instrumentation to all atomic ops.
>>
>> Signed-off-by: Dmitry Vyukov <dvyukov@google.com>
>> Cc: Mark Rutland <mark.rutland@arm.com>
>> Cc: Peter Zijlstra <peterz@infradead.org>
>> Cc: Will Deacon <will.deacon@arm.com>
>> Cc: Andrew Morton <akpm@linux-foundation.org>
>> Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>
>> Cc: Ingo Molnar <mingo@redhat.com>
>> Cc: kasan-dev@googlegroups.com
>> Cc: linux-mm@kvack.org
>> Cc: linux-kernel@vger.kernel.org
>> Cc: x86@kernel.org
>>
>> ---
>
>
>
>
>> -static __always_inline void atomic_set(atomic_t *v, int i)
>> +static __always_inline void arch_atomic_set(atomic_t *v, int i)
>>  {
>> +     /*
>> +      * We could use WRITE_ONCE_NOCHECK() if it exists, similar to
>> +      * READ_ONCE_NOCHECK() in arch_atomic_read(). But there is no such
>> +      * thing at the moment, and introducing it for this case does not
>> +      * worth it.
>> +      */
>
>
> I'd rather remove this comment. I woudn't say that WRITE_ONCE() here looks confusing
> and needs comment. Also there is no READ_ONCE_NOCHECK() in arch_atomic_read() anymore.

Done.
It also should have gone to the patch that adds comments.


> Otherwise,
>         Reviewed-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
>
>>       WRITE_ONCE(v->counter, i);
>>  }

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web