* [PATCH] KVM: no need to test bit before setting dirty bit these days
@ 2010-04-23 8:48 Takuya Yoshikawa
2010-04-23 10:31 ` Avi Kivity
0 siblings, 1 reply; 2+ messages in thread
From: Takuya Yoshikawa @ 2010-04-23 8:48 UTC (permalink / raw)
To: avi, mtosatti; +Cc: kvm
As Avi pointed out, testing bit part in mark_page_dirty() was important
in the days of shadow paging, but currently EPT and NPT has already become
common and the chance of faulting a page more that once per iteration is
small. So let's remove the test bit to avoid extra access.
Signed-off-by: Takuya Yoshikawa <yoshikawa.takuya@oss.ntt.co.jp>
---
virt/kvm/kvm_main.c | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index 6dc9404..9ab1a77 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -1192,9 +1192,7 @@ void mark_page_dirty(struct kvm *kvm, gfn_t gfn)
if (memslot && memslot->dirty_bitmap) {
unsigned long rel_gfn = gfn - memslot->base_gfn;
- /* avoid RMW */
- if (!generic_test_le_bit(rel_gfn, memslot->dirty_bitmap))
- generic___set_le_bit(rel_gfn, memslot->dirty_bitmap);
+ generic___set_le_bit(rel_gfn, memslot->dirty_bitmap);
}
}
--
1.6.3.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] KVM: no need to test bit before setting dirty bit these days
2010-04-23 8:48 [PATCH] KVM: no need to test bit before setting dirty bit these days Takuya Yoshikawa
@ 2010-04-23 10:31 ` Avi Kivity
0 siblings, 0 replies; 2+ messages in thread
From: Avi Kivity @ 2010-04-23 10:31 UTC (permalink / raw)
To: Takuya Yoshikawa; +Cc: mtosatti, kvm
On 04/23/2010 11:48 AM, Takuya Yoshikawa wrote:
> As Avi pointed out, testing bit part in mark_page_dirty() was important
> in the days of shadow paging, but currently EPT and NPT has already become
> common and the chance of faulting a page more that once per iteration is
> small. So let's remove the test bit to avoid extra access.
>
Applied, thanks.
--
Do not meddle in the internals of kernels, for they are subtle and quick to panic.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-04-23 10:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-23 8:48 [PATCH] KVM: no need to test bit before setting dirty bit these days Takuya Yoshikawa
2010-04-23 10:31 ` Avi Kivity
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox