public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: linuxtestproject.agent@gmail.com
To: Martin Cermak <mcermak@redhat.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] Make userfaultfd0{1, 3, 4} LTP tests valgrind compatible
Date: Tue, 21 Apr 2026 17:06:46 +0000	[thread overview]
Message-ID: <20260421170646.3943-1-linuxtestproject.agent@gmail.com> (raw)
In-Reply-To: <20260421152349.1673057-1-mcermak@redhat.com>

Hi Martin,

On Tue, 21 Apr 2026, Martin Cermak wrote:
> Make userfaultfd0{1, 3, 4} LTP tests valgrind compatible

The commit message is missing a Signed-off-by: tag.

> -static void *handle_thread(void)
> +static void *pagefault_handler(void)

Since this is no longer a thread entry point, change the return type to
void and drop the return NULL.

> /*\
>  * Force a pagefault event and handle it using :manpage:`userfaultfd(2)`
>  * from a different thread.
>  */

The handler now runs in a forked child, not a thread. Update the doc
comment in all three files.

[...]

> +	pid = SAFE_FORK();
> +		if (pid == 0) {
> +		pagefault_handler();

userfaultfd03.c: extra leading tab on the `if` line.

[...]

> +	SAFE_WAITPID(pid, NULL, 0);
>  	reset_pages();

In the original code the thread closed uffd for the whole process (threads
share the fd table). With fork, the child closes only its own copy; the
parent's uffd is never closed. Add SAFE_CLOSE(uffd) before reset_pages()
in all three tests.

Also, tst_safe_pthread.h is no longer used in userfaultfd03.c and
userfaultfd04.c after this change; remove the include.

---
Note:

Our agent completed the review of the patch.

The agent can sometimes produce false positives although often its
findings are genuine. If you find issues with the review, please
comment this email or ignore the suggestions.

Regards,
LTP AI Reviewer

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2026-04-21 17:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-21 15:23 [LTP] [PATCH] Make userfaultfd0{1, 3, 4} LTP tests valgrind compatible Martin Cermak via ltp
2026-04-21 17:06 ` linuxtestproject.agent [this message]
2026-04-22  5:37 ` [LTP] [Valgrind-developers] " Petr Vorel
2026-04-22  7:54   ` Ricardo Branco
2026-04-22 12:17     ` Petr Vorel
2026-04-22 12:42       ` Ricardo Branco
2026-04-22 13:08       ` Martin Cermak via ltp

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260421170646.3943-1-linuxtestproject.agent@gmail.com \
    --to=linuxtestproject.agent@gmail.com \
    --cc=ltp@lists.linux.it \
    --cc=mcermak@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox