bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrii Nakryiko <andrii.nakryiko@gmail.com>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: Hou Tao <houtao@huaweicloud.com>, bpf <bpf@vger.kernel.org>,
	 Martin KaFai Lau <martin.lau@linux.dev>,
	Andrii Nakryiko <andrii@kernel.org>, Song Liu <song@kernel.org>,
	 Hao Luo <haoluo@google.com>, Yonghong Song <yhs@fb.com>,
	Daniel Borkmann <daniel@iogearbox.net>,
	 KP Singh <kpsingh@kernel.org>,
	Stanislav Fomichev <sdf@google.com>, Jiri Olsa <jolsa@kernel.org>,
	 John Fastabend <john.fastabend@gmail.com>,
	"Paul E . McKenney" <paulmck@kernel.org>,
	rcu@vger.kernel.org,  Hou Tao <houtao1@huawei.com>
Subject: Re: [PATCH bpf-next v5] selftests/bpf: Add benchmark for bpf memory allocator
Date: Mon, 12 Jun 2023 16:17:07 -0700	[thread overview]
Message-ID: <CAEf4BzY7+mcADa1SUDMpVNbdo2aakSkHv4HU3ENgFfrg+7BNPQ@mail.gmail.com> (raw)
In-Reply-To: <CAADnVQK-e9Y0gNyDUu6kZ4K9P0UXLdkwhvWT_iEhxJeB5JSAyg@mail.gmail.com>

On Fri, Jun 9, 2023 at 9:12 AM Alexei Starovoitov
<alexei.starovoitov@gmail.com> wrote:
>
> On Thu, Jun 8, 2023 at 11:32 PM Hou Tao <houtao@huaweicloud.com> wrote:
> >
> > >
> > >> +                    --producers=8 --prod-affinity=0-7 "$@")"
> > > -a -p 8 should just work.
> > > No need to pick specific cpus.
> > No. For VM with only 8 CPUs, the affinity of the first producer will be
> > CPU 1 and the affinity of the last producer will be CPU 8, so the
> > benchmark will fail to run. But I think I can fix it, so the affinity of
> > the last producer will be 0 instead.
>
> Right. Noticed that too.
> That should probably be a separate patch to fix this cpu assignment
> issue in bench for all benchs.
>
> Andrii,
> when you wrote it did you really mean to start assigning cpus from 1
> or that was just an oversight?

  616 ▸       /* unless explicit producer CPU list is specified, continue after¬
  617 ▸        * last consumer CPU¬
  618 ▸        */¬


It's been a while, but it seems like each consumer gets its CPU first,
then each producer. So yeah, seems intentional.

For context, this was done for BPF ringbuf benchmarking, so by default
I wanted to separate a single consumer from multiple producers.

  parent reply	other threads:[~2023-06-12 23:17 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-09  2:40 [PATCH bpf-next v5] selftests/bpf: Add benchmark for bpf memory allocator Hou Tao
2023-06-09  3:19 ` Alexei Starovoitov
2023-06-09  6:32   ` Hou Tao
2023-06-09 16:12     ` Alexei Starovoitov
2023-06-12  0:56       ` Hou Tao
2023-06-12 23:17       ` Andrii Nakryiko [this message]
2023-06-12 23:38         ` Alexei Starovoitov
2023-06-13  0:10           ` Andrii Nakryiko
2023-06-09 18:23 ` Alexei Starovoitov
2023-06-12  1:46   ` Hou Tao

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=CAEf4BzY7+mcADa1SUDMpVNbdo2aakSkHv4HU3ENgFfrg+7BNPQ@mail.gmail.com \
    --to=andrii.nakryiko@gmail.com \
    --cc=alexei.starovoitov@gmail.com \
    --cc=andrii@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=haoluo@google.com \
    --cc=houtao1@huawei.com \
    --cc=houtao@huaweicloud.com \
    --cc=john.fastabend@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=kpsingh@kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=paulmck@kernel.org \
    --cc=rcu@vger.kernel.org \
    --cc=sdf@google.com \
    --cc=song@kernel.org \
    --cc=yhs@fb.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;
as well as URLs for NNTP newsgroup(s).