Re: [Patch 3/8] cpu delay collection via schedstats

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

 



Balbir Singh <[email protected]> wrote:
>
> +/*
> + * Expects runqueue lock to be held for atomicity of update
> + */
> +static inline void rq_sched_info_arrive(struct runqueue *rq,
> +						unsigned long diff)
> +{
> +	if (rq) {
> +		rq->rq_sched_info.run_delay += diff;
> +		rq->rq_sched_info.pcnt++;
> +	}
> +}
> +
> +/*
> + * Expects runqueue lock to be held for atomicity of update
> + */
> +static inline void rq_sched_info_depart(struct runqueue *rq,
> +						unsigned long diff)
> +{
> +	if (rq)
> +		rq->rq_sched_info.cpu_time += diff;
> +}

The kernel has many different units of time - jiffies, cpu ticks, ns, us,
ms, etc.  So the reader of these functions doesn't have a clue what "diff"
is.

A good way to remove all doubt in all cases is to include the units in the
variable's name.  Something like delta_jiffies, perhaps.

-
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