[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080422120056.GR12709@duo.random>
Date: Tue, 22 Apr 2008 14:00:56 +0200
From: Andrea Arcangeli <andrea@...ranet.com>
To: Robin Holt <holt@....com>
Cc: Christoph Lameter <clameter@....com>, akpm@...ux-foundation.org,
Nick Piggin <npiggin@...e.de>,
Steve Wise <swise@...ngridcomputing.com>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>, linux-mm@...ck.org,
Kanoj Sarcar <kanojsarcar@...oo.com>,
Roland Dreier <rdreier@...co.com>,
Jack Steiner <steiner@....com>, linux-kernel@...r.kernel.org,
Avi Kivity <avi@...ranet.com>, kvm-devel@...ts.sourceforge.net,
general@...ts.openfabrics.org, Hugh Dickins <hugh@...itas.com>
Subject: Re: [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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists