[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <42db9f05-11cc-453b-8259-39cee70f137d@redhat.com>
Date: Thu, 17 Jul 2025 16:49:19 +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, gkwang@...x-info.com, jannh@...gle.com,
Liam.Howlett@...cle.com, ludovico.zy.wu@...il.com, p1ucky0923@...il.com,
richard.weiyang@...il.com, ryncsn@...il.com, shuah@...nel.org,
vbabka@...e.cz, zijing.zhang@...ton.me
Subject: Re: [PATCH 1/2] selftests/mm: reuse FORCE_READ to replace "asm
volatile("" : "+r" (XXX));"
On 17.07.25 15:18, 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