Re: [PATCH 8/9] psi: pressure stall information for CPU, memory, and IO

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

 



On Tue, Aug 28, 2018 at 01:22:57PM -0400, Johannes Weiner wrote:
> +static void psi_clock(struct work_struct *work)
> +{
> +	struct delayed_work *dwork;
> +	struct psi_group *group;
> +	bool nonidle;
> +
> +	dwork = to_delayed_work(work);
> +	group = container_of(dwork, struct psi_group, clock_work);
> +
> +	/*
> +	 * If there is task activity, periodically fold the per-cpu
> +	 * times and feed samples into the running averages. If things
> +	 * are idle and there is no data to process, stop the clock.
> +	 * Once restarted, we'll catch up the running averages in one
> +	 * go - see calc_avgs() and missed_periods.
> +	 */
> +
> +	nonidle = update_stats(group);
> +
> +	if (nonidle) {
> +		unsigned long delay = 0;
> +		u64 now;
> +
> +		now = sched_clock();
> +		if (group->next_update > now)
> +			delay = nsecs_to_jiffies(group->next_update - now) + 1;
> +		schedule_delayed_work(dwork, delay);
> +	}
> +}

Just a little nit; I would expect a function called *clock() to return a
time.



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [Monitors]

  Powered by Linux