From: Lennart Poettering <mzxreary@0pointer.de>
To: Alexey Dobriyan <adobriyan@gmail.com>
Cc: tj@kernel.org, torvalds@linux-foundation.org, carlos@redha.com,
luto@amacapital.net, akpm@linux-foundation.org,
linux-kernel@vger.kernel.org
Subject: Re: [RFC] better visibility into kworkers
Date: Thu, 17 May 2018 17:50:21 +0200 [thread overview]
Message-ID: <20180517155021.GA5480@gardel-login> (raw)
In-Reply-To: <20180517074202.GA3091@avx2>
On Do, 17.05.18 10:42, Alexey Dobriyan (adobriyan@gmail.com) wrote:
> > The kernel APIs for all this aren't really good
> > though, and I always was reluctant to check for PF_KTHREAD, as that
> > flag is neither documented for userspace, nor available in any
> > userspace-accessible headers. However, I wanted to tighten this a bit,
> > and hence we now define the flag in our own code, as it appeared to me
> > otherwise there was no chance to ever make this fully robust.
>
> PF_KTHREAD was introduced in 2.6.27 and its value appears to be stable
> since then. I think it should be retroactively declared part of ABI
> otherwise people will continue to rediscover that all other means do not
> work.
Yes, I agree. And it's exposed to userspace after all, though not
symbolic, but simply as flags value.
> Empty /proc/*/exe is second best option for systemd and it's only one
> system call.
That doesn't really work for us as readlink() on that requires
CAP_SYS_PTRACE, and we need something that works unprivileged, which
PF_KTHREAD does.
Lennart
--
Lennart Poettering, Red Hat
prev parent reply other threads:[~2018-05-17 15:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-17 7:42 [RFC] better visibility into kworkers Alexey Dobriyan
2018-05-17 15:50 ` Lennart Poettering [this message]
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=20180517155021.GA5480@gardel-login \
--to=mzxreary@0pointer.de \
--cc=adobriyan@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=carlos@redha.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=tj@kernel.org \
--cc=torvalds@linux-foundation.org \
/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;
as well as URLs for NNTP newsgroup(s).