lkml.org 
[lkml]   [2021]   [Mar]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 16/18] KVM: Don't take mmu_lock for range invalidation unless necessary
From
Date
On 31/03/21 23:22, Sean Christopherson wrote:
> On a related topic, any preference on whether to have an explicit "must_lock"
> flag (what I posted), or derive the logic based on other params?
>
> The helper I posted does:
>
> if (range->must_lock &&
> kvm_mmu_lock_and_check_handler(kvm, range, &locked))
> goto out_unlock;
>
> but it could be:
>
> if (!IS_KVM_NULL_FN(range->on_lock) && !range->may_block &&
> kvm_mmu_lock_and_check_handler(kvm, range, &locked))
> goto out_unlock;
>
> The generated code should be nearly identical on a modern compiler, so it's
> purely a question of aesthetics. I slightly prefer the explicit "must_lock" to
> avoid spreading out the logic too much, but it also feels a bit superfluous.

I do as well, but I hope we don't need any lock after all as in the
email I've just sent.

Paolo

\
 
 \ /
  Last update: 2021-03-31 23:39    [W:0.058 / U:0.076 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site