diff options
author | Alexei Starovoitov | 2019-02-01 00:40:09 +0100 |
---|---|---|
committer | Daniel Borkmann | 2019-02-01 20:55:39 +0100 |
commit | 96049f3afd50fe8db69fa0068cdca822e747b1e4 (patch) | |
tree | b082ac077ea0bb78a073a25e540be72034ce0451 /Documentation/filesystems/sysfs-tagging.txt | |
parent | selftests/bpf: add bpf_spin_lock C test (diff) | |
download | kernel-qcow2-linux-96049f3afd50fe8db69fa0068cdca822e747b1e4.tar.gz kernel-qcow2-linux-96049f3afd50fe8db69fa0068cdca822e747b1e4.tar.xz kernel-qcow2-linux-96049f3afd50fe8db69fa0068cdca822e747b1e4.zip |
bpf: introduce BPF_F_LOCK flag
Introduce BPF_F_LOCK flag for map_lookup and map_update syscall commands
and for map_update() helper function.
In all these cases take a lock of existing element (which was provided
in BTF description) before copying (in or out) the rest of map value.
Implementation details that are part of uapi:
Array:
The array map takes the element lock for lookup/update.
Hash:
hash map also takes the lock for lookup/update and tries to avoid the bucket lock.
If old element exists it takes the element lock and updates the element in place.
If element doesn't exist it allocates new one and inserts into hash table
while holding the bucket lock.
In rare case the hashmap has to take both the bucket lock and the element lock
to update old value in place.
Cgroup local storage:
It is similar to array. update in place and lookup are done with lock taken.
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'Documentation/filesystems/sysfs-tagging.txt')
0 files changed, 0 insertions, 0 deletions