OSDN Git Service

tracing/osnoise: Switch from PF_NO_SETAFFINITY to migrate_disable
authorDaniel Bristot de Oliveira <bristot@kernel.org>
Tue, 6 Jun 2023 15:12:25 +0000 (17:12 +0200)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Thu, 22 Jun 2023 14:39:56 +0000 (10:39 -0400)
commit4998e7fda149d2392ea6aa9879299d8a32019dbe
treec6a55588affdb423c644e6c109bf481ffd5e4852
parent83f74441bcb16c324b7bdba0ab4261a44cb1ac21
tracing/osnoise: Switch from PF_NO_SETAFFINITY to migrate_disable

Currently, osnoise/timerlat threads run with PF_NO_SETAFFINITY set.
It works well, however, cgroups do not allow PF_NO_SETAFFINITY threads
to be accepted, and this creates a limitation to osnoise/timerlat.

To avoid this limitation, disable migration of the threads as soon
as they start to run, and then clean the PF_NO_SETAFFINITY flag (still)
used during thread creation.

If for some reason a thread migration is requested, e.g., via
sched_settafinity, the tracer thread will notice and exit.

Link: https://lkml.kernel.org/r/8ba8bc9c15b3ea40cf73cf67a9bc061a264609f0.1686063934.git.bristot@kernel.org
Cc: Juri Lelli <juri.lelli@redhat.com>
Cc: William White <chwhite@redhat.com>
Cc: Daniel Bristot de Oliveira <bristot@kernel.org>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Daniel Bristot de Oliveira <bristot@kernel.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
kernel/trace/trace_osnoise.c