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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3B424C32773 for ; Thu, 18 Aug 2022 18:10:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345322AbiHRSKX (ORCPT ); Thu, 18 Aug 2022 14:10:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45084 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239465AbiHRSKV (ORCPT ); Thu, 18 Aug 2022 14:10:21 -0400 Received: from mail-pg1-x52d.google.com (mail-pg1-x52d.google.com [IPv6:2607:f8b0:4864:20::52d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A468FC742B for ; Thu, 18 Aug 2022 11:10:20 -0700 (PDT) Received: by mail-pg1-x52d.google.com with SMTP id 202so1873148pgc.8 for ; Thu, 18 Aug 2022 11:10:20 -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=JxS+AoR5Z3foSOY0+Ar8q8SgaAJrMyNQbT23W/mzpcs=; b=pDBiETRhCQPgQUMPJo71oWtyuM2YJ25T136p6RiNEeBwMmgO+CWZTnya8KTA4m5aq3 DpQ6s4oTeP6yCi93Dy7qah50UvleNLcY8xCyhCzlJ41h7uwycxitT1LhPzNXBwpB2gqp 4q0CzdmVwiJ3jraKBVByv5unK4FB4d7xnrCld0UMe6QkALZLByDyPwUhfhSLyTpx2GwQ Aubv6CASvbRBw9aiWZU978ZQ+4daVaWN38aAcGajYrTwIVRgdb0IAxWVl1bnxoUuAXDy 2FixKOT1ZUyRd222rkNgmNBks3/oUaIMpio2nkPcwFqKUe/IcPKw0mq1jO9oO7OqD+uq Lkyg== 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=JxS+AoR5Z3foSOY0+Ar8q8SgaAJrMyNQbT23W/mzpcs=; b=0YOZeE0C2bxB7mf+rEHxT4VziXYRdJ32dGe03l1MIukc9APGSE+LYFHdMwbA/xRvnb qDZoXeCjSoZ2sVEUBqiWv7aAP6JXBbPIuGWL2qHDaLafFLZUkjt+yAXNNs+8LB3OLb88 T1FdAqAPovgathohR336TmS0DGEr5Rf+BwcmDbFGg5NvzWVGX6qwfwFQrz58L3Bd7RuD o8BPfk13YYkij7WRVtub1Qlwm7zghWmct/ZGlYknUL7ggk7G03bA4etuSmyWDHYHTBIm Z499iODsmLWWYKFm4fcY9A/4XbhGl2GrsrNkRI49ozAFuVD4/8KWmCS5MbrrXWTgSyqx ey/g== X-Gm-Message-State: ACgBeo2JB1CKUDd4kTqSMW2iSiCKFuELZAZIh03eD+eFnKeuDLbj9ycK OQjXr/xxUNhe7J5fNFX/nEgXSw== X-Google-Smtp-Source: AA6agR4BI3KaPSuln0eVBIyiHQX2Ue/QaphJ0hLcxgWVqBfdmn4xufVw6pb/sNnVV5E86GTTiIxiag== X-Received: by 2002:a63:91c2:0:b0:41c:66a3:cecb with SMTP id l185-20020a6391c2000000b0041c66a3cecbmr3192398pge.288.1660846220080; Thu, 18 Aug 2022 11:10:20 -0700 (PDT) Received: from google.com (7.104.168.34.bc.googleusercontent.com. [34.168.104.7]) by smtp.gmail.com with ESMTPSA id l17-20020a170903121100b0017286f83fadsm1752822plh.135.2022.08.18.11.10.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Aug 2022 11:10:19 -0700 (PDT) Date: Thu, 18 Aug 2022 18:10:16 +0000 From: Sean Christopherson To: Vipin Sharma Cc: dmatlack@google.com, pbonzini@redhat.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] KVM: selftests: Run dirty_log_perf_test on specific cpus Message-ID: References: <20220817152956.4056410-1-vipinsh@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 18, 2022, Vipin Sharma wrote: > On Wed, Aug 17, 2022 at 2:29 PM Sean Christopherson wrote: > > > > On Wed, Aug 17, 2022, Vipin Sharma wrote: > > > On Wed, Aug 17, 2022 at 10:25 AM Sean Christopherson wrote: > > > > We need error checking here to make sure that the user really wants > > > cpu 0 and it was not a mistake in typing. > > > I was thinking of using parse_num API for other places as well instead > > > of atoi() in dirty_log_perf_test. > > > > Yes, definitely. And maybe give it a name like atoi_paranoid()? > > Lol. Absolutely, if that's what you want! The goal is to capture that it's effectively atoi(), but with checking. E.g. most developers will be familiar with atoi() and won't have to think too hard if they see e.g. atoi_paranoid(). On the other hand, parse_num() leaves the reader wondering if it's parsing hex, decimal, octal, etc..., why selftests just doesn't use atoi(), etc... > Okay, I will remove -d and only keep -c. I will extend it to support > pinning the main worker and vcpus. Arguments to -c will be like: >
, , , ,... > Example: > ./dirty_log_perf_test -v 3 -c 1,20,21,22 > > Main worker will run on 1 and 3 vcpus will run on logical cpus 20, 21 and 22. I think it makes sense to have the vCPUs be first. That way vcpu0 => task_map[0], and we can also extend the option in the future without breaking existing command lines, e.g. to add more workers and/or redefine the behavior of the "trailing" numbers to say that all workers are affined to those CPUs (to allow sequestering the main worker from vCPUs without pinning it to a single CPU).