[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250718000835.65qaxtwfgwborgls@master>
Date: Fri, 18 Jul 2025 00:08:35 +0000
From: Wei Yang <richard.weiyang@...il.com>
To: wang lian <lianux.mm@...il.com>
Cc: akpm@...ux-foundation.org, broonie@...nel.org, david@...hat.com,
lorenzo.stoakes@...cle.com, sj@...nel.org, ziy@...dia.com,
linux-mm@...ck.org, linux-kernel@...r.kernel.org,
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 Thu, Jul 17, 2025 at 09:18:56PM +0800, 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>
Reviewed-by: Wei Yang <richard.weiyang@...il.com>
--
Wei Yang
Help you, Help me
Powered by blists - more mailing lists