Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A5895C433FE for ; Tue, 23 Nov 2021 15:01:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238161AbhKWPEd (ORCPT ); Tue, 23 Nov 2021 10:04:33 -0500 Received: from mga05.intel.com ([192.55.52.43]:3048 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230510AbhKWPEc (ORCPT ); Tue, 23 Nov 2021 10:04:32 -0500 X-IronPort-AV: E=McAfee;i="6200,9189,10176"; a="321266870" X-IronPort-AV: E=Sophos;i="5.87,258,1631602800"; d="scan'208";a="321266870" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Nov 2021 07:01:22 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,258,1631602800"; d="scan'208";a="509438278" Received: from chaop.bj.intel.com (HELO localhost) ([10.240.192.101]) by orsmga008.jf.intel.com with ESMTP; 23 Nov 2021 07:01:13 -0800 Date: Tue, 23 Nov 2021 23:00:28 +0800 From: Chao Peng To: Paolo Bonzini Cc: "Kirill A. Shutemov" , Wanpeng Li , jun.nakajima@intel.com, kvm@vger.kernel.org, david@redhat.com, qemu-devel@nongnu.org, "J . Bruce Fields" , dave.hansen@intel.com, "H . Peter Anvin" , ak@linux.intel.com, Jonathan Corbet , Joerg Roedel , x86@kernel.org, Hugh Dickins , Ingo Molnar , Borislav Petkov , luto@kernel.org, Thomas Gleixner , Andrew Morton , Jim Mattson , linux-mm@kvack.org, Sean Christopherson , susie.li@intel.com, Jeff Layton , linux-kernel@vger.kernel.org, john.ji@intel.com, Yu Zhang , linux-fsdevel@vger.kernel.org, Vitaly Kuznetsov , "Kirill A . Shutemov" Subject: Re: [RFC v2 PATCH 13/13] KVM: Enable memfd based page invalidation/fallocate Message-ID: <20211123150028.GE32088@chaop.bj.intel.com> Reply-To: Chao Peng References: <20211119134739.20218-1-chao.p.peng@linux.intel.com> <20211119134739.20218-14-chao.p.peng@linux.intel.com> <20211122141647.3pcsywilrzcoqvbf@box.shutemov.name> <20211123010639.GA32088@chaop.bj.intel.com> <2f3e9d7e-ce15-e47b-54c6-3ca3d7195d70@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2f3e9d7e-ce15-e47b-54c6-3ca3d7195d70@redhat.com> User-Agent: Mutt/1.9.4 (2018-02-28) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 23, 2021 at 10:09:28AM +0100, Paolo Bonzini wrote: > On 11/23/21 02:06, Chao Peng wrote: > > > Maybe the kvm has to be tagged with a sequential id that incremented every > > > allocation. This id can be checked here. > > Sounds like a sequential id will be needed, no existing fields in struct > > kvm can work for this. > > There's no need to new concepts when there's a perfectly usable reference > count. :) Indeed, thanks. > > Paolo