Messages in this thread | | | Subject | Re: [patch 02/15] sched: validate CFS quota hierarchies | From | Peter Zijlstra <> | Date | Fri, 08 Apr 2011 19:01:19 +0200 |
| |
On Thu, 2011-03-24 at 12:01 +0530, Bharata B Rao wrote: > On Tue, Mar 22, 2011 at 08:03:28PM -0700, Paul Turner wrote: > > Add constraints validation for CFS bandwidth hierachies. > > > > +static u64 normalize_cfs_quota(struct task_group *tg, > > + struct cfs_schedulable_data *d) > > +{ > > + u64 quota, period; > > + struct load_weight lw; > > + > > + if (tg == d->tg) { > > + period = d->period; > > + quota = d->quota; > > + } else { > > + period = tg_get_cfs_period(tg); > > + quota = tg_get_cfs_quota(tg); > > + } > > + > > + if (quota == RUNTIME_INF) > > + return RUNTIME_INF; > > + > > + lw.weight = period; > > + lw.inv_weight = 0; > > + > > + return calc_delta_mine(quota, max_cfs_quota_period, &lw) - 1; > > Time to rename calc_delta_mine to something more meaningful ?
Or not use it there at all:
- I'm not sure why we have different periods per cgroup, given that we don't have EDF like scheduling and there's a very limited set of useful periods. Too small and overhead increases like mad, too large and we get lots of priority inversion crap.
- Its not a fast-path by any means, so a straight fwd division wouldn't hurt anybody.
| |