From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5D658C433E0 for ; Wed, 3 Feb 2021 13:46:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0203A64F74 for ; Wed, 3 Feb 2021 13:46:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232128AbhBCNqK (ORCPT ); Wed, 3 Feb 2021 08:46:10 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:37117 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232080AbhBCNp7 (ORCPT ); Wed, 3 Feb 2021 08:45:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612359873; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Cs3iOsJ+hW89JAhUT2y2LCELNvPWgVKRoTFjIBJXhX8=; b=ETLUnUfBRv+4vXFulo5VmH9ds0iGcr0UZKYeF7B/VM1ZdSlaYzKpBzcQFb883OHfm4MlHV 7hU9WCO5TtZSq3FNtwWjnzBy7NxsNymi+L/Px0mXj/WM/fgD2asj597tVHgRP0+6aLM+x3 uTVXvIeMVl9F63Ntu3nhCOE0s6QSJ8Y= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-213-NLGdFd9jMBqdF1Mp1n08mQ-1; Wed, 03 Feb 2021 08:44:31 -0500 X-MC-Unique: NLGdFd9jMBqdF1Mp1n08mQ-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C9FF9107ACE3; Wed, 3 Feb 2021 13:44:25 +0000 (UTC) Received: from [10.36.112.222] (ovpn-112-222.ams2.redhat.com [10.36.112.222]) by smtp.corp.redhat.com (Postfix) with ESMTP id 380F45D9E3; Wed, 3 Feb 2021 13:44:21 +0000 (UTC) Subject: Re: [PATCH 2/2] KVM: Scalable memslots implementation To: Paolo Bonzini , "Maciej S. Szmigiero" , Sean Christopherson Cc: Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Igor Mammedov , Marc Zyngier , James Morse , Julien Thierry , Suzuki K Poulose , Huacai Chen , Aleksandar Markovic , Paul Mackerras , Christian Borntraeger , Janosch Frank , Cornelia Huck , Claudio Imbrenda , Joerg Roedel , kvm@vger.kernel.org, linux-kernel@vger.kernel.org References: <4d748e0fd50bac68ece6952129aed319502b6853.1612140117.git.maciej.szmigiero@oracle.com> <9e6ca093-35c3-7cca-443b-9f635df4891d@maciej.szmigiero.name> <4bdcb44c-c35d-45b2-c0c1-e857e0fd383e@redhat.com> From: David Hildenbrand Organization: Red Hat GmbH Message-ID: <5efd931f-9d69-2936-89e8-278fe106616d@redhat.com> Date: Wed, 3 Feb 2021 14:44:20 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: <4bdcb44c-c35d-45b2-c0c1-e857e0fd383e@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >> The new implementation also uses standard kernel {rb,interval}-tree >> and hash table implementation as its basic data structures, so it >> automatically benefits from any generic improvements to these. >> >> All for the low price of just 174 net lines of code added. > > I think the best thing to do here is to provide a patch series that > splits the individual changes so that they can be reviewed and their > separate merits evaluated. > > Another thing that I dislike about KVM_SET_USER_MEMORY_REGION is that > IMO userspace should provide all memslots at once, for an atomic switch > of the whole memory array. (Or at least I would like to see the code; > it might be a bit tricky because you'll need code to compute the > difference between the old and new arrays and invoke > kvm_arch_prepare/commit_memory_region). I'm not sure how that would > interact with the active/inactive pair that you introduce here. > +1 One issue I am aware of is resizing/splitting slots, especially due to arrays like rmap + dirty bitmaps. BTW: what are your thoughts regarding converting the rmap array on x86-64 into some dynamic datastructre (xarray etc)? Has that already been discussed? > Paolo > -- Thanks, David / dhildenb