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

Cyril Hrubis chrubis@suse.cz
Wed Feb 18 11:49:01 CET 2026


Hi!
> +static void *handle_thread(void)
> +{
> +	static struct uffd_msg msg;
> +	struct uffdio_poison uffdio_poison = {};
> +	struct pollfd pollfd;
> +	int nready;
> +
> +	SAFE_PTHREAD_BARRIER_WAIT(&barrier);

I still do not understand why we need the barrier here. The thread that
tries to access the memory should block until this thread processes the
event sicne the usefaultfd range was registered before the memory is
accessed. 

Also the same pattern is present in rest of the usefaultfd tests, so
either we need this barrier in all of them, or it shouldn't be needed
here.

And the test seems to work just fine if I remove the barrier code.

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list