Linux filesystem development
 help / color / mirror / Atom feed
From: Lennart Poettering <lennart@poettering.net>
To: Oleg Nesterov <oleg@redhat.com>
Cc: Christian Brauner <brauner@kernel.org>,
	linux-fsdevel@vger.kernel.org, Jeff Layton <jlayton@kernel.org>,
	Daan De Meyer <daan.j.demeyer@gmail.com>,
	Mike Yuan <me@yhndnzj.com>
Subject: Re: [PATCH RFC 06/10] pidfs: allow to retrieve exit information
Date: Mon, 3 Mar 2025 10:06:31 +0100	[thread overview]
Message-ID: <Z8VxF1N7G1XZOTQy@gardel-login> (raw)
In-Reply-To: <20250302202428.GG2664@redhat.com>

On So, 02.03.25 21:24, Oleg Nesterov (oleg@redhat.com) wrote:

> This will fix the problem with mt-exec, but this won't help to discriminate
> the leader-exit and the-whole-group-exit cases...
>
> With this this (or something like this) change pidfd_info() can only report
> the exit code of the already reaped thread/process, leader or not.
>
> I mean... If the leader L exits using sys_exit() and it has the live sub-
> threads, release_task(L) / __unhash_process(L) will be only called when
> the last sub-thread exits and it (or debugger) does "goto repeat;" in
> release_task() to finally reap the leader.
>
> IOW. If someone does sys_pidfd_create(group-leader-pid, PIDFD_THREAD),
> pidfd_info() won't report PIDFD_INFO_EXIT if the leader has exited using
> sys_exit() before other threads.
>
> But perhaps this is fine?

I think this is fine, but I'd really like a way how userspace can
determine this state reliably. i.e. a zombie state where the exit
status is not available yet is a bit strange by classic UNIX
standards on some level, no?

But I guess that might not be a pidfd specific issue. i.e. I figure
classic waitid() with WNOHANG failing on a zombie process that is set
up like that is a bit weird too, no? Or how does that work there?
(pretty sure some userspace might not be expecting that...)

Lennart

--
Lennart Poettering, Berlin

  reply	other threads:[~2025-03-03  9:12 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-28 12:44 [PATCH RFC 00/10] pidfs: provide information after task has been reaped Christian Brauner
2025-02-28 12:44 ` [PATCH RFC 01/10] pidfs: switch to copy_struct_to_user() Christian Brauner
2025-02-28 12:44 ` [PATCH RFC 02/10] pidfd: rely on automatic cleanup in __pidfd_prepare() Christian Brauner
2025-02-28 12:44 ` [PATCH RFC 03/10] pidfs: move setting flags into pidfs_alloc_file() Christian Brauner
2025-03-02 13:09   ` Oleg Nesterov
2025-03-02 15:59     ` Christian Brauner
2025-03-02 16:05       ` Oleg Nesterov
2025-03-02 16:29         ` Christian Brauner
2025-02-28 12:44 ` [PATCH RFC 04/10] pidfs: add inode allocation Christian Brauner
2025-02-28 12:44 ` [PATCH RFC 05/10] pidfs: record exit code and cgroupid at exit Christian Brauner
2025-03-02 15:19   ` Oleg Nesterov
2025-02-28 12:44 ` [PATCH RFC 06/10] pidfs: allow to retrieve exit information Christian Brauner
2025-03-02  2:40   ` Mike Yuan
2025-03-02 12:33     ` Christian Brauner
2025-03-02 15:53   ` Oleg Nesterov
2025-03-02 16:29     ` Christian Brauner
2025-03-02 17:21       ` Oleg Nesterov
2025-03-02 18:56         ` Christian Brauner
2025-03-02 20:24           ` Oleg Nesterov
2025-03-03  9:06             ` Lennart Poettering [this message]
2025-03-03 11:32               ` Christian Brauner
2025-02-28 12:44 ` [PATCH RFC 07/10] selftests/pidfd: fix header inclusion Christian Brauner
2025-02-28 12:44 ` [PATCH RFC 08/10] pidfs/selftests: ensure correct headers for ioctl handling Christian Brauner
2025-02-28 12:44 ` [PATCH RFC 09/10] selftests/pidfd: move more defines to common header Christian Brauner
2025-02-28 12:44 ` [PATCH RFC 10/10] selftests/pidfd: add PIDFD_INFO_EXIT tests Christian Brauner

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=Z8VxF1N7G1XZOTQy@gardel-login \
    --to=lennart@poettering.net \
    --cc=brauner@kernel.org \
    --cc=daan.j.demeyer@gmail.com \
    --cc=jlayton@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=me@yhndnzj.com \
    --cc=oleg@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