Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp289170pxb; Wed, 3 Feb 2021 05:48:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJyNQLTIdHstER01OyUOs4IPiOeB+XjOycy72exEAhKa9S1DkgyKiRJV7IuYuSci7D9zSEtO X-Received: by 2002:aa7:c34f:: with SMTP id j15mr3019865edr.120.1612360106831; Wed, 03 Feb 2021 05:48:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612360106; cv=none; d=google.com; s=arc-20160816; b=PMughWLfA5c51IBrh4zTzxbm0OR8XZHIgB6Reudv/xTlYSyj0FdLC65GPN4NdSbWoz ISE35GYGyCQXtGfbeJ52BYQ6jnGSlF7KFdmu6o/FW/WTO+OExXV9mdR6ZpDaWI8BeoMF SFkpTDwqk0gjbKz88162zYU98R4ZNdT28nXFYvDPX+vg1DmzL5vF2bVRNijoakGhthys IZgCVwQOo+1uE5h1sZZQgRWgFX//OmGikAMx7Unl8ojZmMowGxWMBTJc/qH0IxzBVRY4 Obf7A3Y2B4RSWONCU05ezQxT6cX33YQE22Q5q5WRrltMSh4pkLtQVilh2WpsEjsil1y2 r+rQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:organization :from:references:cc:to:subject:dkim-signature; bh=Cs3iOsJ+hW89JAhUT2y2LCELNvPWgVKRoTFjIBJXhX8=; b=y7vy5E3POxdNLeWa5KtuFTRQijB6xnFFaqNYmnkskeCFQxtKXIgGFB5xGy1R00W/fC AVnpK1y+pLlYPTfDbjv001OcBYEO4l/M9WuyLTnhyyLwQKUbxtGlhrIGspsfrB2/UmPZ g8GGkUNE5dmZC4YCwSw4q02WsyA39DZiL0gWAe6WskJ6r55NeCyWt0zpndu0HnV9Kvsb /lDob/hmAFcH47uBEJJDxOBwaGGnQmCz7WlwzbQqR/1arkDYyBH2KBJDmN7magXsRAOX l1Kf/24Qv84saJh1rppIijquDCdxnwz9l9cdXJHW1sDjsYUla23OLMJjBEm7bOfsanx6 u6Gw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ETLUnUfB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g4si1423858ejc.682.2021.02.03.05.48.01; Wed, 03 Feb 2021 05:48:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ETLUnUfB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232047AbhBCNqH (ORCPT + 99 others); Wed, 3 Feb 2021 08:46:07 -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