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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BEAD2C433FE for ; Wed, 1 Dec 2021 02:54:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346280AbhLAC5z (ORCPT ); Tue, 30 Nov 2021 21:57:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57766 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230243AbhLAC5t (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 12BF8C061574 for ; Tue, 30 Nov 2021 18:54:26 -0800 (PST) Received: by mail-pl1-x634.google.com with SMTP id n8so16536849plf.4 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=btuKEM/TmCxmRsKjziICvu2qa1I0uUVSnUCp42nM4KuoxiiiNXWy8DJs2KKfO18ez3 PsbI2kPHzhIeISriCrt9Aw8kuwmQVpSB3MCql5+Zpp6w4LMgDGyz2BjhrzslnKVhGcAB iEQy41xq94Unrl+5FAf6EJwMP+C21u5AQdpuT9Z0rMREslOgr0aURyL1CtD6+S4IgCkm h06zcnS15/Yws2U+QLMyAKI6bJPKjKyzNrGPSqdrw2e+gYCAqzg1SdCNc6hvrIUB4T8l k6HXR7WTZ5C33C0/Gn/4CW/QLbwsKkINbuW0DePxNElKWspnKplyWVf8tFJDAMGF67gp 0/Zg== X-Gm-Message-State: AOAM531rHrjSUQHDs/tf3yrJjozN+Ivwvf+56XnBuSVDc9FmtDRsgigi 9FO5epaBIyQNVz+3KJYI02xAyQ== 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: kvm@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.