mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Amanulla G" <amanulla@india.hp.com>
To: "'Arjan van de Ven'" <arjan@infradead.org>
Cc: <linux-kernel@vger.kernel.org>, <jdp@india.hp.com>
Subject: RE: /proc on 2.4.21 & 2.6 kernels....
Date: Wed, 4 May 2005 00:05:44 +0530	[thread overview]
Message-ID: <200505031846.AAA19043@harvest.india.hp.com> (raw)
In-Reply-To: <1112718903.6275.75.camel@laptopd505.fenrus.org>

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.





  reply	other threads:[~2005-05-03 18:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-05 15:11 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 [this message]
2005-05-03 19:34 Parag Warudkar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200505031846.AAA19043@harvest.india.hp.com \
    --to=amanulla@india.hp.com \
    --cc=arjan@infradead.org \
    --cc=jdp@india.hp.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®