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 7A068C43217 for ; Wed, 1 Dec 2021 02:54:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346285AbhLAC55 (ORCPT ); Tue, 30 Nov 2021 21:57:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233169AbhLAC5t (ORCPT ); Tue, 30 Nov 2021 21:57:49 -0500 Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com [IPv6:2607:f8b0:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 13AC5C061746 for ; Tue, 30 Nov 2021 18:54:26 -0800 (PST) Received: by mail-pl1-x634.google.com with SMTP id k4so16508420plx.8 for ; Tue, 30 Nov 2021 18:54:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=9A/2leLJbfX1szhJ25c58spVdgO6jJrp/elHwnh4vrE=; b=VTbhgSBz76ZAXqAAU3pEKuxePf2WpS4uKDeng9BYo8lhswfDH4kfmy7bX/pAEFBujM O3bTwxtcihymXSv4Ogqrl0wLYKcKkCSY/30PSat8Wq2AKNU8ZWZ0dxrxbAoBzfzG3RMp x+2X3dZOHH9puPBDxLCLurBfrxvdMrsWSjYOVdAxIKySMasMSp89YARw6YAuYhS8GngA kIDGR4Ar6tbQ3a8M/+z15YkDXuGxOlsfgS1hXOpXrfD8rH7EwM4nHX+CNBUNQhWozLtk MGujAmwkd4p5SczfwQHoFIh4Ok+n5nx6U2qS22x2jiak/dbhwT0XOs9xmvv4Hj6Zi26Q IpTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=9A/2leLJbfX1szhJ25c58spVdgO6jJrp/elHwnh4vrE=; b=kEinAWN2Bk8LzSADPKkMwI9yjfrOuNytnP3h5+AA1YaCPX8TIPzWKzU3UnEoSdvgj9 Pvh4noEgbLs+tIuxWNXX2Q0PhCuLfLeGBhfOWuevKceUwt2u7V9EWsvyHzIRXbDXtdhW VFTJLSlRz1/tRf35IBk5n9nUVDZ8xwhmJTT6CjopyCAAovIwsO5qdk4ZxgnduX+CCoDm I23LC+19wwvnS+y+TIHvVd3O70QzkVGgnkirGFeM7sLBrQ8YBBk2uUaKfBE/nmEk5GuZ kY56pNLOqmfBQcuW815WSwZO6jY3Sv2IAG5fzQ5wwSvq9+6JA6Q00GFIsgvtjihrWoTA a7vQ== X-Gm-Message-State: AOAM530dNdSYPqX9K8wPHkC8lNx2+dHjLZhG95yP5Ed5aFr6UXnXp0PL R2mZ0ZER092+NNVgjAwYwmJPoA== X-Google-Smtp-Source: ABdhPJxOWDatsECgGBcAHEz6kwu67DVfRq3IjArlD9yguLiB64YzJv0E9qqzu0XJXLd6QlRALQ0Hrw== X-Received: by 2002:a17:90b:390c:: with SMTP id ob12mr3830664pjb.212.1638327265405; Tue, 30 Nov 2021 18:54:25 -0800 (PST) Received: from google.com (157.214.185.35.bc.googleusercontent.com. [35.185.214.157]) by smtp.gmail.com with ESMTPSA id k8sm14530597pfc.197.2021.11.30.18.54.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Nov 2021 18:54:24 -0800 (PST) Date: Wed, 1 Dec 2021 02:54:21 +0000 From: Sean Christopherson To: "Maciej S. Szmigiero" Cc: Paolo Bonzini , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , Igor Mammedov , Marc Zyngier , James Morse , Julien Thierry , Suzuki K Poulose , Huacai Chen , Aleksandar Markovic , Paul Mackerras , Christian Borntraeger , Janosch Frank , David Hildenbrand , Cornelia Huck , Claudio Imbrenda , Anup Patel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandru Elisei , Atish Patra , Ben Gardon , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v6 21/29] KVM: Resolve memslot ID via a hash table instead of via a static array Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 30, 2021, Maciej S. Szmigiero wrote: > From: "Maciej S. Szmigiero" > > Memslot ID to the corresponding memslot mappings are currently kept as > indices in static id_to_index array. > The size of this array depends on the maximum allowed memslot count > (regardless of the number of memslots actually in use). > > This has become especially problematic recently, when memslot count cap was > removed, so the maximum count is now full 32k memslots - the maximum > allowed by the current KVM API. > > Keeping these IDs in a hash table (instead of an array) avoids this > problem. > > Resolving a memslot ID to the actual memslot (instead of its index) will > also enable transitioning away from an array-based implementation of the > whole memslots structure in a later commit. > > Signed-off-by: Maciej S. Szmigiero > Co-developed-by: Sean Christopherson > Signed-off-by: Sean Christopherson Nit, your SoB should come last since you were the last person to handle the patch.