Re: [PATCH nf-next 7/9] netfilter: nf_tables: allow large allocations for new sets

2017-05-26 Thread Liping Zhang
2017-05-26 18:18 GMT+08:00 Pablo Neira Ayuso : > On Fri, May 26, 2017 at 06:02:34PM +0800, Liping Zhang wrote: >> Hi Pablo, >> >> 2017-05-24 17:50 GMT+08:00 Pablo Neira Ayuso : >> [...] >> > - err = -ENOMEM; >> > - set = kzalloc(sizeof(*set) +

Re: [PATCH nf-next 7/9] netfilter: nf_tables: allow large allocations for new sets

2017-05-26 Thread Pablo Neira Ayuso
On Fri, May 26, 2017 at 06:02:34PM +0800, Liping Zhang wrote: > Hi Pablo, > > 2017-05-24 17:50 GMT+08:00 Pablo Neira Ayuso : > [...] > > - err = -ENOMEM; > > - set = kzalloc(sizeof(*set) + size + udlen, GFP_KERNEL); > > + alloc_size = sizeof(*set) + size +

Re: [PATCH nf-next 7/9] netfilter: nf_tables: allow large allocations for new sets

2017-05-26 Thread Liping Zhang
Hi Pablo, 2017-05-24 17:50 GMT+08:00 Pablo Neira Ayuso : [...] > - err = -ENOMEM; > - set = kzalloc(sizeof(*set) + size + udlen, GFP_KERNEL); > + alloc_size = sizeof(*set) + size + udlen; > + if (alloc_size <= (PAGE_SIZE << PAGE_ALLOC_COSTLY_ORDER)) >

[PATCH nf-next 7/9] netfilter: nf_tables: allow large allocations for new sets

2017-05-24 Thread Pablo Neira Ayuso
The new fixed size hashtable backend implementation may result in a large array of buckets that would spew splats from mm. Update this code to fall back on vmalloc in case the memory allocation order is too costly. Signed-off-by: Pablo Neira Ayuso ---