Message ID | 20221103191719.1559407-1-vipinsh@google.com |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp721188wru; Thu, 3 Nov 2022 12:20:27 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4n+qovSYkyPjYultGb9Mtg7a/gkc2g8NS6QT/Htw3ElnzsSifaFLUzi2molZUD5qBNzGEw X-Received: by 2002:a05:6402:5288:b0:457:22e5:8022 with SMTP id en8-20020a056402528800b0045722e58022mr8460088edb.244.1667503226829; Thu, 03 Nov 2022 12:20:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667503226; cv=none; d=google.com; s=arc-20160816; b=EFpw2rFocvYOqFlHV1ZEa3JL4HtOzt3WoBKlt6rkGEo+RV/5r9LEufWMalNAI8Fag3 9vK+tVAogPYibYDVmp0snGKTM9HEhsLCfYWrKB9U240tC0mcS7C/1qyiLwmgbkr1EOOV 2A6kl4IjCw2V9rE9B17mN8O1ztOSSM6Zuee1W6MChU5p9pQskjHcUaXoDveIMbKw6vk2 seAEqQARgg2U3SuHrOTJyOTlvtx1IhPORpRGD/QP+Kx3phQHnaMhkb0lNAieuqeZSfn5 u+9Wx7D97ayd/5pWbqTYbw1zYgaxwAf44x18lX/sksJ+QN4dBwRKF17pNkUSzNU3mGuo j8AA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:mime-version:date :dkim-signature; bh=V5ShnTa1jHvkmSSuOGq0oPwfWcLkpSb0qmkA9knQiXw=; b=rOeOxr2hySYrwMutfLFdXRU5Lp/IbQduSn3QHQPmiUnmi/ce/7GEy8Z99tUDNVX0oo htD5Cf+sWZAW1pv9ZrI5ljwoBhVJEZdmyd2DE9U1PL1gu6hQBusu2cg4I68WcBEgwT6g ca88kI+6niZA32MEcqbIOTyzOO4d1NmUHicHUo2gWo3TKGSYjk1y4jgwN38O3N/FiCxw XcSqOlRIonn7qPuAeb1VStQITlq9RiMr525UhIjGdP+yGWvNmIrQRSCAEj9s/aVf2yCj RG1JDdj8CqouEsTIS8sgecVBJRgCxzdguys7Tb6fT7V7alY57AvxySMQCImsH9qedMJG egtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=IRzHdInd; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n21-20020aa7c455000000b0045fca739593si2052039edr.188.2022.11.03.12.20.00; Thu, 03 Nov 2022 12:20:26 -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=IRzHdInd; 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 S231747AbiKCTTn (ORCPT <rfc822;yves.mi.zy@gmail.com> + 99 others); Thu, 3 Nov 2022 15:19:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231674AbiKCTT0 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 3 Nov 2022 15:19:26 -0400 Received: from mail-pg1-x54a.google.com (mail-pg1-x54a.google.com [IPv6:2607:f8b0:4864:20::54a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C9EE21270 for <linux-kernel@vger.kernel.org>; Thu, 3 Nov 2022 12:17:40 -0700 (PDT) Received: by mail-pg1-x54a.google.com with SMTP id f19-20020a63f113000000b0046fde69a09dso1344034pgi.10 for <linux-kernel@vger.kernel.org>; Thu, 03 Nov 2022 12:17:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=V5ShnTa1jHvkmSSuOGq0oPwfWcLkpSb0qmkA9knQiXw=; b=IRzHdInd99dJ5ML8O2zTA4ZFKkv3y+Vb5wCpQoLer2QrtN/hsVttQnpX1NfUwz4Vw1 QNlOliKRei9dLkR5VIgUmyAmLxmJbf3oNlH94ASVN7gtEe9YqNzKV5NmfKF6mxJiBuFZ VEbzL9/GbjU5I43jQmECYMtNaVSV7CUAZBBF5T66ftBv7QMPe7CCzB35yvnAFA2Ka/ej 5ERkY19pNCgvDd9WS03HSeZjnt30iYLtRDJcooR2DkasrqxsY8J2ohFVZ8gvg1VfoJgN Les++RyICut+ftVun0JgrjV8om4gu3ArE20yABLC694g+JhWbvJzflzRhfkARKZLBtTx 7q9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=V5ShnTa1jHvkmSSuOGq0oPwfWcLkpSb0qmkA9knQiXw=; b=1NbSAYnTjVS5ZeH9T4WwU1/jwXPXlC/hRSTZSA1uN82cE9z+7BQ+syCLSMcANeqsG7 EKbkPufWlabDKg3/XApwbesxQe8HtbYPzaZ6FC1VnAmE70+fuZjPk6N+urcOX3yzixHl tvR3gY8b+EtfMRhtIfZ+06RV0d6N9hS4dMQQbt4vtb8dKs/d/xalRy2jI7xS+02WsOBE uoRYve4cHCIS7aHaf8ySImk73sa9121PMZmXW9xw3OPPm4FeJ2bz7VYoEWoBmfkuJxpO Q4p8WsPrB1ANTpbtFnKsYv+RgUjtthh1H5QC/LDVonJ3pSTgsn50gFsZ4/L75QoXQjLj KkBA== X-Gm-Message-State: ACrzQf0ewzaG2lJMkgQJOq0zLvof1je8ndB5beB081TBNSFHaIHV5kgK a+LcbHdZp4xhSoDKcvcrUWTM6lonBm6o X-Received: from vipin.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:479f]) (user=vipinsh job=sendgmr) by 2002:a17:90a:f291:b0:20a:eab5:cf39 with SMTP id fs17-20020a17090af29100b0020aeab5cf39mr144116pjb.1.1667503045409; Thu, 03 Nov 2022 12:17:25 -0700 (PDT) Date: Thu, 3 Nov 2022 12:17:12 -0700 Mime-Version: 1.0 X-Mailer: git-send-email 2.38.1.273.g43a17bfeac-goog Message-ID: <20221103191719.1559407-1-vipinsh@google.com> Subject: [PATCH v9 0/7] dirty_log_perf_test vCPU pinning From: Vipin Sharma <vipinsh@google.com> To: seanjc@google.com, pbonzini@redhat.com, dmatlack@google.com Cc: andrew.jones@linux.dev, wei.w.wang@intel.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Vipin Sharma <vipinsh@google.com> Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=unavailable 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?1748503863450220263?= X-GMAIL-MSGID: =?utf-8?q?1748503863450220263?= |
Series |
dirty_log_perf_test vCPU pinning
|
|
Message
Vipin Sharma
Nov. 3, 2022, 7:17 p.m. UTC
Pin vCPUs to a host physical CPUs (pCPUs) in dirty_log_perf_test and optionally pin the main application thread to a physical cpu if provided. While at it, I changed following: 1. atoi() replaced with atoi_paranoid(), atoi_positive and atoi_non_negative() 2. Sorted the command line options alphabetically in dirty_log_perf_test. 3. Added the missing break between -e and -g in dirty_log_perf_test.c 4. Replaced size_1gb in max_guest_memory_test.c with SZ_* macros from sizes.h. 5. Shortened the test args name in memslot_modification_stress_test.c v9: - Changed commit message of patch 4. - Changed some line wrapping in memslot_modification_stress_test.c - Added Reviewed-by and Suggested-by. v8: https://lore.kernel.org/lkml/20221102232737.1351745-1-vipinsh@google.com/ - Changed atoi_positive() and atoi_non_negative() to accept variable name also. - Moved atoi_positive() and atoi_non_negative() definition to test_util.h - Removed new line character from TEST_ASSERT() statements. - Using official SZ_1G from sizes.h header file in max_guest_memory_test.c - Shortened test args name in memslot_modification_stress_test.c v7: https://lore.kernel.org/lkml/20221031173819.1035684-1-vipinsh@google.com/ - Moved pinning APIs from perf_test_util.c to kvm_util.c. - Missed one atoi() call in aarch64/debug-exceptions.c, changed it to atoi_positive(). v6: https://lore.kernel.org/lkml/20221021211816.1525201-1-vipinsh@google.com/ - Updated the shortlog of Patch 5. - Changed formatting of help text of -c in dirty_log_perf_test v5: https://lore.kernel.org/lkml/20221010220538.1154054-1-vipinsh@google.com/ - Added atoi_postive() and atoi_non_negative() APIs for string parsing. - Using sched_getaffinity() to verify if a pCPU is allowed or not. - Changed Suggested-by to add only person came up with original idea of pinning. - Updated strings and commit messages. v4: https://lore.kernel.org/lkml/20221006171133.372359-1-vipinsh@google.com/ - Moved boolean to check vCPUs pinning from perf_test_vcpu_args to perf_test_args. - Changed assert statements to make error more descriptive. - Modified break statement between 'e' and 'g' option in v3 by not copying dirty_log_manual_caps = 0 to 'e'. v3: https://lore.kernel.org/lkml/20220826184500.1940077-1-vipinsh@google.com - Moved atoi_paranoid() to test_util.c and replaced all atoi() usage with atoi_paranoid() - Sorted command line options alphabetically. - Instead of creating a vcpu thread on a specific pcpu the thread will migrate to the provided pcpu after its creation. - Decoupled -e and -g option. v2: https://lore.kernel.org/lkml/20220819210737.763135-1-vipinsh@google.com/ - Removed -d option. - One cpu list passed as option, cpus for vcpus, followed by application thread cpu. - Added paranoid cousin of atoi(). v1: https://lore.kernel.org/lkml/20220817152956.4056410-1-vipinsh@google.com Vipin Sharma (7): KVM: selftests: Add missing break between -e and -g option in dirty_log_perf_test KVM: selftests: Put command line options in alphabetical order in dirty_log_perf_test KVM: selftests: Add atoi_paranoid() to catch errors missed by atoi() KVM: selftests: Use SZ_* macros from sizes.h in max_guest_memory_test.c KVM: selftests: Shorten the test args in memslot_modification_stress_test.c KVM: selftests: Add atoi_positive() and atoi_non_negative() for input validation KVM: selftests: Allowing running dirty_log_perf_test on specific CPUs .../selftests/kvm/aarch64/arch_timer.c | 25 ++------ .../selftests/kvm/aarch64/debug-exceptions.c | 2 +- .../testing/selftests/kvm/aarch64/vgic_irq.c | 6 +- .../selftests/kvm/access_tracking_perf_test.c | 2 +- .../selftests/kvm/demand_paging_test.c | 4 +- .../selftests/kvm/dirty_log_perf_test.c | 64 +++++++++++++------ .../selftests/kvm/include/kvm_util_base.h | 4 ++ .../selftests/kvm/include/perf_test_util.h | 4 ++ .../testing/selftests/kvm/include/test_util.h | 18 ++++++ .../selftests/kvm/kvm_page_table_test.c | 4 +- tools/testing/selftests/kvm/lib/kvm_util.c | 54 ++++++++++++++++ .../selftests/kvm/lib/perf_test_util.c | 8 ++- tools/testing/selftests/kvm/lib/test_util.c | 19 ++++++ .../selftests/kvm/max_guest_memory_test.c | 21 +++--- .../kvm/memslot_modification_stress_test.c | 22 +++---- .../testing/selftests/kvm/memslot_perf_test.c | 24 ++----- .../selftests/kvm/set_memory_region_test.c | 2 +- .../selftests/kvm/x86_64/nx_huge_pages_test.c | 5 +- 18 files changed, 190 insertions(+), 98 deletions(-)