From patchwork Fri Apr 23 08:48:35 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takuya Yoshikawa X-Patchwork-Id: 94648 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o3N8jA8v021258 for ; Fri, 23 Apr 2010 08:45:11 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755217Ab0DWIoz (ORCPT ); Fri, 23 Apr 2010 04:44:55 -0400 Received: from serv2.oss.ntt.co.jp ([222.151.198.100]:55584 "EHLO serv2.oss.ntt.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754586Ab0DWIox (ORCPT ); Fri, 23 Apr 2010 04:44:53 -0400 Received: from serv2.oss.ntt.co.jp (localhost [127.0.0.1]) by serv2.oss.ntt.co.jp (Postfix) with ESMTP id 5934A248236; Fri, 23 Apr 2010 17:44:52 +0900 (JST) Received: from serv1.oss.ntt.co.jp (serv1.oss.ntt.co.jp [172.19.0.2]) by serv2.oss.ntt.co.jp (Postfix) with ESMTP id 48486248234; Fri, 23 Apr 2010 17:44:52 +0900 (JST) Received: from yshtky3.kern.oss.ntt.co.jp (unknown [172.17.1.52]) by serv1.oss.ntt.co.jp (Postfix) with SMTP id 3702011C00B; Fri, 23 Apr 2010 17:44:52 +0900 (JST) Date: Fri, 23 Apr 2010 17:48:35 +0900 From: Takuya Yoshikawa To: avi@redhat.com, mtosatti@redhat.com Cc: kvm@vger.kernel.org Subject: [PATCH] KVM: no need to test bit before setting dirty bit these days Message-Id: <20100423174835.0c231699.yoshikawa.takuya@oss.ntt.co.jp> X-Mailer: Sylpheed 2.6.0 (GTK+ 2.16.1; i486-pc-linux-gnu) Mime-Version: 1.0 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Fri, 23 Apr 2010 08:45:12 +0000 (UTC) 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); } }