linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [RFC] better visibility into kworkers
@ 2018-05-17  7:42 Alexey Dobriyan
  2018-05-17 15:50 ` Lennart Poettering
  0 siblings, 1 reply; 2+ messages in thread
From: Alexey Dobriyan @ 2018-05-17  7:42 UTC (permalink / raw)
  To: lennart; +Cc: tj, torvalds, carlos, luto, akpm, linux-kernel

> 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.

Empty /proc/*/exe is second best option for systemd and it's only one
system call.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [RFC] better visibility into kworkers
  2018-05-17  7:42 [RFC] better visibility into kworkers Alexey Dobriyan
@ 2018-05-17 15:50 ` Lennart Poettering
  0 siblings, 0 replies; 2+ messages in thread
From: Lennart Poettering @ 2018-05-17 15:50 UTC (permalink / raw)
  To: Alexey Dobriyan; +Cc: tj, torvalds, carlos, luto, akpm, linux-kernel

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-05-17 15:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-17  7:42 [RFC] better visibility into kworkers Alexey Dobriyan
2018-05-17 15:50 ` Lennart Poettering

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).