lkml.org 
[lkml]   [2015]   [Nov]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] KVM: x86: Add lowest-priority support for vt-d posted-interrupts
2015-11-26 06:24+0000, Wu, Feng:
>> From: Radim Krčmář [mailto:rkrcmar@redhat.com]
>> 2015-11-25 15:38+0100, Paolo Bonzini:
>>> On 25/11/2015 15:12, Radim Krcmár wrote:
>>>> I think it's ok to pick any algorithm we like. It's unlikely that
>>>> software would recognize and take advantage of the hardware algorithm
>>>> without adding a special treatment for KVM.
>>>> (I'd vote for the simple pick-first-APIC lowest priority algorithm ...
>>>> I don't see much point in complicating lowest priority when it doesn't
>>>> deliver to lowest priority CPU anyway.)
>>>
>>> Vector hashing is an improvement for the common case where all vectors
>>> are set to all CPUs. Sure you can get an unlucky assignment, but it's
>>> still better than pick-first-APIC.
>>
>> Yeah, hashing has a valid use case, but a subtle weighting of drawbacks
>> led me to prefer pick-first-APIC ...
>
> Is it possible that pick-first-APIC policy make certain vCPU's irq workload too
> heavy?

It is, but vector hashing doesn't eliminate that possibility, just makes
it significantly less likely.
irqbalanced takes care of proper distribution in Linux guests. I'm not
sure what other OS do, but they should have something like that as well.

>> (I'd prefer to have simple code in KVM and depend on static IRQ balancing
>> in a guest to handle the distribution.
>> The guest could get the unlucky assignment anyway, so it should be
>> prepared; and hashing just made KVM worse in that case. Guests might
>> also configure physical x(2)APIC, where is no lowest priority.
>> And if the guest doesn't do anything with IRQs, then it might not even
>> care about the impact that our choice has.)
>
> Do do you guys have an agreement on how to handle this? Or we can implement
> the vector hashing at the current stage. then we can improve it like Radim mentioned
> above if it is really needed?

Vector hashing is definitely an improvement over the current situation;
I'll agree with any algorithm if it is reasonably implemented.

(v1 fails delivery if chosen APIC is disabled, misuses KVM_MAX_VCPUS as
bitmap size, and counting number of bits is better done with hweight16()
-- these bugs would hopefully be fixed by having a common functinon :])


\
 
 \ /
  Last update: 2015-11-26 15:21    [W:0.614 / U:0.320 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site