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

Re: [Xen-devel] [PATCH 4/6] x86: add scheduling support for Intel CAT



>>> On 13.03.15 at 11:13, <chao.p.peng@xxxxxxxxxxxxxxx> wrote:
> @@ -407,10 +388,75 @@ void psr_domain_free(struct domain *d)
>      psr_free_cos(d);
>  }
>  
> +static void psr_assoc_init(struct psr_assoc *psra)
> +{
> +    unsigned int socket;
> +    struct psr_cat_socket_info *info;
> +
> +    socket = cpu_to_socket(smp_processor_id());
> +    psra->socket = socket;
> +    if ( cat_socket_info && socket < opt_socket_num )
> +    {
> +        info = cat_socket_info + socket;
> +        if ( info->enabled )
> +            psra->cos_mask = (~(~0ull << (get_count_order(info->cos_max)
> +                             + 32))) & (~0ull << 32);

((1ull << get_count_order()) - 1) << 32

seems better readable to me.

>  void psr_ctxt_switch_to(struct domain *d)
>  {
> +    uint64_t reg;
> +    struct psr_assoc *psra = &this_cpu(psr_assoc);
> +
> +    psr_assoc_reg_read(psra, &reg);

This ultimately leading to psr_assoc_init() makes it really undesirable
here imo: Initialization work shouldn't be done during a context
switch, even is this a one time thing on each CPU.

Jan


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


 


Rackspace

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