0

How can I go about finding the PID or other information about a process that is doing the work of another process? I'm talking about kworker threads, for example, or any other threads/processes that are doing work within the kernel for another process.

My dilemma is that I have a real-time scheduled process (SCHED_FIFO) running at sched prio 99, with CPU affinity bound to CPU 0, but when I inject CPU stress onto my machine, I notice that my important rt process is not able to preempt the other, non-important processes. I'm thinking this may be because the kworkers that do work for this important process do not inherit the priority that the main process has, even though I specify the -a option in taskset and chrt. My current idea is to manually taskset and chrt the kworker threads so they don't get preempted by other, non-rt processes.

2 Answers 2

0

You can get a tree of all the tasks started by a process if you know the PID of the starting process using ps.

$ ps f -g2305957
    PID TTY      STAT   TIME COMMAND
2305957 pts/20   Ss     0:00 bash
2310399 pts/20   S+     0:00  \_ stress -t 300 -c 16
2310400 pts/20   R+     0:24      \_ stress -t 300 -c 16
2310401 pts/20   R+     0:24      \_ stress -t 300 -c 16
2310402 pts/20   R+     0:24      \_ stress -t 300 -c 16
2310403 pts/20   R+     0:24      \_ stress -t 300 -c 16
2310404 pts/20   R+     0:24      \_ stress -t 300 -c 16
2310405 pts/20   R+     0:24      \_ stress -t 300 -c 16
2310406 pts/20   R+     0:23      \_ stress -t 300 -c 16
2310407 pts/20   R+     0:25      \_ stress -t 300 -c 16
2310408 pts/20   R+     0:22      \_ stress -t 300 -c 16
2310409 pts/20   R+     0:24      \_ stress -t 300 -c 16
2310410 pts/20   R+     0:25      \_ stress -t 300 -c 16
2310411 pts/20   R+     0:24      \_ stress -t 300 -c 16
2310412 pts/20   R+     0:23      \_ stress -t 300 -c 16
2310413 pts/20   R+     0:24      \_ stress -t 300 -c 16
2310414 pts/20   R+     0:25      \_ stress -t 300 -c 16
2310415 pts/20   R+     0:22      \_ stress -t 300 -c 16

This is stress running across 16 threads. Related to this answer.

0
pstree -p -H <PID>

The command shows you the complete processtree of your system with all PIDs and highlights your process.

Maybe that helps to find what is going on.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .