[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250126190356.GC28135@redhat.com>
Date: Sun, 26 Jan 2025 20:03:56 +0100
From: Oleg Nesterov <oleg@...hat.com>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Paolo Bonzini <pbonzini@...hat.com>,
"Michael S. Tsirkin" <mst@...hat.com>,
Christian Brauner <brauner@...nel.org>,
"Eric W. Biederman" <ebiederm@...ssion.com>,
linux-kernel@...r.kernel.org, kvm@...r.kernel.org
Subject: Re: [GIT PULL] KVM changes for Linux 6.14
On 01/26, Oleg Nesterov wrote:
>
> On 01/26, Linus Torvalds wrote:
> >
> > I was literally thinking that instead of a "hidden" flag, it would be
> > a "self-hidden" flag.
> >
> > So if somebody _else_ (notably the sysadmin) does "ps" they see the
> > kernel thread as a subthread.
> >
> > But when you look at your own /proc/self/task/ listing, you only see
> > your own explicit threads. So that "is_singlethreaded()" logic works.
>
> Got it...
>
> I don't think we even need to detect the /proc/self/ or /proc/self-thread/
> case, next_tid() can just check same_thread_group,
>
> - if (!(pos->flags & PF_HIDDEN)) {
> + if (!(pos->flags & PF_HIDDEN) || !same_thread_group(current, pos))) {
>
> right ?
Or we can exclude them from /proc/whatever/task/ listing unconditionally,
and change next_tgid() to report them as if there are not sub-threads, iow
"ps ax" will show all the PF_HIDDEN tasks... I dunno.
Oleg.
Powered by blists - more mailing lists