lkml.org 
[lkml]   [2008]   [Apr]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 0 of 9] mmu notifier #v12
    On Tue, Apr 22, 2008 at 09:20:26AM +0200, Andrea Arcangeli wrote:
    > invalidate_range_start {
    > spin_lock(&kvm->mmu_lock);
    >
    > kvm->invalidate_range_count++;
    > rmap-invalidate of sptes in range
    >

    write_seqlock; write_sequnlock;

    > spin_unlock(&kvm->mmu_lock)
    > }
    >
    > invalidate_range_end {
    > spin_lock(&kvm->mmu_lock);
    >
    > kvm->invalidate_range_count--;


    write_seqlock; write_sequnlock;

    >
    > spin_unlock(&kvm->mmu_lock)
    > }

    Robin correctly pointed out by PM there should be a seqlock in
    range_begin/end too like corrected above.

    I guess it's better to use an explicit sequence counter so we avoid an
    useless spinlock of the write_seqlock (mmu_lock is enough already in
    all places) and so we can increase it with a single op with +=2 in the
    range_begin/end. The above is a lower-perf version of the final
    locking but simpler for reading purposes.


    \
     
     \ /
      Last update: 2008-04-22 14:03    [W:4.456 / U:0.052 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site