History

bpf: Eliminate rlimit-based memory accounting for lpm_trie maps

Do not use rlimit-based memory accounting for lpm_trie maps. It has been replaced with the memcg-based memory accounting.

Roman Gushchin committed 5 years ago

Commit cbddcb51 parent 755e5d51 file · +0 −13Browse files

Showing the changes to kernel (1 of 1 file). Show all

Unified · Split

kernel/bpf/lpm_trie.c+0−13
@@ -540,8 +540,6 @@ out: · 539 unmodified lines
540540 static struct bpf_map *trie_alloc(union bpf_attr *attr)
541541 {
542542 struct lpm_trie *trie;
543− u64 cost = sizeof(*trie), cost_per_node;
544− int ret;
545543
546544 if (!bpf_capable())
547545 return ERR_PTR(-EPERM);
@@ -567,20 +565,9 @@ static struct bpf_map *trie_alloc(union bpf_attr *attr) · 19 unmodified lines
567565 offsetof(struct bpf_lpm_trie_key, data);
568566 trie->max_prefixlen = trie->data_size * 8;
569567
570− cost_per_node = sizeof(struct lpm_trie_node) +
571− attr->value_size + trie->data_size;
572− cost += (u64) attr->max_entries * cost_per_node;
573−
574− ret = bpf_map_charge_init(&trie->map.memory, cost);
575− if (ret)
576− goto out_err;
577−
578568 spin_lock_init(&trie->lock);
579569
580570 return &trie->map;
581−out_err:
582− kfree(trie);
583− return ERR_PTR(ret);
584571 }
585572
586573 static void trie_free(struct bpf_map *map)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t