[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <914ce985-f642-473e-a312-0a390ab5e78b@redhat.com>
Date: Wed, 16 Jul 2025 15:16:49 +0200
From: David Hildenbrand <david@...hat.com>
To: wang lian <lianux.mm@...il.com>, akpm@...ux-foundation.org,
broonie@...nel.org, lorenzo.stoakes@...cle.com, sj@...nel.org,
ziy@...dia.com, linux-mm@...ck.org, linux-kernel@...r.kernel.org
Cc: brauner@...nel.org, jannh@...gle.com, Liam.Howlett@...cle.com,
shuah@...nel.org, vbabka@...e.cz, ludovico.zy.wu@...il.com,
gkwang@...x-info.com, p1ucky0923@...il.com, ryncsn@...il.com,
zijing.zhang@...ton.me
Subject: Re: [PATCH] selftests/mm: reuse FORCE_READ to replace "asm
volatile("" : "+r" (XXX));"
On 16.07.25 14:31, wang lian wrote:
> Several mm selftests use the `asm volatile("" : "+r" (variable));`
> construct to force a read of a variable, preventing the compiler from
> optimizing away the memory access. This idiom is cryptic and duplicated
> across multiple test files.
>
> Following a suggestion from David[1], this patch refactors this
> common pattern into a FORCE_READ() macro
>
> [1] https://lore.kernel.org/lkml/4a3e0759-caa1-4cfa-bc3f-402593f1eee3@redhat.com/
>
> Signed-off-by: wang lian <lianux.mm@...il.com>
> Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@...cle.com>
Acked-by: David Hildenbrand <david@...hat.com>
--
Cheers,
David / dhildenb
Powered by blists - more mailing lists