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

Re: [Xen-devel] [PATCH v8 03/24] x86: refactor psr: implement main data structures.



>>> On 01.03.17 at 06:10, <yi.y.sun@xxxxxxxxxxxxxxx> wrote:
> On 17-02-28 11:58:59, Roger Pau Monn wrote:
>> On Wed, Feb 15, 2017 at 04:49:18PM +0800, Yi Sun wrote:
>> > +    struct feat_ops ops;
>> 
>> I would place the function hooks in this struct directly, instead of nesting
>> them inside of another struct. The hooks AFAICT are shared between all the
>> different PSR features.
>> 
> Jan suggested this before in v4 patch. We have discussed this and Jan 
> accepts
> current implementation. The reason is below:

I'm pretty sure I didn't (in this specific form). Instead you want this
to be a pointer (to a const struct instance), i.e. ...

> "To facilitate the callback functions assignment for a feature, I defined
> feature specific callback function ops like below.
> 
> struct feat_ops l3_cat_ops = {
>     .init_feature = l3_cat_init_feature,
>     .get_max_cos_max = l3_cat_get_max_cos_max,
>     ......
> };
> 
> And directly assign it to global feature node in initialization process like
> below.
> 
> static void cpu_init_work(void)
> {
> ......
>             feat_tmp = feat_l3_cat;
>             feat_l3_cat = NULL;
>             feat_tmp->ops = l3_cat_ops;

            feat_tmp->ops = &l3_cat_ops;

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.