lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180907102458.GP24106@hirez.programming.kicks-ass.net>
Date:   Fri, 7 Sep 2018 12:24:58 +0200
From:   Peter Zijlstra <peterz@...radead.org>
To:     Johannes Weiner <hannes@...xchg.org>
Cc:     Ingo Molnar <mingo@...hat.com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        Tejun Heo <tj@...nel.org>,
        Suren Baghdasaryan <surenb@...gle.com>,
        Daniel Drake <drake@...lessm.com>,
        Vinayak Menon <vinmenon@...eaurora.org>,
        Christopher Lameter <cl@...ux.com>,
        Peter Enderborg <peter.enderborg@...y.com>,
        Shakeel Butt <shakeelb@...gle.com>,
        Mike Galbraith <efault@....de>, linux-mm@...ck.org,
        cgroups@...r.kernel.org, linux-kernel@...r.kernel.org,
        kernel-team@...com
Subject: Re: [PATCH 8/9] psi: pressure stall information for CPU, memory, and
 IO

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.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ