Skip to content

Commit

Permalink
memcg: enable accounting for VLAN group array
Browse files Browse the repository at this point in the history
vlan array consume up to 8 pages of memory per net device.

It makes sense to account for them to restrict the host's memory
consumption from inside the memcg-limited container.

Signed-off-by: Vasily Averin <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
vaverin authored and davem330 committed Jul 20, 2021
1 parent 990c74e commit a89893d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/8021q/vlan.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ static int vlan_group_prealloc_vid(struct vlan_group *vg,
return 0;

size = sizeof(struct net_device *) * VLAN_GROUP_ARRAY_PART_LEN;
array = kzalloc(size, GFP_KERNEL);
array = kzalloc(size, GFP_KERNEL_ACCOUNT);
if (array == NULL)
return -ENOBUFS;

Expand Down

0 comments on commit a89893d

Please sign in to comment.