Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp1090697pxb; Sat, 17 Apr 2021 06:24:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxFAhlwb+W8vfaQFESKqZ6XxDKdaEFvNIDQFKgyXbss2+/yljmGQvDrDMekf2+IkXTySJQZ X-Received: by 2002:a17:906:dc92:: with SMTP id cs18mr13470692ejc.27.1618665852082; Sat, 17 Apr 2021 06:24:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618665852; cv=none; d=google.com; s=arc-20160816; b=a8IXOAW/A3LVG4gTG90Rwihitmn1YapOQ3z3hYDRON1+ZG2upRRP/E5mfLsu6krj6I Hz97KNqchiy0kreN5qLC5RTRAx9Z1gpbVr/fCUUhlNNg7a8ocDiissozA4I0KQerG04M 7ULBZp3L7L3/TQUYHNjNjRUFHyKZg9cFso+juSk9tVV9mqsBrWGWgl92p1HbzMVi+qXj 6a5Pv9kDynO7NkiiKegSeWiqYHwmcfm6BxZk2lMpTKzf8k38017mMXNwdt2svdwFa40e T9b3rOTpMc6dyqfDz2Hmd9v9yVk0ROospL90sGZwP8e8Y3nDrElHDeOpN5ZOTflQHjGx DX/w== 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:from:references :cc:to:subject:dkim-signature; bh=uy+wTYY2LmEUbjzC1DEbNzxYstTZTEjdM/GOp0GYn/g=; b=SN1c9bX6MruzMp6qCpSmyjNpYw4s7c6rJgBkDd7yvoFwX1K421IS8WhJDdVS3rIlzf NYtMo+zmIRlmYzJQSMr8BMnVOH2M4nakSv0UgxkRgsEO/G4VolJVbguRzRPqYmzFMakI d33CzpsvjunuIZb4+OKnhXlhxKZtTR5qdcGu9cB6pzMXURsfCKY2W0dv8tBaACGopAa+ LD14T/Mf6M1Iyv6EUJrME47Qlay8jDqQYmoOYw6/XE7mG3yzU+mETbtLPz79a2C2zUau VJqQDdvtNWyq7QaraiHJOQAS9T8khd++Fx6t7F3eAzfr90CVcsWPCDBaZfhgAniRayMd s5CQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=eF632MPE; 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 cq21si6632461ejc.542.2021.04.17.06.23.47; Sat, 17 Apr 2021 06:24:12 -0700 (PDT) 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=eF632MPE; 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 S236129AbhDQNXY (ORCPT + 99 others); Sat, 17 Apr 2021 09:23:24 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:31785 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230442AbhDQNXX (ORCPT ); Sat, 17 Apr 2021 09:23:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1618665776; 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=uy+wTYY2LmEUbjzC1DEbNzxYstTZTEjdM/GOp0GYn/g=; b=eF632MPEuaDmEN0kX0xcUnwGul+uQcPo+ke8JZKUzC43x/SGl6JoZB6CXMcsSLFcdG3e9l WDuEXCB+pBn+qkYwV6xtw/mg1iOKksBQLeoTj3IwYxPg3R3yuc0yvtmm1PPp9379eDCfU1 krGp95i6wdccBwtT8D9Xv23QW6rOpHY= Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-523-2lIPtZAtM_KfFHkie38B1Q-1; Sat, 17 Apr 2021 09:22:54 -0400 X-MC-Unique: 2lIPtZAtM_KfFHkie38B1Q-1 Received: by mail-ed1-f71.google.com with SMTP id s4-20020a0564021644b0290384e9a246a7so5029578edx.7 for ; Sat, 17 Apr 2021 06:22:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=uy+wTYY2LmEUbjzC1DEbNzxYstTZTEjdM/GOp0GYn/g=; b=iat+F72+i4V7vME+rX4qdytrKoYEjy31x3QasB6LqNRwTZIk3T1sCRJNJkaM9sXcOX IO15gFBrgHnnwNHYh2zsJ14VsHaposyyChP7d9MQIuFXaWxprTu5fRCvHM/SzKR/Ma78 qVvTrAfAZZ5jqRensGDBZJPQpTdvgb6hhTk4z6edBY6GhvUGLjL7eewZ360ZVtQo+NFZ zHlvsm7vx6ded7+iJKbJvKKUVBP9AU/POIU1d5IWT1fopJqrkabxRTpUuo6VJf2OQBAO lpfLoauSVAvLu0vILbU59vSijniAixnWTXs0/ROQAczxlXotYM9d+6rsoztP6IFnSelV lddA== X-Gm-Message-State: AOAM533jsmea6TOsEZaiLVTkz2l2vN9rKel4poPaZT1j45JuF7faljyJ ubO+Gonr8Sx5XoGkWrCfCwEdChAf0LlER89EmDQ1TvwgqL29UMS7bpIEo5IZB9yn1ZaOcZ1iLlG CgkzLkVtrB8LUESX63y3FFNwF X-Received: by 2002:a17:906:2cd1:: with SMTP id r17mr12893549ejr.429.1618665773657; Sat, 17 Apr 2021 06:22:53 -0700 (PDT) X-Received: by 2002:a17:906:2cd1:: with SMTP id r17mr12893533ejr.429.1618665773412; Sat, 17 Apr 2021 06:22:53 -0700 (PDT) Received: from ?IPv6:2001:b07:6468:f312:c8dd:75d4:99ab:290a? ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id f20sm3188595ejw.36.2021.04.17.06.22.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 17 Apr 2021 06:22:52 -0700 (PDT) Subject: Re: [PATCH v6 00/10] KVM: selftests: some improvement and a new test for kvm page table To: "wangyanan (Y)" , kvm@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Andrew Jones , Ben Gardon , Sean Christopherson , Vitaly Kuznetsov , Peter Xu , Ingo Molnar , Adrian Hunter , Jiri Olsa , Arnaldo Carvalho de Melo , Arnd Bergmann , Michael Kerrisk , Thomas Gleixner , wanghaibin.wang@huawei.com, yuzenghui@huawei.com References: <20210330080856.14940-1-wangyanan55@huawei.com> <31ab81be-bf14-62f3-d579-9685ccec578a@huawei.com> From: Paolo Bonzini Message-ID: <62d02fe3-da49-5c75-d8be-177c7b2b129f@redhat.com> Date: Sat, 17 Apr 2021 15:22:51 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: <31ab81be-bf14-62f3-d579-9685ccec578a@huawei.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/04/21 05:05, wangyanan (Y) wrote: > Kindly ping... > > Hi Paolo, > Will this series be picked up soon, or is there any other work for me to > do? > > Regards, > Yanan > > > On 2021/3/30 16:08, Yanan Wang wrote: >> Hi, >> This v6 series can mainly include two parts. >> Rebased on kvm queue branch: >> https://git.kernel.org/pub/scm/virt/kvm/kvm.git/log/?h=queue >> >> In the first part, all the known hugetlb backing src types specified >> with different hugepage sizes are listed, so that we can specify use >> of hugetlb source of the exact granularity that we want, instead of >> the system default ones. And as all the known hugetlb page sizes are >> listed, it's appropriate for all architectures. Besides, a helper that >> can get granularity of different backing src types(anonumous/thp/hugetlb) >> is added, so that we can use the accurate backing src granularity for >> kinds of alignment or guest memory accessing of vcpus. >> >> In the second part, a new test is added: >> This test is added to serve as a performance tester and a bug reproducer >> for kvm page table code (GPA->HPA mappings), it gives guidance for the >> people trying to make some improvement for kvm. And the following >> explains >> what we can exactly do through this test. >> >> The function guest_code() can cover the conditions where a single vcpu or >> multiple vcpus access guest pages within the same memory region, in three >> VM stages(before dirty logging, during dirty logging, after dirty >> logging). >> Besides, the backing src memory type(ANONYMOUS/THP/HUGETLB) of the tested >> memory region can be specified by users, which means normal page mappings >> or block mappings can be chosen by users to be created in the test. >> >> If ANONYMOUS memory is specified, kvm will create normal page mappings >> for the tested memory region before dirty logging, and update attributes >> of the page mappings from RO to RW during dirty logging. If THP/HUGETLB >> memory is specified, kvm will create block mappings for the tested memory >> region before dirty logging, and split the blcok mappings into normal >> page >> mappings during dirty logging, and coalesce the page mappings back into >> block mappings after dirty logging is stopped. >> >> So in summary, as a performance tester, this test can present the >> performance of kvm creating/updating normal page mappings, or the >> performance of kvm creating/splitting/recovering block mappings, >> through execution time. >> >> When we need to coalesce the page mappings back to block mappings after >> dirty logging is stopped, we have to firstly invalidate *all* the TLB >> entries for the page mappings right before installation of the block >> entry, >> because a TLB conflict abort error could occur if we can't invalidate the >> TLB entries fully. We have hit this TLB conflict twice on aarch64 >> software >> implementation and fixed it. As this test can imulate process from dirty >> logging enabled to dirty logging stopped of a VM with block mappings, >> so it can also reproduce this TLB conflict abort due to inadequate TLB >> invalidation when coalescing tables. >> >> Links about the TLB conflict abort: >> https://lore.kernel.org/lkml/20201201201034.116760-3-wangyanan55@huawei.com/ >> >> >> --- >> >> Change logs: >> >> v5->v6: >> - Address Andrew Jones's comments for v5 series >> - Add Andrew Jones's R-b tags in some patches >> - Rebased on newest kvm/queue tree >> - v5: >> https://lore.kernel.org/lkml/20210323135231.24948-1-wangyanan55@huawei.com/ >> >> >> v4->v5: >> - Use synchronization(sem_wait) for time measurement >> - Add a new patch about TEST_ASSERT(patch 4) >> - Address Andrew Jones's comments for v4 series >> - Add Andrew Jones's R-b tags in some patches >> - v4: >> https://lore.kernel.org/lkml/20210302125751.19080-1-wangyanan55@huawei.com/ >> >> >> v3->v4: >> - Add a helper to get system default hugetlb page size >> - Add tags of Reviewed-by of Ben in the patches >> - v3: >> https://lore.kernel.org/lkml/20210301065916.11484-1-wangyanan55@huawei.com/ >> >> >> v2->v3: >> - Add tags of Suggested-by, Reviewed-by in the patches >> - Add a generic micro to get hugetlb page sizes >> - Some changes for suggestions about v2 series >> - v2: >> https://lore.kernel.org/lkml/20210225055940.18748-1-wangyanan55@huawei.com/ >> >> >> v1->v2: >> - Add a patch to sync header files >> - Add helpers to get granularity of different backing src types >> - Some changes for suggestions about v1 series >> - v1: >> https://lore.kernel.org/lkml/20210208090841.333724-1-wangyanan55@huawei.com/ >> >> >> --- >> >> Yanan Wang (10): >>    tools headers: sync headers of asm-generic/hugetlb_encode.h >>    mm/hugetlb: Add a macro to get HUGETLB page sizes for mmap >>    KVM: selftests: Use flag CLOCK_MONOTONIC_RAW for timing >>    KVM: selftests: Print the errno besides error-string in TEST_ASSERT >>    KVM: selftests: Make a generic helper to get vm guest mode strings >>    KVM: selftests: Add a helper to get system configured THP page size >>    KVM: selftests: Add a helper to get system default hugetlb page size >>    KVM: selftests: List all hugetlb src types specified with page sizes >>    KVM: selftests: Adapt vm_userspace_mem_region_add to new helpers >>    KVM: selftests: Add a test for kvm page table code >> >>   include/uapi/linux/mman.h                     |   2 + >>   tools/include/asm-generic/hugetlb_encode.h    |   3 + >>   tools/include/uapi/linux/mman.h               |   2 + >>   tools/testing/selftests/kvm/.gitignore        |   1 + >>   tools/testing/selftests/kvm/Makefile          |   3 + >>   .../selftests/kvm/demand_paging_test.c        |   8 +- >>   .../selftests/kvm/dirty_log_perf_test.c       |  14 +- >>   .../testing/selftests/kvm/include/kvm_util.h  |   4 +- >>   .../testing/selftests/kvm/include/test_util.h |  21 +- >>   .../selftests/kvm/kvm_page_table_test.c       | 506 ++++++++++++++++++ >>   tools/testing/selftests/kvm/lib/assert.c      |   4 +- >>   tools/testing/selftests/kvm/lib/kvm_util.c    |  59 +- >>   tools/testing/selftests/kvm/lib/test_util.c   | 163 +++++- >>   tools/testing/selftests/kvm/steal_time.c      |   4 +- >>   14 files changed, 733 insertions(+), 61 deletions(-) >>   create mode 100644 tools/testing/selftests/kvm/kvm_page_table_test.c >> > Queued, thanks. I moved MAP_HUGE_PAGE_SIZE from the uapi header to test_util.c, because I'm not confident in adding a new userspace API without an ack. Paolo