lkml.org 
[lkml]   [2020]   [Apr]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH RFC 6/6] KVM: x86: Switch KVM guest to using interrupts for page ready APF delivery
Date
Paolo Bonzini <pbonzini@redhat.com> writes:

> On 29/04/20 11:36, Vitaly Kuznetsov wrote:
>> +
>> + if (__this_cpu_read(apf_reason.enabled)) {
>> + reason = __this_cpu_read(apf_reason.reason);
>> + if (reason == KVM_PV_REASON_PAGE_READY) {
>> + token = __this_cpu_read(apf_reason.token);
>> + /*
>> + * Make sure we read 'token' before we reset
>> + * 'reason' or it can get lost.
>> + */
>> + mb();
>> + __this_cpu_write(apf_reason.reason, 0);
>> + kvm_async_pf_task_wake(token);
>> + }
>
> If tokens cannot be zero, could we avoid using reason for the page ready
> interrupt (and ultimately retire "reason" completely)?

Yes, we can switch to using 'token' exclusively but personally I'm not
sure it is worth it. We'll still have to have a hole and reason + token
is only u64. Keeping 'reason' in place allows us to easily come up with
any other type of notification through this mecanism (if the reson is
... then 'token' means ...).

--
Vitaly

\
 
 \ /
  Last update: 2020-04-29 14:45    [W:0.095 / U:0.304 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site