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: <1302010098.2225.1330.camel@twins>
Date:	Tue, 05 Apr 2011 15:28:18 +0200
From:	Peter Zijlstra <a.p.zijlstra@...llo.nl>
To:	Paul Turner <pjt@...gle.com>
Cc:	linux-kernel@...r.kernel.org,
	Bharata B Rao <bharata@...ux.vnet.ibm.com>,
	Dhaval Giani <dhaval.giani@...il.com>,
	Balbir Singh <balbir@...ux.vnet.ibm.com>,
	Vaidyanathan Srinivasan <svaidy@...ux.vnet.ibm.com>,
	Srivatsa Vaddagiri <vatsa@...ibm.com>,
	Kamalesh Babulal <kamalesh@...ux.vnet.ibm.com>,
	Ingo Molnar <mingo@...e.hu>,
	Pavel Emelyanov <xemul@...nvz.org>,
	Nikhil Rao <ncrao@...gle.com>
Subject: Re: [patch 03/15] sched: accumulate per-cfs_rq cpu usage

On Tue, 2011-03-22 at 20:03 -0700, Paul Turner wrote:
> +static void request_cfs_rq_quota(struct cfs_rq *cfs_rq)
> +{
> +       struct task_group *tg = cfs_rq->tg;
> +       struct cfs_bandwidth *cfs_b = tg_cfs_bandwidth(tg);
> +       u64 amount = 0, min_amount;
> +
> +       min_amount = sched_cfs_bandwidth_slice() + (-cfs_rq->quota_remaining);
> +
> +       if (cfs_b->runtime > 0 || cfs_b->quota == RUNTIME_INF) {
> +               raw_spin_lock(&cfs_b->lock);
> +               if (cfs_b->quota != RUNTIME_INF) {
> +                       amount = min(cfs_b->runtime, min_amount);
> +                       cfs_b->runtime -= amount;
> +               } else {
> +                       amount = min_amount;
> +               }

So why would quota be RUNTIME_INF and quota_enabled be true? If its due
to a race when fiddling with the cgroup filesystem setting things up
that else branch wants a comment, if its for another reason all together
there's also a comment missing somewhere ;-)

> +               raw_spin_unlock(&cfs_b->lock);
> +       }
> +
> +       cfs_rq->quota_remaining += amount;
> +}
> +
> +static void account_cfs_rq_quota(struct cfs_rq *cfs_rq,
> +               unsigned long delta_exec)
> +{
> +       if (!cfs_rq->quota_enabled)
> +               return;
> +
> +       cfs_rq->quota_remaining -= delta_exec;
> +
> +       if (cfs_rq->quota_remaining > 0)
> +               return;
> +
> +       request_cfs_rq_quota(cfs_rq);
> +} 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ