Received: by 2002:ab3:689a:0:b0:1da:d01c:d2b2 with SMTP id t26csp10405ltj; Fri, 19 Aug 2022 16:09:49 -0700 (PDT) X-Google-Smtp-Source: AA6agR7rejS/wCk7mBBG9GlPn2Xmtu0M/SXY1uhpz/B8C7iL0Zz5zNFXnCXXFN6VazIZpJB5Ea3q X-Received: by 2002:a17:907:c07:b0:730:b91b:2cab with SMTP id ga7-20020a1709070c0700b00730b91b2cabmr6379705ejc.294.1660950589602; Fri, 19 Aug 2022 16:09:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660950589; cv=none; d=google.com; s=arc-20160816; b=xECou21uS/X5MagkqgxwNvTJiY7eIZ4A9ZGtlRJ4ywzwoYqPjn/vZoZX5rCbtM/JXa AVtOpO+bieyRwKfRob12qHLS4wL5+YXxDHTap20xgY/gFNrmFzB+EcMF9wjsEe+/DIAf GSKtMPvfBjmPid+/rpbeRNDFmN7XBVFJkeCzZ1EXhhu2ZsM3pwSUgXovJm1ENVuA4YA7 TbnIcEX1Sw96g6+8FnJaXqnzvK+ZDYf2HS1d7ktJjJBC9XQiX7V6uyezZ9ylE/6WJQQ8 qM2TUEx2OsrM1FpKJ7waYfSqW9uO6Ke+qLck5frVSmmc4FzLUlYy9+U3CwFO7pgqiani JVtw== 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=QKWjYXFerma2OlVk5dsGDZjSEP28S8+hN7GuH8FnvhQ=; b=A7ZkySE4vWjib107Og62JSFzkgr03WK5bHax+2HOevY3QlIKQKvqZ0qmP0Nt1dG9Z2 sRZ2EY5cIpjsKkY0J2HTj2Y8w7ABMEkfs10ZihL1HIfvUU113df01WW1lKyoooPg6AVn XRaBEVEL5QIdvGGwOcQBQk4Nmy+SIXASeUmyd+ZqAsNAxnnr0ZBM1jskC93mXIIAukaP Lu5n+wDWIAt/3+FhMhKDPz4di1eDPTk4rpIjJI7af4G5yrgaqX5e6yAWuULnAaQ7dEzM Qb3yqCAam1Jjm4V7r94DDBr3zueIHCv3ZMLu2yxktQ1gfsNpILJ+hKrAHdW9js7Zz4wt wDLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=d1jJCRYG; 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 sh33-20020a1709076ea100b00733ca35c096si3881313ejc.592.2022.08.19.16.09.00; Fri, 19 Aug 2022 16:09:49 -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=d1jJCRYG; 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 S242010AbiHSW7f (ORCPT + 99 others); Fri, 19 Aug 2022 18:59:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50158 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237948AbiHSW7c (ORCPT ); Fri, 19 Aug 2022 18:59:32 -0400 Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 18BADDF66A for ; Fri, 19 Aug 2022 15:59:32 -0700 (PDT) Received: by mail-pj1-x1031.google.com with SMTP id o5-20020a17090a3d4500b001ef76490983so6150394pjf.2 for ; Fri, 19 Aug 2022 15:59:32 -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; bh=QKWjYXFerma2OlVk5dsGDZjSEP28S8+hN7GuH8FnvhQ=; b=d1jJCRYGOv1yf1Eu0czHJiIo2g8CpEQ/7DQVIywWMD0fpQ2pZPznVBPILhtzVdNfol jlEz8U3FaF4njxzFl6Km4vxqwIkGEUrS5hBbzljafkSVB1zSBgsmnwnHb/n7x8MDsr7F 9dUqKa3X9kUKFM5J57HAD78RD0Ae3uhnbGQLwQ69UglWEGDzigxtE9MXZi+aA9KUWHIH YlotjzQoF89T4F7BYt2ND5zdlWmRf7+qUsEaruTn2GvvspnCOZNM9nbgMcpm+2fn8uB6 o48x13Q/fEZoA5NbT58rmShHkQbjcyRft2D/RgqwHd3drOlBO2Oom3DT8qiw4fzMZNVu 7Y2w== 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; bh=QKWjYXFerma2OlVk5dsGDZjSEP28S8+hN7GuH8FnvhQ=; b=w5lIbZs8sImVRPVGfUfGi3ZXkSIx9y01F/54WpsMz53GuoOhyLywNbFeJLbyvwwsFe +PFsPA5dX5Sb5zCzf0LYA6KS9kt2frcw6+aHwgWn90GUVHPunEA1zHvLwuNuGvlEXscL iKwh7SnDuLOIPkDzv1QmZYDb3MXHUkeNp5WYKnzdVLdpSUF22pHzV9/rY/F8RTue7lEb 6eNZdGdygekF2Udr0udPgdkwNLxpdVkMpc0tcPDMaGO+AS8KOtsrTYy0s8eT9eymLh3a sCqW6sF+zkzpLb4zY8mODdmY2eGd69+cDj6hwrookz4MXncOPIfbu0CVGu3gXXAfjkNH LXNQ== X-Gm-Message-State: ACgBeo1bQ6r0vHmWzENTjod5f2ZcuhZ3pXBYQ5A4KCOugJ2Y6Z3fGe9h ouB59tsE5y7yGlyJx5KvkkOlAg== X-Received: by 2002:a17:903:2452:b0:172:cf0a:d137 with SMTP id l18-20020a170903245200b00172cf0ad137mr1119670pls.95.1660949971336; Fri, 19 Aug 2022 15:59:31 -0700 (PDT) Received: from google.com (7.104.168.34.bc.googleusercontent.com. [34.168.104.7]) by smtp.gmail.com with ESMTPSA id a4-20020a1709027e4400b0016d6420691asm3614985pln.207.2022.08.19.15.59.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Aug 2022 15:59:30 -0700 (PDT) Date: Fri, 19 Aug 2022 22:59:27 +0000 From: Sean Christopherson To: David Matlack Cc: Vipin Sharma , pbonzini@redhat.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] KVM: selftests: Run dirty_log_perf_test on specific cpus Message-ID: References: <20220819210737.763135-1-vipinsh@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-14.4 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,FSL_HELO_FAKE,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=no 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 Fri, Aug 19, 2022, David Matlack wrote: > On Fri, Aug 19, 2022 at 03:20:06PM -0700, Vipin Sharma wrote: > > On Fri, Aug 19, 2022 at 2:38 PM David Matlack wrote: > > > I think we should move all the logic to pin threads to perf_test_util.c. > > > The only thing dirty_log_perf_test.c should do is pass optarg into > > > perf_test_util.c. This will make it trivial for any other test based on > > > pef_test_util.c to also use pinning. > > > > > > e.g. All a test needs to do to use pinning is add a flag to the optlist > > > and add a case statement like: > > > > > > case 'c': > > > perf_test_setup_pinning(optarg); > > > break; > > > > > > perf_test_setup_pinning() would: > > > - Parse the list and populate perf_test_vcpu_args with each vCPU's > > > assigned pCPU. > > > - Pin the current thread to it's assigned pCPU if one is provided. > > > > > > > This will assume all tests have the same pinning requirement and > > format. What if some tests have more than one worker threads after the > > vcpus? > > Even if a test has other worker threads, this proposal would still be > logically consistent. The flag is defined to only control the vCPU > threads and the main threads. If some test has some other threads > besides that, this flag will not affect them (which is exactly how it's > defined to behave). If such a test wants to pin those other threads, it > would make sense to have a test-specific flag for that pinning (and we > can figure out the right way to do that if/when we encounter that > situation). ... > Yeah and I also realized perf_test_setup_pinning() will need to know how > many vCPUs there are so it can determine which element is the main > thread's pCPU assignment. The "how many workers you got?" conundrum can be solved in the same way, e.g. just have the caller pass in the number of workers it will create. perf_test_setup_pinning(pin_string, nr_vcpus, NR_WORKERS); The only question is what semantics we should support for workers, e.g. do we want to force an all-or-none approach or can the user pin a subset. All-or-none seems like it'd be the simplest to maintain and understand. I.e. if -c is used, then all vCPUs must be pinned, and either all workers or no workers are pinned.