Re: [PATCH: 2.6.18.1] delayacct: cpu_count in taskstats updated correctly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 26 Oct 2006, David Rientjes wrote:
On Fri, 27 Oct 2006, Martin Tostrup Setek wrote:
from: Martin T. Setek <[email protected]>
cpu_count in struct taskstats should be the same as the corresponding (third)
value found in /proc/<pid>/schedstat

I disagree in favor of Documentation/accounting/taskstats-struct.txt.
cpu_count is the number of delay values recorded, so accumulating them is
appropriate.

Perhaps I'm mistaken, but the code accumulates the value it finds in sched_info.pcnt in the task_struct. Now, in sched.h I found this:

struct sched_info {
	/* cumulative counters */
	unsigned long	cpu_time,	/* time spent on the cpu */
			run_delay,	/* time spent waiting on a runqueue */
			pcnt;		/* # of timeslices run on this cpu */

The comment says that these counters are cumulative... The code that updates them (sched.c: sched_info_arrive()), does accumulate them.

In include/linux/taskstats.h, I found:

         * xxx_count is the number of delay values recorded
         * xxx_delay_total is the corresponding cumulative delay in nanoseconds

I interpret these comments as saying that:

cpu_delay should be the total number of nanoseconds a task has been waiting in a runqueue for a CPU, and cpu_count is equal to the number of times the task got the CPU (or waited for it). If so, then the code updates taskstats.cpu_delay_total incorrectly too (which my patch didn't fix).

If not, then the comments in taskstats.h are very confusing....

Martin
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux