From: Sean Christopherson <seanjc@google.com>
To: David Matlack <dmatlack@google.com>
Cc: Vipin Sharma <vipinsh@google.com>,
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
Date: Fri, 19 Aug 2022 22:59:27 +0000 [thread overview]
Message-ID: <YwAVzzF2dZ2tKOUh@google.com> (raw)
In-Reply-To: <YwAP2dM/9vfjlAMb@google.com>
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 <dmatlack@google.com> 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.
next prev parent reply other threads:[~2022-08-19 22:59 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-19 21:07 [PATCH v2] KVM: selftests: Run dirty_log_perf_test on specific cpus Vipin Sharma
2022-08-19 21:38 ` David Matlack
2022-08-19 22:20 ` Vipin Sharma
2022-08-19 22:34 ` David Matlack
2022-08-19 22:35 ` David Matlack
2022-08-19 22:59 ` Sean Christopherson [this message]
2022-08-20 0:17 ` Vipin Sharma
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YwAVzzF2dZ2tKOUh@google.com \
--to=seanjc@google.com \
--cc=dmatlack@google.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=vipinsh@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox