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

Re: [Xen-devel] [PATCH v10 09/25] x86: refactor psr: L3 CAT: set value: implement framework.



On 17-04-13 05:50:01, Jan Beulich wrote:
> >>> On 13.04.17 at 13:44, <yi.y.sun@xxxxxxxxxxxxxxx> wrote:
> > On 17-04-13 05:31:41, Jan Beulich wrote:
> >> >>> On 13.04.17 at 13:11, <yi.y.sun@xxxxxxxxxxxxxxx> wrote:
> >> > On 17-04-13 04:58:06, Jan Beulich wrote:
> >> >> >>> On 13.04.17 at 12:49, <yi.y.sun@xxxxxxxxxxxxxxx> wrote:
> >> >> > How about a per socket array like this:
> >> >> > uint32_t domain_switch[1024];
> >> >> > 
> >> >> > Every bit represents a domain id. Then, we can handle this case as 
> >> >> > below:
> >> >> > 1. In 'psr_cpu_init()', clear the array to be 0. I think this place 
> >> >> > is enough to
> >> >> >    cover socket offline case. We do not need to clear it in 
> >> >> > 'free_socket_resources'.
> >> >> > 
> >> >> > 2. In 'psr_ctxt_switch_to()', test_and_set_bit(domain_id, 
> >> >> > domain_switch) to set
> >> >> >    the bit to 1 according to domain_id. If the old value is 0 and the 
> >> >> >    'psr_cos_ids[socket]' is not 0, restore 'psr_cos_ids[socket]' to 
> >> >> > be 0.
> >> >> > 
> >> >> > 3. In 'psr_set_val()', test_and_set_bit(domain_id, domain_switch) to 
> >> >> > set the bit
> >> >> >    to 1 too. Then, update 'psr_cos_ids[socket]' according to 
> >> >> > find/pick flow.
> >> >> > 
> >> >> > Then, we only use 4KB for one socket.
> >> >> 
> >> >> This looks to come closer to something I'd consider acceptable, but
> >> >> I may not understand your intentions in full yet: For one, there's
> >> >> nowhere you clear the bit (other than presumably during socket
> >> >> cleanup). 
> >> > 
> >> > Actually, clear the array in 'free_socket_resources' has same effect. I 
> >> > can
> >> > move clear action into it.
> >> 
> >> That wasn't my point - I was asking about clearing individual bits.
> >> Point being that if you only ever set bits in the map, you'll likely
> >> end up iterating through all active domains anyway.
> >> 
> > If entering 'free_socket_resources', that means no more actions to
> > the array on this socket except clearing it. Can I just memset this array
> > of the socekt to 0?
> 
> You can, afaict, but unless first you act on the set bits I can't see why
> you would want to track the bits in the first place. Or maybe I'm still
> not understanding your intention, in which case I guess the best you
> can do is simply implement your plan, and we'll discuss it in v11 review.
> 
I made a test patch based on v10 and attached it in mail. Could you please
help to check it? Thanks!

> Jan

Attachment: domids_final.patch
Description: Text Data

_______________________________________________
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®.