Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Not sure this is the right place for this question, but here goes:

I'm trying to make some sense of the /proc/pid/sched and /proc/pid/task/tid/sched files for a highly threaded server process, however I was not able to find a good explanation of how to interpret this file ( just a few bits here: http://knol.google.com/k/linux-performance-tuning-and-measurement# ) . I assume this entry in procfs is related to newer versions of the kernel that run with the CFS scheduler?

CentOS distro running on a 2.6.24.7-149.el5rt kernel version with preempt rt patch.

Any thoughts?

share|improve this question

2 Answers 2

You can find more documentation about the /proc/[pid]/sched file in this article:

http://lwn.net/Articles/242900/

Look at the comments. Most of the fields are explained.

share|improve this answer
2  
It's considered good practice to include all the relevant information from that website. The reason for that is that one day that page may become unavailable and then your answer will be useless. –  Lucas Kauffman Apr 11 '12 at 7:29

Probably "man proc" is the place to read! From the manual:

/proc/[pid]/task
(since Linux 2.6.0-test6) This is a directory that contains one subdirectory for each thread in the process. The name of each subdirectory is the numerical thread ID ([tid]) of the thread (see gettid(2)). Within each of these subdirectories, there is a set of files with the same names and contents as under the /proc/[pid] directories. For attributes that are shared by all threads, the contents for each of the files under the task/[tid] subdirectories will be the same as in the corresponding file in the parent /proc/[pid] directory (e.g., in a multithreaded process, all of the task/[tid]/cwd files will have the same value as the /proc/[pid]/cwd file in the parent directory, since all of the threads in a process share a working directory). For attributes that are distinct for each thread, the corresponding files under task/[tid] may have different values (e.g., various fields in each of the task/[tid]/status files may be different for each thread).

In a multithreaded process, the contents of the /proc/[pid]/task directory are not available if the main thread has already terminated (typically by calling pthread_exit(3)).

So, basically understanding /proc/pid/task/ means understanding proc itself.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.