History

bpf: Eliminate rlimit-based memory accounting for cpumap maps

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

Roman Gushchin committed 5 years ago

Commit 711caba1 parent f0437331 file · +1 −15Browse files

Unified · Split

kernel/bpf/cpumap.c+1−15
@@ -84,8 +84,6 @@ static struct bpf_map *cpu_map_alloc(union bpf_attr *attr) · 83 unmodified lines
8484 u32 value_size = attr->value_size;
8585 struct bpf_cpu_map *cmap;
8686 int err = -ENOMEM;
87− u64 cost;
88− int ret;
8987
9088 if (!bpf_capable())
9189 return ERR_PTR(-EPERM);
@@ -109,26 +107,14 @@ static struct bpf_map *cpu_map_alloc(union bpf_attr *attr) · 17 unmodified lines
109107 goto free_cmap;
110108 }
111109
112− /* make sure page count doesn't overflow */
113− cost = (u64) cmap->map.max_entries * sizeof(struct bpf_cpu_map_entry *);
114−
115− /* Notice returns -EPERM on if map size is larger than memlock limit */
116− ret = bpf_map_charge_init(&cmap->map.memory, cost);
117− if (ret) {
118− err = ret;
119− goto free_cmap;
120− }
121−
122110 /* Alloc array for possible remote "destination" CPUs */
123111 cmap->cpu_map = bpf_map_area_alloc(cmap->map.max_entries *
124112 sizeof(struct bpf_cpu_map_entry *),
125113 cmap->map.numa_node);
126114 if (!cmap->cpu_map)
127− goto free_charge;
115+ goto free_cmap;
128116
129117 return &cmap->map;
130−free_charge:
131− bpf_map_charge_finish(&cmap->map.memory);
132118 free_cmap:
133119 kfree(cmap);
134120 return ERR_PTR(err);

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