Skip to content

Commit

Permalink
bpf: eliminate rlimit-based memory accounting for xskmap maps
Browse files Browse the repository at this point in the history
Do not use rlimit-based memory accounting for xskmap maps.
It has been replaced with the memcg-based memory accounting.

Signed-off-by: Roman Gushchin <guro@fb.com>
Acked-by: Song Liu <songliubraving@fb.com>
  • Loading branch information
rgushchin authored and intel-lab-lkp committed Aug 21, 2020
1 parent 631438e commit af82aa6
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions net/xdp/xskmap.c
Expand Up @@ -74,7 +74,6 @@ static void xsk_map_sock_delete(struct xdp_sock *xs,

static struct bpf_map *xsk_map_alloc(union bpf_attr *attr)
{
struct bpf_map_memory mem;
int err, numa_node;
struct xsk_map *m;
u64 size;
Expand All @@ -90,18 +89,11 @@ static struct bpf_map *xsk_map_alloc(union bpf_attr *attr)
numa_node = bpf_map_attr_numa_node(attr);
size = struct_size(m, xsk_map, attr->max_entries);

err = bpf_map_charge_init(&mem, size);
if (err < 0)
return ERR_PTR(err);

m = bpf_map_area_alloc(size, numa_node);
if (!m) {
bpf_map_charge_finish(&mem);
if (!m)
return ERR_PTR(-ENOMEM);
}

bpf_map_init_from_attr(&m->map, attr);
bpf_map_charge_move(&m->map.memory, &mem);
spin_lock_init(&m->lock);

return &m->map;
Expand Down

0 comments on commit af82aa6

Please sign in to comment.