Re: [RFC PATCH 1/1] mm/percpu.c: fix potential memory leakage for pcpu_embed_first_chunk()

2016-09-30 Thread Tejun Heo
Hello, On Fri, Sep 30, 2016 at 01:38:35AM +0800, zijun_hu wrote: > 1) the simpler way don't work because it maybe free many memory block twice Right, the punched holes. Forgot about them. Yeah, that's why the later failure just leaks memory. > 2) as we seen, pcpu_setup_first_chunk() doesn't ca

Re: [RFC PATCH 1/1] mm/percpu.c: fix potential memory leakage for pcpu_embed_first_chunk()

2016-09-29 Thread zijun_hu
On 2016/9/30 0:44, Tejun Heo wrote: > Hello, > > On Fri, Sep 30, 2016 at 12:03:20AM +0800, zijun_hu wrote: >> From: zijun_hu >> >> it will cause memory leakage for pcpu_embed_first_chunk() to go to >> label @out_free if the chunk spans over 3/4 VMALLOC area. all memory >> are allocated and record

Re: [RFC PATCH 1/1] mm/percpu.c: fix potential memory leakage for pcpu_embed_first_chunk()

2016-09-29 Thread Tejun Heo
Hello, On Fri, Sep 30, 2016 at 12:03:20AM +0800, zijun_hu wrote: > From: zijun_hu > > it will cause memory leakage for pcpu_embed_first_chunk() to go to > label @out_free if the chunk spans over 3/4 VMALLOC area. all memory > are allocated and recorded into array @areas for each CPU group, but >

[RFC PATCH 1/1] mm/percpu.c: fix potential memory leakage for pcpu_embed_first_chunk()

2016-09-29 Thread zijun_hu
From: zijun_hu it will cause memory leakage for pcpu_embed_first_chunk() to go to label @out_free if the chunk spans over 3/4 VMALLOC area. all memory are allocated and recorded into array @areas for each CPU group, but the memory allocated aren't be freed before returning after going to label @o