[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 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.

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