Messages in this thread | | | Date | Wed, 8 Oct 2014 10:37:21 +0200 | From | Peter Zijlstra <> | Subject | Re: [PATCH RFC 1/2] sched: cfs: introduce capacity_ops |
| |
On Tue, Oct 07, 2014 at 11:26:11PM -0700, Mike Turquette wrote: > +struct capacity_ops { > + unsigned long (*get_capacity)(int cpu); > + spinlock_t lock; > +};
Yeah, fail there. Ops vectors should not contain serialization, that simply doesn't work. It means you cannot switch the entire vector out.
Secondly, I dislike this because indirect function calls are more expensive than direct calls.
> +static unsigned long cfs_get_capacity(int cpu) > { > - return default_scale_load_capacity(cpu); > + unsigned long ret; > + > + rcu_read_lock(); > + ret = cfs_capacity_ops.get_capacity(cpu); > + rcu_read_unlock(); > + > + return ret; > +}
So ideally we'd never change these things, so rcu or whatnot should not be required.
> +/** > + * set_default_capacity_ops - reset capacity ops to their default > + * @eops - capacity_ops we are reseting > + * > + * Useful for loadable modules that supply custom capacity_ops callbacks. When > + * unloading these modules need to restore the originals before the custom > + * callbacks disappear.
Yeah, like hell no. We do not want modules to affect scheduler behaviour.
| |