Re: [PATCH v4] fork: free vmapped stacks in cache when cpus are offline

2017-02-11 Thread Hoeun Ryu
On Sat, Feb 11, 2017 at 6:56 PM, Hoeun Ryu wrote: > >> On Feb 11, 2017, at 5:31 PM, Thomas Gleixner wrote: >> >>> On Sat, 11 Feb 2017, Hoeun Ryu wrote: >>> #define NR_CACHED_STACKS 2 >>> static DEFINE_PER_CPU(struct vm_struct *, cached_stacks[NR_CACHED_STACKS]); >>> + >>> +static int free_vm_stac

Re: [PATCH v4] fork: free vmapped stacks in cache when cpus are offline

2017-02-11 Thread Hoeun Ryu
> On Feb 11, 2017, at 5:31 PM, Thomas Gleixner wrote: > >> On Sat, 11 Feb 2017, Hoeun Ryu wrote: >> #define NR_CACHED_STACKS 2 >> static DEFINE_PER_CPU(struct vm_struct *, cached_stacks[NR_CACHED_STACKS]); >> + >> +static int free_vm_stack_cache(unsigned int cpu) >> +{ >> +struct vm_struct *

Re: [PATCH v4] fork: free vmapped stacks in cache when cpus are offline

2017-02-11 Thread Thomas Gleixner
On Sat, 11 Feb 2017, Hoeun Ryu wrote: > #define NR_CACHED_STACKS 2 > static DEFINE_PER_CPU(struct vm_struct *, cached_stacks[NR_CACHED_STACKS]); > + > +static int free_vm_stack_cache(unsigned int cpu) > +{ > + struct vm_struct **cached_vm_stacks = per_cpu_ptr(cached_stacks, cpu); > + int

Re: [PATCH v4] fork: free vmapped stacks in cache when cpus are offline

2017-02-10 Thread Michal Hocko
On Sat 11-02-17 08:40:38, Hoeun Ryu wrote: > Using virtually mapped stack, kernel stacks are allocated via vmalloc. > In the current implementation, two stacks per cpu can be cached when > tasks are freed and the cached stacks are used again in task duplications. > but the cached stacks may remain

[PATCH v4] fork: free vmapped stacks in cache when cpus are offline

2017-02-10 Thread Hoeun Ryu
Using virtually mapped stack, kernel stacks are allocated via vmalloc. In the current implementation, two stacks per cpu can be cached when tasks are freed and the cached stacks are used again in task duplications. but the cached stacks may remain unfreed even when cpu are offline. By adding a cp