* Re: /proc on 2.4.21 & 2.6 kernels....
@ 2005-04-05 15:11 Amanulla G
2005-04-05 15:18 ` Arjan van de Ven
0 siblings, 1 reply; 6+ messages in thread
From: Amanulla G @ 2005-04-05 15:11 UTC (permalink / raw)
To: linux-kernel; +Cc: jdp
Hi,
I would like to know the information on /proc under 2.4.21 based kernels.
On 2.4.21 based kernels, /proc has got two types of entries.
/proc/pid & /proc/.tid
The statistics under /proc/pid reflect just resource utilization of pid
alone. They are not summarization of resource utilization of process and the
threads it creates. I would like to know is there any way that we can make
sure that statistics under /proc/pid reflect the resource utilization of
threads it creates too?
Here are the additional details.
1) One line summary of the problem:
>> On 2.4.21 based kernels, /proc/pid doesn't include the consolidated
resource utilization of the threads it has created.
2) Full description of the problem/report:
>> Assume we have a process with pid = 1234
And this process creates two threads with thread IDs 1235 & 1236.
We have three entries
a) /proc/1234
b) /proc/.1235
c) /proc/.1236
The statistics under /proc/1234 doesn't reflect resource utilization
of threads.
3) Keywords (i.e., modules, networking, kernel):
>> /proc
4) Kernel version (from /proc/version):
>> 2.4.21
5) Output of Oops.. message (if applicable) with symbolic information
resolved (see Documentation/oops-tracing.txt)
>> N/A
6) A small shell script or example program which triggers the
problem (if possible)
>> Can be easily seen with multi-threaded processes
We would like to know
1) Is this a known problem?
2) Whether this problem has been fixed? If yes, in which version of the
kernel this issue has been fixed?
3) In 2.6 based kernels we have different way of getting thread data.
/proc/<pid>/tasks/tid
Does /proc/<pid>/stat has got the summarized statistics of resource
utilization of threads it has created ? or it just reflects the resource
utilization of <pid> only?
Thanks in advance!
With Best Regards,
Amanulla
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: /proc on 2.4.21 & 2.6 kernels....
2005-04-05 15:11 /proc on 2.4.21 & 2.6 kernels Amanulla G
@ 2005-04-05 15:18 ` Arjan van de Ven
2005-04-05 16:22 ` Amanulla G
0 siblings, 1 reply; 6+ messages in thread
From: Arjan van de Ven @ 2005-04-05 15:18 UTC (permalink / raw)
To: Amanulla G; +Cc: linux-kernel, jdp
On Tue, 2005-04-05 at 20:41 +0530, Amanulla G wrote:
> Hi,
> I would like to know the information on /proc under 2.4.21 based kernels.
>
> On 2.4.21 based kernels, /proc has got two types of entries.
> /proc/pid & /proc/.tid
2.4 kernels do not have /proc/.tid.
Some vendor kernels might, if you ahve problems with such kernels you
are much better of contacting the vendor of such a kernel instead.
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: /proc on 2.4.21 & 2.6 kernels....
2005-04-05 15:18 ` Arjan van de Ven
@ 2005-04-05 16:22 ` Amanulla G
2005-04-05 16:35 ` Arjan van de Ven
0 siblings, 1 reply; 6+ messages in thread
From: Amanulla G @ 2005-04-05 16:22 UTC (permalink / raw)
To: 'Arjan van de Ven', linux-kernel; +Cc: jdp
Hi,
Thanks for the mail.
May be I didn't put my question correctly.
On 2.4.21 based kernels /proc has got hidden directories which has got the
thread related statistics.
1) /proc/pid reflects resource usage of the process
2) /proc/.pid (I Was referring to this as a thread ID). Kernel stores
thread resource utilization under this directory.
My question was resource utilization (say cpu utilization) statistics under
/proc/pid doesn't include resource utilization of threads which that process
has created.
May be this is specific to Red Hat AS 3.0 only. I will check it.
My second part of question was:
On 2.6 kernels, we have /proc/<tgid>/task/xxx
My question is /proc/<tgid> stats reflect resource utilization of the
threads it has created?
Or do they only report resource utilization of a process with <tgid> as the
pid?
Once again thanks for your reply and time.
Thanks & Best Regards,
Amanulla
-----Original Message-----
From: Arjan van de Ven [mailto:arjan@infradead.org]
Sent: Tuesday, April 05, 2005 8:48 PM
To: Amanulla G
Cc: linux-kernel@vger.kernel.org; jdp@india.hp.com
Subject: Re: /proc on 2.4.21 & 2.6 kernels....
On Tue, 2005-04-05 at 20:41 +0530, Amanulla G wrote:
> Hi,
> I would like to know the information on /proc under 2.4.21 based kernels.
>
> On 2.4.21 based kernels, /proc has got two types of entries.
> /proc/pid & /proc/.tid
2.4 kernels do not have /proc/.tid.
Some vendor kernels might, if you ahve problems with such kernels you
are much better of contacting the vendor of such a kernel instead.
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: /proc on 2.4.21 & 2.6 kernels....
2005-04-05 16:22 ` Amanulla G
@ 2005-04-05 16:35 ` Arjan van de Ven
2005-05-03 18:35 ` Amanulla G
0 siblings, 1 reply; 6+ messages in thread
From: Arjan van de Ven @ 2005-04-05 16:35 UTC (permalink / raw)
To: Amanulla G; +Cc: linux-kernel, jdp
On Tue, 2005-04-05 at 21:52 +0530, Amanulla G wrote:
> Hi,
> Thanks for the mail.
> May be I didn't put my question correctly.
> On 2.4.21 based kernels /proc has got hidden directories which has got the
> thread related statistics.
I understood your question.
However 2.4.21 kernels from kernel.org do not have such hidden
directories.
> My second part of question was:
> On 2.6 kernels, we have /proc/<tgid>/task/xxx
> My question is /proc/<tgid> stats reflect resource utilization of the
> threads it has created?
yes afaik it's cumulative over the threads there.
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: /proc on 2.4.21 & 2.6 kernels....
2005-04-05 16:35 ` Arjan van de Ven
@ 2005-05-03 18:35 ` Amanulla G
0 siblings, 0 replies; 6+ messages in thread
From: Amanulla G @ 2005-05-03 18:35 UTC (permalink / raw)
To: 'Arjan van de Ven'; +Cc: linux-kernel, jdp
Hi,
Sorry for the late follow up on this.
Re:
>> My second part of question was:
>> On 2.6 kernels, we have /proc/<tgid>/task/xxx
>> My question is /proc/<tgid> stats reflect resource utilization of the
>> threads it has created?
> yes afaik it's cumulative over the threads there.
I just wrote a small program which creates a thread. The thread just hogs
cpu and does nothing else.
***********************************************
#include <pthread.h>
#include <stdio.h>
void *foo(void *p)
{
printf ("Thread ");
fflush(stdout);
while (1);
}
int main(void){
int ret;
pthread_t p1 ;
ret = pthread_create(&p1, NULL, foo, NULL);
pthread_join(p1,NULL);
}
***********************************************
I checked the above program on a machine with 2.6.9-5.EL running.
I checked the top output, it says, global cpu util is 99.% but the cpu
utilization of a.out is 0.0!!
None of the processes that top showed has had more than 0.2% of CPU
utilization, but still global cpu utilization is 99.9%.
Interestingly, /proc/pid related to a.out process had two entries under
/proc/pid/task directory
1) Entry related to a.out
2) Entry related to thread created by a.out
But the statistics under /proc/pid/stat related to a.out process do not
reflect the resource utilization of the thread it has created.
Could you please look into this issue?
With Best Regards,
Amanulla
-----Original Message-----
From: Arjan van de Ven [mailto:arjan@infradead.org]
Sent: Tuesday, April 05, 2005 10:05 PM
To: Amanulla G
Cc: linux-kernel@vger.kernel.org; jdp@india.hp.com
Subject: RE: /proc on 2.4.21 & 2.6 kernels....
On Tue, 2005-04-05 at 21:52 +0530, Amanulla G wrote:
> Hi,
> Thanks for the mail.
> May be I didn't put my question correctly.
> On 2.4.21 based kernels /proc has got hidden directories which has got the
> thread related statistics.
I understood your question.
However 2.4.21 kernels from kernel.org do not have such hidden
directories.
> My second part of question was:
> On 2.6 kernels, we have /proc/<tgid>/task/xxx
> My question is /proc/<tgid> stats reflect resource utilization of the
> threads it has created?
yes afaik it's cumulative over the threads there.
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: /proc on 2.4.21 & 2.6 kernels....
@ 2005-05-03 19:34 Parag Warudkar
0 siblings, 0 replies; 6+ messages in thread
From: Parag Warudkar @ 2005-05-03 19:34 UTC (permalink / raw)
To: Amanulla G; +Cc: linux-kernel
>I checked the top output, it says, global cpu util is 99.% but the cpu
>utilization of a.out is 0.0!!
Works fine on 2.6.11-x86 and recent procps(top attributes 98.7% CPU to a.out and Cumulative CPU is 99%) Possibly you have a outdated procps?
Parag
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2005-05-03 19:34 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-04-05 15:11 /proc on 2.4.21 & 2.6 kernels Amanulla G
2005-04-05 15:18 ` Arjan van de Ven
2005-04-05 16:22 ` Amanulla G
2005-04-05 16:35 ` Arjan van de Ven
2005-05-03 18:35 ` Amanulla G
2005-05-03 19:34 Parag Warudkar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®