From: John Fastabend <john.fastabend@gmail.com>
To: Martin KaFai Lau <kafai@fb.com>, bpf@vger.kernel.org
Cc: Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
kernel-team@fb.com, netdev@vger.kernel.org
Subject: RE: [PATCH bpf-next] bpf: sk_storage: Prefer to get a free cache_idx
Date: Wed, 17 Jun 2020 22:01:03 -0700 [thread overview]
Message-ID: <5eeaf50fec904_38b82b28075185c44c@john-XPS-13-9370.notmuch> (raw)
In-Reply-To: <20200617174226.2301909-1-kafai@fb.com>
Martin KaFai Lau wrote:
> The cache_idx is currently picked by RR. There is chance that
> the same cache_idx will be picked by multiple sk_storage_maps while
> other cache_idx is still unused. e.g. It could happen when the
> sk_storage_map is recreated during the restart of the user
> space process.
>
> This patch tracks the usage count for each cache_idx. There is
> 16 of them now (defined in BPF_SK_STORAGE_CACHE_SIZE).
> It will try to pick the free cache_idx. If none was found,
> it would pick one with the minimal usage count.
>
> Signed-off-by: Martin KaFai Lau <kafai@fb.com>
> ---
> net/core/bpf_sk_storage.c | 41 +++++++++++++++++++++++++++++++++++----
> 1 file changed, 37 insertions(+), 4 deletions(-)
>
Acked-by: John Fastabend <john.fastabend@gmail.com>
next prev parent reply other threads:[~2020-06-18 5:01 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-17 17:42 [PATCH bpf-next] bpf: sk_storage: Prefer to get a free cache_idx Martin KaFai Lau
2020-06-18 5:01 ` John Fastabend [this message]
2020-06-18 21:48 ` Alexei Starovoitov
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=5eeaf50fec904_38b82b28075185c44c@john-XPS-13-9370.notmuch \
--to=john.fastabend@gmail.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=kafai@fb.com \
--cc=kernel-team@fb.com \
--cc=netdev@vger.kernel.org \
/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).