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 X-Spam-Level: X-Spam-Status: No, score=-5.5 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4FDB2C433DB for ; Wed, 10 Feb 2021 04:13:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 01A9C64DED for ; Wed, 10 Feb 2021 04:13:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229894AbhBJEMa (ORCPT ); Tue, 9 Feb 2021 23:12:30 -0500 Received: from szxga01-in.huawei.com ([45.249.212.187]:4624 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229684AbhBJEMY (ORCPT ); Tue, 9 Feb 2021 23:12:24 -0500 Received: from dggeme718-chm.china.huawei.com (unknown [172.30.72.55]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4Db5rv0y7TzY6gS; Wed, 10 Feb 2021 12:10:23 +0800 (CST) Received: from [10.174.187.128] (10.174.187.128) by dggeme718-chm.china.huawei.com (10.1.199.114) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2106.2; Wed, 10 Feb 2021 12:11:38 +0800 Subject: Re: [RFC PATCH 1/2] KVM: selftests: Add a macro to get string of vm_mem_backing_src_type To: Sean Christopherson , Ben Gardon CC: kvm , , LKML , Paolo Bonzini , Shuah Khan , Andrew Jones , Marc Zyngier , Peter Xu , Aaron Lewis , Vitaly Kuznetsov , , References: <20210208090841.333724-1-wangyanan55@huawei.com> <20210208090841.333724-2-wangyanan55@huawei.com> From: "wangyanan (Y)" Message-ID: Date: Wed, 10 Feb 2021 12:11:37 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Originating-IP: [10.174.187.128] X-ClientProxiedBy: dggeme718-chm.china.huawei.com (10.1.199.114) To dggeme718-chm.china.huawei.com (10.1.199.114) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021/2/10 1:35, Sean Christopherson wrote: > On Tue, Feb 09, 2021, Ben Gardon wrote: >> On Tue, Feb 9, 2021 at 3:21 AM wangyanan (Y) wrote: >>> >>> On 2021/2/9 2:13, Ben Gardon wrote: >>>> On Mon, Feb 8, 2021 at 1:08 AM Yanan Wang wrote: >>>>> Add a macro to get string of the backing source memory type, so that >>>>> application can add choices for source types in the help() function, >>>>> and users can specify which type to use for testing. >>>> Coincidentally, I sent out a change last week to do the same thing: >>>> "KVM: selftests: Add backing src parameter to dirty_log_perf_test" >>>> (https://lkml.org/lkml/2021/2/2/1430) >>>> Whichever way this ends up being implemented, I'm happy to see others >>>> interested in testing different backing source types too. >>> Thanks Ben! I have a little question here. >>> >>> Can we just present three IDs (0/1/2) but not strings for users to >>> choose which backing_src_type to use like the way of guest modes, >> That would be fine with me. The string names are easier for me to read >> than an ID number (especially if you were to add additional options >> e.g. 1G hugetlb or file backed / shared memory) but it's mostly an >> aesthetic preference, so I don't have strong feelings either way. > I vote to expose/consume strings, being able to do ".dirty_log_perf_test --help" > and understand the backing options without having to dig into source was super > nice. > . Fine then:), I will make some change based on (https://lkml.org/lkml/2021/2/2/1430), thanks!