From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrea Arcangeli Subject: Re: KVM: MMU: rmap_write_protect() hugepage iteration bug Date: Sun, 8 Jun 2008 22:30:37 +0200 Message-ID: <20080608203037.GB9921@duo.random> References: <20080608002736.GA25582@dmt.cnet> <20080608015452.GC8321@duo.random> <20080608044853.GA1408@dmt.cnet> <20080608183119.GA21835@duo.random> <20080608195215.GA5824@dmt.cnet> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Avi Kivity , kvm-devel To: Marcelo Tosatti Return-path: Received: from host36-195-149-62.serverdedicati.aruba.it ([62.149.195.36]:51642 "EHLO mx.cpushare.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753982AbYFHUaj (ORCPT ); Sun, 8 Jun 2008 16:30:39 -0400 Content-Disposition: inline In-Reply-To: <20080608195215.GA5824@dmt.cnet> Sender: kvm-owner@vger.kernel.org List-ID: On Sun, Jun 08, 2008 at 04:52:15PM -0300, Marcelo Tosatti wrote: > We do. The case is were you have two entries in the array. rmap_remove > will first remove the entry at index 0, and move the entry at index 1 to > 0. > > Then we call "rmap_next()" with a non-NULL spte, which will skip the > only remaining entry at index 0. IOW rmap_next() requires the spte > argument to be NULL if the array has one valid entry. How exactly we could call rmap_next with not-NULL spte after any rmap_remove with your last patch applied? > > chains are fairly long. To be sure you could try to profile it and see > > if rmap_write_protect goes up in the opreport. > > Will do. Cool, thanks!