Re: [PATCH v2] gcov: use atomic counter updates to fix concurrent access crashes

From: Konstantin Khorenko

Date: Wed Apr 22 2026 - 17:26:36 EST


https://sashiko.dev/#/patchset/20260422125112.3583649-1-khorenko%40virtuozzo.com

> The kernel supports gcc versions down to 8.1.0, but the -fprofile-update=prefer-atomic compiler flag was introduced in gcc 11.


-fprofile-update=prefer-atomic has been available since GCC 7.1.0 (May 2017).

https://github.com/gcc-mirror/gcc/blob/releases/gcc-7.1.0/gcc/common.opt#L1981-L1995
<<<<<<<<<<<<<<<<<
EnumValue
Enum(profile_update) String(prefer-atomic) Value(PROFILE_UPDATE_PREFER_ATOMIC)
>>>>>>>>>>>>>>>>>

So any GCC that can build the current kernel accepts -fprofile-update=prefer-atomic.

--
Best regards,

Konstantin Khorenko,
Virtuozzo Linux Kernel Team