From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752759AbaHSF4A (ORCPT ); Tue, 19 Aug 2014 01:56:00 -0400 Received: from e28smtp09.in.ibm.com ([122.248.162.9]:37514 "EHLO e28smtp09.in.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752665AbaHSFz5 (ORCPT ); Tue, 19 Aug 2014 01:55:57 -0400 Message-ID: <53F2E6E6.8030709@linux.vnet.ibm.com> Date: Tue, 19 Aug 2014 13:55:50 +0800 From: Xiao Guangrong User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: David Matlack CC: Paolo Bonzini , Gleb Natapov , Avi Kivity , mtosatti@redhat.com, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH 1/2] KVM: fix cache stale memslot info with correct mmio generation number References: <1407999713-3726-1-git-send-email-xiaoguangrong@linux.vnet.ibm.com> <53F20653.2030204@redhat.com> <9AD43423-2FF3-422D-A5AD-61CAE6339CCC@linux.vnet.ibm.com> <53F24A49.2010807@redhat.com> <53F2C997.6070605@linux.vnet.ibm.com> <53F2D567.70700@linux.vnet.ibm.com> <53F2DE4B.4060708@linux.vnet.ibm.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 14081905-2674-0000-0000-00000174067B Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/19/2014 01:40 PM, David Matlack wrote: > On Mon, Aug 18, 2014 at 10:19 PM, Xiao Guangrong > wrote: >> On 08/19/2014 01:00 PM, David Matlack wrote: >>> On Mon, Aug 18, 2014 at 9:41 PM, Xiao Guangrong >>> wrote: >>>> On 08/19/2014 12:31 PM, David Matlack wrote: >>>>> The single line patch I suggested was only intended to fix the "forever >>>>> incorrectly exit mmio". >>>> >>>> My patch also fixes this case and that does not doubly increase the >>>> number. I think this is the better one. >>> >>> I prefer doubly increasing the generation for this reason: the updated boolean >>> requires extra code on the "client-side" to check if there's an update in >>> progress. And that makes it easy to get wrong. In fact, your patch >>> forgot to check the updated bit in mark_mmio_spte(). Doubly increasing the >>> generation requires no "client-side" code to work. >> >> No, the updated patch is used to fix case 2 which i draw the scenario in >> the last mail. I mean the original patch in this patchset which just >> increase the number after srcu-sync. >> >> Then could you tell me that your approach can do but my original patch can not? > > It avoids publishing new memslots with an old generation number attached to > them (even if it only lasts for a short period of time). I can not see the problem if that happen, could you please draw the scenario? > Do you have a reason > why you don't want to doubly increase the generation? That more easily causes the number wrap-around.