Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp5116005rwi; Mon, 17 Oct 2022 15:58:29 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7TnCj1p04HLJP6cB3l4F7mSDeoEPl8jFF4u2M9U3nOtYlcPCaXLYScIFQOfUSsd+0BmOXJ X-Received: by 2002:a17:90b:4c85:b0:20d:7040:532a with SMTP id my5-20020a17090b4c8500b0020d7040532amr83560pjb.243.1666047509351; Mon, 17 Oct 2022 15:58:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666047509; cv=none; d=google.com; s=arc-20160816; b=QSSA3fRzHGmw0Bee8dNXZFCJMmin6+iPrB6vsqQxBcLKrC2M8lqtIHSgr6Za8R53P2 VXMCcEMfDAVzeAs9maPmZqt4V1/YpdsQHpYx64hkzH4Qm6Gofoqv+MQ63Fzhu8TVPlSw vVkNzp3StMWIml9aOQeXs51GnqHQkvS7rT9/izq51czZJp/iFuNpX9dQVZGCjs0LZD9w wtk0l9uIGxTGJmOfdBO5n83KsggRvAWXo+iW5W1n6lCQFTQW6wikp6Fu2QfcyduoROkC KiCzBQoYzQ9Buk8kgT2ntAkl5uhBsO4mx38rfnAKQUwKt8Yi/REamcSWJK0O2/Fq7vaC bi0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=E/4DPPSX+8EYQafccV5qoWyCAmySO2GlahoEOcD6yiE=; b=Q5IWFfhDx6v9tkZxZ+AjTaZ7vrntdIlgK/V31SsKXD3fqT3C2uhHfQyMt9M2hu37+A HZ9EnMcOw6oh70oqMXtu/z+TAWcqpBTtACCqnQLl73DS94qcu79+JOOG7LtCj/sWBkqJ oJ/7oRVKq2ko0rV6pEWabQB0DT8p8WRYTVv1DXaMuXFHGEZ04PCHcOgkspihSBdMsPKe 3RTEHIzQqyUCv8cCZXKMR3o4kJBx6sJgFkU1RnNQYTPtxg+KLWkBYBS8kw3lXmchkJrK fdXajeGryFnFCkNTw4nXXeJImeQRLhqzd9dQYnFPciDS10hnB1N3xO1SyBXMLbvOZYrG UZEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=Yr6JLfOI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q12-20020a638c4c000000b0046b08e9060fsi13359382pgn.485.2022.10.17.15.58.16; Mon, 17 Oct 2022 15:58:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=Yr6JLfOI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230107AbiJQWI4 (ORCPT + 99 others); Mon, 17 Oct 2022 18:08:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34146 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229976AbiJQWIx (ORCPT ); Mon, 17 Oct 2022 18:08:53 -0400 Received: from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com [IPv6:2607:f8b0:4864:20::1036]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 022337696A for ; Mon, 17 Oct 2022 15:08:53 -0700 (PDT) Received: by mail-pj1-x1036.google.com with SMTP id cl1so12131066pjb.1 for ; Mon, 17 Oct 2022 15:08:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=E/4DPPSX+8EYQafccV5qoWyCAmySO2GlahoEOcD6yiE=; b=Yr6JLfOIBxsKsz9I81OiNXnHbvZe5DM4pgR+uEoYH9sosgPO2rEO9K4G+qgZcbCE0U dTjnOvWDqDSlsJfMdwq3OtHjSYCYd3/LLgOEG5kyfW2xJhshGpV8I3QhStzNjmwrCJ0A gYEc6qcNjEDJoOlg83VOzJm1C9FvslOZE52zCPRKmR5jIRODorBIp1kj6JrSJJzQZqQE I+X0qBQoHjnWHd6E2mDIrvtlcei3hjswxq7xnKtwkiV7YL4gFTCpNIkofc842YMEeDRj eOpmxZRx843MuJ2S2rHWvSqj1+3EhvznOxSzyBMMZpc+HrJVthRanCFpAx6bGuHwJ/YG 7DFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=E/4DPPSX+8EYQafccV5qoWyCAmySO2GlahoEOcD6yiE=; b=cW2ZVH4Lb2Kiii/hhHU3hHDaP1c2PaSwD1fCG53jjn1nOVEJxGIWe3eYej0UhVSWS4 vEcVZBAz3Kpfe2OrVEdxrwM/PryLgMYTkOPt7I4PQaOpcboCjmgbludP7tMYwv/04+Nc HjS8CfbG6O9/ynlXZqud6XB3rg2B6NuGboaS1h8IFSVOzaWXGJDQ9TeoIKdavHBu8se2 FhZpnZPaPjj9M+LBOMK6x6KL4eSceysnjg4UJLGy7WLIfic+kRcYxBpHvAA6YMQguR61 nOYSsdxApPXQAwIrJmSDM9XMs11xdcBPlCtQp8LJmQmGDkuYBy+nk20eoQD81rb8JDcZ OU/A== X-Gm-Message-State: ACrzQf0D2bS/7DCDtGYbgvhAXZFFkfFmtYbzzumESrosa0Zz1pieR+Qr EOCy7wu3qI8+znpoIeq3j3SqIg== X-Received: by 2002:a17:903:2347:b0:181:33f0:f64e with SMTP id c7-20020a170903234700b0018133f0f64emr14442474plh.106.1666044532381; Mon, 17 Oct 2022 15:08:52 -0700 (PDT) Received: from google.com (7.104.168.34.bc.googleusercontent.com. [34.168.104.7]) by smtp.gmail.com with ESMTPSA id y17-20020a17090a8b1100b0020936894e76sm6659955pjn.10.2022.10.17.15.08.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Oct 2022 15:08:51 -0700 (PDT) Date: Mon, 17 Oct 2022 22:08:48 +0000 From: Sean Christopherson To: "Maciej S. Szmigiero" Cc: Gavin Shan , kvmarm@lists.cs.columbia.edu, kvmarm@lists.linux.dev, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, ajones@ventanamicro.com, pbonzini@redhat.com, maz@kernel.org, shuah@kernel.org, oliver.upton@linux.dev, peterx@redhat.com, ricarkol@google.com, zhenyzha@redhat.com, shan.gavin@gmail.com Subject: Re: [PATCH 5/6] KVM: selftests: memslot_perf_test: Consolidate memory sizes Message-ID: References: <20221014071914.227134-1-gshan@redhat.com> <20221014071914.227134-6-gshan@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 17, 2022, Maciej S. Szmigiero wrote: > > +#define MEM_EXTRA_SIZE 0x10000 > > Also, an expression like "(64 << 10)" is more readable than a "1" > with a tail of zeroes (it's easy to add one zero too many or be one > zero short). +1 to not open coding raw numbers. I think it's high time KVM selftests add #defines for the common sizes, e.g. SIZE_4KB, 16KB, 64K, 2MB, 1GB, etc... Alternatively (or in addition), just #define 1KB, 1MB, 1GB, and 1TB, and then do math off of those.