[LTP] [PATCH v3] userfaultfd: Add test using UFFDIO_POISON

Cyril Hrubis chrubis@suse.cz
Thu Feb 19 16:52:41 CET 2026


Hi!
> >> WARNING: Use of volatile is usually wrong: see Documentation/process/volatile-considered-harmful.rst
> >> #88: FILE: userfaultfd06.c:88:
> >> +       volatile char dummy;
> > I do not think that volatile is needed here.
> 
> This is needed.  Without it, the test hangs.

I suppose that the compiler optimizes out the read because we are not
using the value. We do have a maybe a bit more descriptive macro for
these cases called LTP_VAR_USED().

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list