Re: [PATCH v2] netfilter: account ebt_table_info to kmemcg

From: Michal Hocko
Date: Thu Jan 10 2019 - 04:41:47 EST


On Thu 10-01-19 12:22:09, Kirill Tkhai wrote:
[...]
> >> diff --git a/net/bridge/netfilter/ebtables.c b/net/bridge/netfilter/ebtables.c
> >> index 491828713e0b..5e55cef0cec3 100644
> >> --- a/net/bridge/netfilter/ebtables.c
> >> +++ b/net/bridge/netfilter/ebtables.c
> >> @@ -1137,14 +1137,16 @@ static int do_replace(struct net *net, const void __user *user,
> >> tmp.name[sizeof(tmp.name) - 1] = 0;
> >>
> >> countersize = COUNTER_OFFSET(tmp.nentries) * nr_cpu_ids;
> >> - newinfo = vmalloc(sizeof(*newinfo) + countersize);
> >> + newinfo = __vmalloc(sizeof(*newinfo) + countersize, GFP_KERNEL_ACCOUNT,
> >> + PAGE_KERNEL);
>
> Do we need GFP_HIGHMEM here?

No. vmalloc adds __GPF_HIGHMEM implicitly (see __vmalloc_area_node).

--
Michal Hocko
SUSE Labs