bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Martin KaFai Lau <kafai@fb.com>
To: Joanne Koong <joannekoong@fb.com>
Cc: <bpf@vger.kernel.org>, <andrii@kernel.org>, <ast@kernel.org>,
	<daniel@iogearbox.net>, <Kernel-team@fb.com>
Subject: Re: [PATCH v6 bpf-next 0/5] Implement bloom filter map
Date: Thu, 28 Oct 2021 15:10:19 -0700	[thread overview]
Message-ID: <20211028221019.oinkfqhb3keuuzau@kafai-mbp.dhcp.thefacebook.com> (raw)
In-Reply-To: <20211027234504.30744-1-joannekoong@fb.com>

On Wed, Oct 27, 2021 at 04:44:59PM -0700, Joanne Koong wrote:
> This patchset adds a new kind of bpf map: the bloom filter map.
> Bloom filters are a space-efficient probabilistic data structure
> used to quickly test whether an element exists in a set.
> For a brief overview about how bloom filters work,
> https://en.wikipedia.org/wiki/Bloom_filter
> may be helpful.
> 
> One example use-case is an application leveraging a bloom filter
> map to determine whether a computationally expensive hashmap
> lookup can be avoided. If the element was not found in the bloom
> filter map, the hashmap lookup can be skipped.
> 
> This patchset includes benchmarks for testing the performance of
> the bloom filter for different entry sizes and different number of
> hash functions used, as well as comparisons for hashmap lookups
> with vs. without the bloom filter.
> 
> A high level overview of this patchset is as follows:
> 1/5 - kernel changes for adding bloom filter map
> 2/5 - libbpf changes for adding map_extra flags
> 3/5 - tests for the bloom filter map
> 4/5 - benchmarks for bloom filter lookup/update throughput and false positive
> rate
> 5/5 - benchmarks for how hashmap lookups perform with vs. without the bloom
> filter
> 
> v5 -> v6:
> * in 1/5: remove "inline" from the hash function, add check in syscall to
> fail out in cases where map_extra is not 0 for non-bloom-filter maps,
> fix alignment matching issues, move "map_extra flags" comments to inside
> the bpf_attr struct, add bpf_map_info map_extra changes here, add map_extra
> assignment in bpf_map_get_info_by_fd, change hash value_size to u32 instead of
> a u64
> * in 2/5: remove bpf_map_info map_extra changes, remove TODO comment about
> extending BTF arrays to cover u64s, cast to unsigned long long for %llx when
> printing out map_extra flags
> * in 3/5: use __type(value, ...) instead of __uint(value_size, ...) for values
> and keys
> * in 4/5: fix wrong bounds for the index when iterating through random values,
> update commit message to include update+lookup benchmark results for 8 byte
> and 64-byte value sizes, remove explicit global bool initializaton to false
> for hashmap_use_bloom and count_false_hits variables
Thanks!  Only have minor comments in patch 1.  belated
Acked-by: Martin KaFai Lau <kafai@fb.com>

  parent reply	other threads:[~2021-10-28 22:10 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-27 23:44 [PATCH v6 bpf-next 0/5] Implement bloom filter map Joanne Koong
2021-10-27 23:45 ` [PATCH v6 bpf-next 1/5] bpf: Add bloom filter map implementation Joanne Koong
2021-10-28 18:15   ` Andrii Nakryiko
2021-10-29  0:15     ` Joanne Koong
2021-10-29  0:44       ` Andrii Nakryiko
2021-10-28 20:35   ` Alexei Starovoitov
2021-10-28 21:14   ` Martin KaFai Lau
2021-10-29  3:17     ` Joanne Koong
2021-10-29  4:49       ` Martin KaFai Lau
     [not found]         ` <6d930e97-424d-393d-4731-ac8eda9e5156@fb.com>
2021-10-29  6:40           ` Martin KaFai Lau
2021-10-27 23:45 ` [PATCH v6 bpf-next 2/5] libbpf: Add "map_extra" as a per-map-type extra flag Joanne Koong
2021-10-28 18:14   ` Andrii Nakryiko
2021-10-27 23:45 ` [PATCH v6 bpf-next 3/5] selftests/bpf: Add bloom filter map test cases Joanne Koong
2021-10-28 18:16   ` Andrii Nakryiko
2021-10-27 23:45 ` [PATCH v6 bpf-next 4/5] bpf/benchs: Add benchmark tests for bloom filter throughput + false positive Joanne Koong
2021-10-28 18:26   ` Andrii Nakryiko
2021-10-27 23:45 ` [PATCH v6 bpf-next 5/5] bpf/benchs: Add benchmarks for comparing hashmap lookups w/ vs. w/out bloom filter Joanne Koong
2021-10-28 22:10 ` Martin KaFai Lau [this message]
2021-10-28 23:05   ` [PATCH v6 bpf-next 0/5] Implement bloom filter map Alexei Starovoitov
2021-10-29  0:23     ` Joanne Koong
2021-10-29  0:30       ` 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=20211028221019.oinkfqhb3keuuzau@kafai-mbp.dhcp.thefacebook.com \
    --to=kafai@fb.com \
    --cc=Kernel-team@fb.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=joannekoong@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).