Message ID | 20221020071209.559062-1-gshan@redhat.com |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp108270wrs; Thu, 20 Oct 2022 00:13:22 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6ijEZkTIcxfvNnXwVOK9Yeh4BPZLZXHvR3MbGI5UlzcKj9T+w+dyMQGKY2HoIAbnJwl+7e X-Received: by 2002:a17:902:cf42:b0:184:5b9a:24f1 with SMTP id e2-20020a170902cf4200b001845b9a24f1mr12782206plg.73.1666250001847; Thu, 20 Oct 2022 00:13:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666250001; cv=none; d=google.com; s=arc-20160816; b=Eedf2AOYmimBEf4/yAF/kyKHlvcUM+qD7EaXa4nZZmcCGJtoRhcHRHBI08+Y7iKrrs 2gjYqt9ZRqz+dZ0h9CxKQjTUVlGobWVDWIeFNV9wZTlVnQ25ASdAnudx5yAZs9k1h9xp b2mAJj3MMaAg7HED+TH1Sf0GEorVSo71nYnTRpB6jnykOo4mqtNUPOX9LsX53hJkWZXs ayQHQF14+q+YcMmsUbkouf5909ITXRebXqa8DBjHx6nHKYpKRW9ePD0iO/f2uOGvPYWo W9/KZNaB5cz99F3qQXkKe4+7q0dBNBLrN1j2odL7jBZzzZ6K3VmS5wRTiljBdU7Eo1G9 3QnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=iSbqsg4g0J+uDTur4nOLOrDlqWhjBL7zIdyxmPl56wI=; b=mS5hUNZgDOiNFKP3SpDwBsOb+DWGNP5MLda8m4cZzAoKr4JhVxNn9KALwvkPAdCxsY M/35ttkCMkRHx3M21XyvehGAkvCsnBSRcC583rcpkIXcgCsb//69PcOAUZa9IpJ8123S T1FopptJCf+tNW6WitklpijqXO0tM+P1VXbB0IDZIV9t5gaVEB9BKS3c11cr5UGXCn57 segcMaqMP6+LBmcn6cnciRYxlmfi3JelrGNZAw59Mi7uSwJmiJ8x0GQTsrYB4Nt+16UB jFcNaap5s+yMvucCnJgSIT2Qo/Zmgw2qkBU2ZERib2TiZmBO3CvCZYLz9ObI2hKHJ8hE 2I7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=JBb5P3wS; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h2-20020a654042000000b0045c88c3b799si21228641pgp.709.2022.10.20.00.13.08; Thu, 20 Oct 2022 00:13:21 -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=@redhat.com header.s=mimecast20190719 header.b=JBb5P3wS; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230096AbiJTHMy (ORCPT <rfc822;realc9580@gmail.com> + 99 others); Thu, 20 Oct 2022 03:12:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54282 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229773AbiJTHMv (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 20 Oct 2022 03:12:51 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 08335159A23 for <linux-kernel@vger.kernel.org>; Thu, 20 Oct 2022 00:12:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1666249968; 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; bh=iSbqsg4g0J+uDTur4nOLOrDlqWhjBL7zIdyxmPl56wI=; b=JBb5P3wSgMJfLi30+oCzV1VB7373nMV1LjGrmE5PySTrSnLcUDznAXSMJLqhevPvEPh+04 y9A3rU8jSCrwd9X1/MrTdg+TqatO0kLy92WBGYgB92zwUCbJgd23V29Mxkv7XwDMvelXwS IOiTvgrqdg7L/pfQiPWFlt8kj0dfamk= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-636-Va38NGliOg6Us14EzfvzXA-1; Thu, 20 Oct 2022 03:12:44 -0400 X-MC-Unique: Va38NGliOg6Us14EzfvzXA-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C45BE101A52A; Thu, 20 Oct 2022 07:12:43 +0000 (UTC) Received: from gshan.redhat.com (vpn2-54-70.bne.redhat.com [10.64.54.70]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7703C40C6EC2; Thu, 20 Oct 2022 07:12:38 +0000 (UTC) From: Gavin Shan <gshan@redhat.com> To: kvmarm@lists.linux.dev Cc: kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, mail@maciej.szmigiero.name, maz@kernel.org, pbonzini@redhat.com, ajones@ventanamicro.com, shuah@kernel.org, peterx@redhat.com, oliver.upton@linux.dev, seanjc@google.com, ricarkol@google.com, zhenyzha@redhat.com, shan.gavin@gmail.com Subject: [PATCH v3 0/6] KVM: selftests: memslot_perf_test: aarch64 cleanup/fixes Date: Thu, 20 Oct 2022 15:12:03 +0800 Message-Id: <20221020071209.559062-1-gshan@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747189761739832531?= X-GMAIL-MSGID: =?utf-8?q?1747189761739832531?= |
Series |
KVM: selftests: memslot_perf_test: aarch64 cleanup/fixes
|
|
Message
Gavin Shan
Oct. 20, 2022, 7:12 a.m. UTC
kvm/selftests/memslots_perf_test doesn't work with 64KB-page-size-host and 4KB-page-size-guest on aarch64. In the implementation, the host and guest page size have been hardcoded to 4KB. It's ovbiously not working on aarch64 which supports 4KB, 16KB, 64KB individually on host and guest. This series tries to fix it. After the series is applied, the test runs successfully with 64KB-page-size-host and 4KB-page-size-guest. # ./memslots_perf_tests -v -s 512 Since we're here, the code is cleaned up a bit as PATCH[1-3] do. The other patches are fixes to handle the mismatched host/guest page sized. v1: https://lore.kernel.org/kvmarm/20221014071914.227134-1-gshan@redhat.com/T/#t v2: https://lore.kernel.org/kvmarm/20221018040454.405719-1-gshan@redhat.com/T/#t Changelog ========= v3: * Improved comments about MEM_TEST_MOVE_SIZE, which is set to 64KB in PATCH[v3 4/6] and finally fixed to 192KB in PATCH[v3 5/6]. (Maciej) * Use size instead of pages to do the comparison in test_memslot_move_prepare() (Maciej) * Use tools/include/linux/sizes.h instead of inventing our own macros. (Oliver) v2: * Pick the smaller value between the ones specified by user or probed from KVM_CAP_NR_MEMSLOTS in PATCH[v2 3/6] (Maciej) * Improved comments about MEM_TEST_MOVE_SIZE in PATCH[v2 4/6] (Maciej) * Avoid mismatched guest page size after VM is started in prepare_vm() in PATCH[v2 4/6] (Maciej) * Fix condition to check MEM_TEST_{UNMAP, UNMAP_CHUNK}_SIZE in check_memory_size() in PATCH[v2 4/6] (Maciej) * Define base and huge page size in kvm_util_base.h in PATCH[v2 5/6] (Sean) * Add checks on host/guest page size in check_memory_size() and fail early if any of them exceeds 64KB in PATCH[v2 5/6] (Maciej) Gavin Shan (6): KVM: selftests: memslot_perf_test: Use data->nslots in prepare_vm() KVM: selftests: memslot_perf_test: Consolidate loop conditions in prepare_vm() KVM: selftests: memslot_perf_test: Probe memory slots for once KVM: selftests: memslot_perf_test: Support variable guest page size KVM: selftests: memslot_perf_test: Consolidate memory KVM: selftests: memslot_perf_test: Report optimal memory slots .../testing/selftests/kvm/memslot_perf_test.c | 317 ++++++++++++------ 1 file changed, 208 insertions(+), 109 deletions(-)
Comments
On 20.10.2022 09:12, Gavin Shan wrote: > kvm/selftests/memslots_perf_test doesn't work with 64KB-page-size-host > and 4KB-page-size-guest on aarch64. In the implementation, the host and > guest page size have been hardcoded to 4KB. It's ovbiously not working > on aarch64 which supports 4KB, 16KB, 64KB individually on host and guest. > > This series tries to fix it. After the series is applied, the test runs > successfully with 64KB-page-size-host and 4KB-page-size-guest. > > # ./memslots_perf_tests -v -s 512 > > Since we're here, the code is cleaned up a bit as PATCH[1-3] do. The > other patches are fixes to handle the mismatched host/guest page > sized. > > v1: https://lore.kernel.org/kvmarm/20221014071914.227134-1-gshan@redhat.com/T/#t > v2: https://lore.kernel.org/kvmarm/20221018040454.405719-1-gshan@redhat.com/T/#t > > Changelog > ========= > v3: > * Improved comments about MEM_TEST_MOVE_SIZE, which is set > to 64KB in PATCH[v3 4/6] and finally fixed to 192KB in > PATCH[v3 5/6]. (Maciej) > * Use size instead of pages to do the comparison in > test_memslot_move_prepare() (Maciej) > * Use tools/include/linux/sizes.h instead of inventing > our own macros. (Oliver) > v2: > * Pick the smaller value between the ones specified by > user or probed from KVM_CAP_NR_MEMSLOTS in PATCH[v2 3/6] (Maciej) > * Improved comments about MEM_TEST_MOVE_SIZE in > PATCH[v2 4/6] (Maciej) > * Avoid mismatched guest page size after VM is started in > prepare_vm() in PATCH[v2 4/6] (Maciej) > * Fix condition to check MEM_TEST_{UNMAP, UNMAP_CHUNK}_SIZE > in check_memory_size() in PATCH[v2 4/6] (Maciej) > * Define base and huge page size in kvm_util_base.h in > PATCH[v2 5/6] (Sean) > * Add checks on host/guest page size in check_memory_size() > and fail early if any of them exceeds 64KB in PATCH[v2 5/6] (Maciej) > > > Gavin Shan (6): > KVM: selftests: memslot_perf_test: Use data->nslots in prepare_vm() > KVM: selftests: memslot_perf_test: Consolidate loop conditions in > prepare_vm() > KVM: selftests: memslot_perf_test: Probe memory slots for once > KVM: selftests: memslot_perf_test: Support variable guest page size > KVM: selftests: memslot_perf_test: Consolidate memory > KVM: selftests: memslot_perf_test: Report optimal memory slots > This patch set now looks good to me, so for the whole series: Reviewed-by: Maciej S. Szmigiero <maciej.szmigiero@oracle.com> Thanks, Maciej
On 10/25/22 7:18 AM, Maciej S. Szmigiero wrote: > On 20.10.2022 09:12, Gavin Shan wrote: >> kvm/selftests/memslots_perf_test doesn't work with 64KB-page-size-host >> and 4KB-page-size-guest on aarch64. In the implementation, the host and >> guest page size have been hardcoded to 4KB. It's ovbiously not working >> on aarch64 which supports 4KB, 16KB, 64KB individually on host and guest. >> >> This series tries to fix it. After the series is applied, the test runs >> successfully with 64KB-page-size-host and 4KB-page-size-guest. >> >> # ./memslots_perf_tests -v -s 512 >> >> Since we're here, the code is cleaned up a bit as PATCH[1-3] do. The >> other patches are fixes to handle the mismatched host/guest page >> sized. >> >> v1: https://lore.kernel.org/kvmarm/20221014071914.227134-1-gshan@redhat.com/T/#t >> v2: https://lore.kernel.org/kvmarm/20221018040454.405719-1-gshan@redhat.com/T/#t >> >> Changelog >> ========= >> v3: >> * Improved comments about MEM_TEST_MOVE_SIZE, which is set >> to 64KB in PATCH[v3 4/6] and finally fixed to 192KB in >> PATCH[v3 5/6]. (Maciej) >> * Use size instead of pages to do the comparison in >> test_memslot_move_prepare() (Maciej) >> * Use tools/include/linux/sizes.h instead of inventing >> our own macros. (Oliver) >> v2: >> * Pick the smaller value between the ones specified by >> user or probed from KVM_CAP_NR_MEMSLOTS in PATCH[v2 3/6] (Maciej) >> * Improved comments about MEM_TEST_MOVE_SIZE in >> PATCH[v2 4/6] (Maciej) >> * Avoid mismatched guest page size after VM is started in >> prepare_vm() in PATCH[v2 4/6] (Maciej) >> * Fix condition to check MEM_TEST_{UNMAP, UNMAP_CHUNK}_SIZE >> in check_memory_size() in PATCH[v2 4/6] (Maciej) >> * Define base and huge page size in kvm_util_base.h in >> PATCH[v2 5/6] (Sean) >> * Add checks on host/guest page size in check_memory_size() >> and fail early if any of them exceeds 64KB in PATCH[v2 5/6] (Maciej) >> >> >> Gavin Shan (6): >> KVM: selftests: memslot_perf_test: Use data->nslots in prepare_vm() >> KVM: selftests: memslot_perf_test: Consolidate loop conditions in >> prepare_vm() >> KVM: selftests: memslot_perf_test: Probe memory slots for once >> KVM: selftests: memslot_perf_test: Support variable guest page size >> KVM: selftests: memslot_perf_test: Consolidate memory >> KVM: selftests: memslot_perf_test: Report optimal memory slots >> > > This patch set now looks good to me, so for the whole series: > Reviewed-by: Maciej S. Szmigiero <maciej.szmigiero@oracle.com> > Thanks for your time on reviews, Maciej. The broken test case was reported in our downstream Linux, which means our downstream linux needs the improvements and fixes to make the test case working. Thanks, Gavin
Hi Marc, On 10/25/22 7:18 AM, Maciej S. Szmigiero wrote: > On 20.10.2022 09:12, Gavin Shan wrote: >> kvm/selftests/memslots_perf_test doesn't work with 64KB-page-size-host >> and 4KB-page-size-guest on aarch64. In the implementation, the host and >> guest page size have been hardcoded to 4KB. It's ovbiously not working >> on aarch64 which supports 4KB, 16KB, 64KB individually on host and guest. >> >> This series tries to fix it. After the series is applied, the test runs >> successfully with 64KB-page-size-host and 4KB-page-size-guest. >> >> # ./memslots_perf_tests -v -s 512 >> >> Since we're here, the code is cleaned up a bit as PATCH[1-3] do. The >> other patches are fixes to handle the mismatched host/guest page >> sized. >> >> v1: https://lore.kernel.org/kvmarm/20221014071914.227134-1-gshan@redhat.com/T/#t >> v2: https://lore.kernel.org/kvmarm/20221018040454.405719-1-gshan@redhat.com/T/#t >> >> Changelog >> ========= >> v3: >> * Improved comments about MEM_TEST_MOVE_SIZE, which is set >> to 64KB in PATCH[v3 4/6] and finally fixed to 192KB in >> PATCH[v3 5/6]. (Maciej) >> * Use size instead of pages to do the comparison in >> test_memslot_move_prepare() (Maciej) >> * Use tools/include/linux/sizes.h instead of inventing >> our own macros. (Oliver) >> v2: >> * Pick the smaller value between the ones specified by >> user or probed from KVM_CAP_NR_MEMSLOTS in PATCH[v2 3/6] (Maciej) >> * Improved comments about MEM_TEST_MOVE_SIZE in >> PATCH[v2 4/6] (Maciej) >> * Avoid mismatched guest page size after VM is started in >> prepare_vm() in PATCH[v2 4/6] (Maciej) >> * Fix condition to check MEM_TEST_{UNMAP, UNMAP_CHUNK}_SIZE >> in check_memory_size() in PATCH[v2 4/6] (Maciej) >> * Define base and huge page size in kvm_util_base.h in >> PATCH[v2 5/6] (Sean) >> * Add checks on host/guest page size in check_memory_size() >> and fail early if any of them exceeds 64KB in PATCH[v2 5/6] (Maciej) >> >> >> Gavin Shan (6): >> KVM: selftests: memslot_perf_test: Use data->nslots in prepare_vm() >> KVM: selftests: memslot_perf_test: Consolidate loop conditions in >> prepare_vm() >> KVM: selftests: memslot_perf_test: Probe memory slots for once >> KVM: selftests: memslot_perf_test: Support variable guest page size >> KVM: selftests: memslot_perf_test: Consolidate memory >> KVM: selftests: memslot_perf_test: Report optimal memory slots >> > > This patch set now looks good to me, so for the whole series: > Reviewed-by: Maciej S. Szmigiero <maciej.szmigiero@oracle.com> > If possible, could you please merge this series to 'next' branch either? I hope it can be merged early because our downstream needs the fixes to make the test case work. It's definitely fine to wait for more comments, but I haven't receive any more comments in last month :) Thanks, Gavin
On Thu, 20 Oct 2022 15:12:03 +0800, Gavin Shan wrote: > kvm/selftests/memslots_perf_test doesn't work with 64KB-page-size-host > and 4KB-page-size-guest on aarch64. In the implementation, the host and > guest page size have been hardcoded to 4KB. It's ovbiously not working > on aarch64 which supports 4KB, 16KB, 64KB individually on host and guest. > > This series tries to fix it. After the series is applied, the test runs > successfully with 64KB-page-size-host and 4KB-page-size-guest. > > [...] Applied to next, thanks! [1/6] KVM: selftests: memslot_perf_test: Use data->nslots in prepare_vm() commit: 3bfadb2325891d122771ce534336af531e93d7b2 [2/6] KVM: selftests: memslot_perf_test: Consolidate loop conditions in prepare_vm() commit: 2aae5e6795e1407334bb849f96f11c9051b959e2 [3/6] KVM: selftests: memslot_perf_test: Probe memory slots for once commit: 34396437b11f904fc61b272e3974f4c92868451b [4/6] KVM: selftests: memslot_perf_test: Support variable guest page size commit: 8675c6f226986ddb67752be22279a0e2385b197e [5/6] KVM: selftests: memslot_perf_test: Consolidate memory commit: 88a64e65484ef6b5cb09fe545d0dd00c950a1131 [6/6] KVM: selftests: memslot_perf_test: Report optimal memory slots commit: a69170c65acdf430e24fc1b6174dcc3aa501fe2f Cheers, M.