Re: [PATCH 0/3] make vm_committed_as_batch aware of vm overcommit policy

2020-05-29 Thread Feng Tang
On Fri, May 29, 2020 at 08:50:25AM -0700, Andi Kleen wrote: > > > > ret = proc_dointvec_minmax(table, write, buffer, lenp, ppos); > > - if (ret == 0 && write) > > + if (ret == 0 && write) { > > + if (sysctl_overcommit_memory == OVERCOMMIT_NEVER) > > + schedule_

Re: [PATCH 0/3] make vm_committed_as_batch aware of vm overcommit policy

2020-05-29 Thread Andi Kleen
> > ret = proc_dointvec_minmax(table, write, buffer, lenp, ppos); > - if (ret == 0 && write) > + if (ret == 0 && write) { > + if (sysctl_overcommit_memory == OVERCOMMIT_NEVER) > + schedule_on_each_cpu(sync_overcommit_as); The schedule is not atomic.

Re: [PATCH 0/3] make vm_committed_as_batch aware of vm overcommit policy

2020-05-29 Thread Feng Tang
On Thu, May 28, 2020 at 11:21:36PM +0800, Kleen, Andi wrote: > > > >If it's true, then there could be 2 solutions, one is to skip the WARN_ONCE > >as it has no practical value, as the real >check is the following code, the > >other is to rectify the percpu counter when the policy is changing to

Re: [PATCH 0/3] make vm_committed_as_batch aware of vm overcommit policy

2020-05-28 Thread Michal Hocko
On Thu 28-05-20 23:10:20, Feng Tang wrote: [...] > If it's true, then there could be 2 solutions, one is to > skip the WARN_ONCE as it has no practical value, as the real > check is the following code, the other is to rectify the > percpu counter when the policy is changing to OVERCOMMIT_NEVER. I

RE: [PATCH 0/3] make vm_committed_as_batch aware of vm overcommit policy

2020-05-28 Thread Kleen, Andi
>If it's true, then there could be 2 solutions, one is to skip the WARN_ONCE as >it has no practical value, as the real >check is the following code, the other >is to rectify the percpu counter when the policy is changing to >>OVERCOMMIT_NEVER. I think it's better to fix it up when the polic

Re: [PATCH 0/3] make vm_committed_as_batch aware of vm overcommit policy

2020-05-28 Thread Feng Tang
On Thu, May 28, 2020 at 10:18:02AM -0400, Qian Cai wrote: > > > I have been reproduced this on both AMD and Intel. The test just > > > allocating memory and swapping. > > > > > > https://github.com/linux-test-project/ltp/blob/master/testcases/kernel/mem/oom/oom01.c > > > https://github.com/linux-t

Re: [PATCH 0/3] make vm_committed_as_batch aware of vm overcommit policy

2020-05-28 Thread Qian Cai
On Wed, May 27, 2020 at 06:46:06PM +0800, Feng Tang wrote: > Hi Qian, > > On Tue, May 26, 2020 at 10:25:39PM -0400, Qian Cai wrote: > > > > > > [1] https://lkml.org/lkml/2020/3/5/57 > > > > > > > > > > Reverted this series fixed a warning under memory pressue. > > > > > > > > Andrew, Stephen, ca

Re: [PATCH 0/3] make vm_committed_as_batch aware of vm overcommit policy

2020-05-27 Thread Qian Cai
On Wed, May 27, 2020 at 09:33:32PM +0800, Feng Tang wrote: > Hi Qian, > > On Wed, May 27, 2020 at 08:05:49AM -0400, Qian Cai wrote: > > On Wed, May 27, 2020 at 06:46:06PM +0800, Feng Tang wrote: > > > Hi Qian, > > > > > > On Tue, May 26, 2020 at 10:25:39PM -0400, Qian Cai wrote: > > > > > > > > [

Re: [PATCH 0/3] make vm_committed_as_batch aware of vm overcommit policy

2020-05-27 Thread Feng Tang
Hi Qian, On Wed, May 27, 2020 at 08:05:49AM -0400, Qian Cai wrote: > On Wed, May 27, 2020 at 06:46:06PM +0800, Feng Tang wrote: > > Hi Qian, > > > > On Tue, May 26, 2020 at 10:25:39PM -0400, Qian Cai wrote: > > > > > > > [1] https://lkml.org/lkml/2020/3/5/57 > > > > > > > > > > > > Reverted this

Re: [PATCH 0/3] make vm_committed_as_batch aware of vm overcommit policy

2020-05-27 Thread Qian Cai
On Wed, May 27, 2020 at 06:46:06PM +0800, Feng Tang wrote: > Hi Qian, > > On Tue, May 26, 2020 at 10:25:39PM -0400, Qian Cai wrote: > > > > > > [1] https://lkml.org/lkml/2020/3/5/57 > > > > > > > > > > Reverted this series fixed a warning under memory pressue. > > > > > > > > Andrew, Stephen, ca

Re: [PATCH 0/3] make vm_committed_as_batch aware of vm overcommit policy

2020-05-27 Thread Feng Tang
Hi Qian, On Tue, May 26, 2020 at 10:25:39PM -0400, Qian Cai wrote: > > > > > [1] https://lkml.org/lkml/2020/3/5/57 > > > > > > > > Reverted this series fixed a warning under memory pressue. > > > > > > Andrew, Stephen, can you drop this series? > > > > > > > > > > > [ 3319.257898] LTP: startin

Re: [PATCH 0/3] make vm_committed_as_batch aware of vm overcommit policy

2020-05-26 Thread Qian Cai
On Wed, May 27, 2020 at 09:46:47AM +0800, Feng Tang wrote: > Hi Qian, > > On Tue, May 26, 2020 at 02:14:59PM -0400, Qian Cai wrote: > > On Thu, May 21, 2020 at 05:27:26PM -0400, Qian Cai wrote: > > > On Fri, May 08, 2020 at 03:25:14PM +0800, Feng Tang wrote: > > > > When checking a performance cha

Re: [PATCH 0/3] make vm_committed_as_batch aware of vm overcommit policy

2020-05-26 Thread Feng Tang
Hi Qian, On Tue, May 26, 2020 at 02:14:59PM -0400, Qian Cai wrote: > On Thu, May 21, 2020 at 05:27:26PM -0400, Qian Cai wrote: > > On Fri, May 08, 2020 at 03:25:14PM +0800, Feng Tang wrote: > > > When checking a performance change for will-it-scale scalability > > > mmap test [1], we found very hi

Re: [PATCH 0/3] make vm_committed_as_batch aware of vm overcommit policy

2020-05-26 Thread Feng Tang
On Tue, May 26, 2020 at 06:14:13PM -0700, Andi Kleen wrote: > On Tue, May 26, 2020 at 02:14:59PM -0400, Qian Cai wrote: > > On Thu, May 21, 2020 at 05:27:26PM -0400, Qian Cai wrote: > > > On Fri, May 08, 2020 at 03:25:14PM +0800, Feng Tang wrote: > > > > When checking a performance change for will-

Re: [PATCH 0/3] make vm_committed_as_batch aware of vm overcommit policy

2020-05-26 Thread Andi Kleen
On Tue, May 26, 2020 at 02:14:59PM -0400, Qian Cai wrote: > On Thu, May 21, 2020 at 05:27:26PM -0400, Qian Cai wrote: > > On Fri, May 08, 2020 at 03:25:14PM +0800, Feng Tang wrote: > > > When checking a performance change for will-it-scale scalability > > > mmap test [1], we found very high lock co

Re: [PATCH 0/3] make vm_committed_as_batch aware of vm overcommit policy

2020-05-26 Thread Qian Cai
On Thu, May 21, 2020 at 05:27:26PM -0400, Qian Cai wrote: > On Fri, May 08, 2020 at 03:25:14PM +0800, Feng Tang wrote: > > When checking a performance change for will-it-scale scalability > > mmap test [1], we found very high lock contention for spinlock of > > percpu counter 'vm_committed_as': > >

Re: [PATCH 0/3] make vm_committed_as_batch aware of vm overcommit policy

2020-05-21 Thread Qian Cai
On Fri, May 08, 2020 at 03:25:14PM +0800, Feng Tang wrote: > When checking a performance change for will-it-scale scalability > mmap test [1], we found very high lock contention for spinlock of > percpu counter 'vm_committed_as': > > 94.14% 0.35% [kernel.kallsyms] [k] _raw_spin_lo