From mboxrd@z Thu Jan 1 00:00:00 1970 From: Oleg Nesterov Subject: Re: [PATCH 09/14] resource limits: track highwater mark of locked memory Date: Fri, 15 Jul 2016 17:14:08 +0200 Message-ID: <20160715151408.GA32317@redhat.com> References: <1468578983-28229-1-git-send-email-toiwoton@gmail.com> <1468578983-28229-10-git-send-email-toiwoton@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-kernel@vger.kernel.org, Tony Luck , Fenghua Yu , Paolo Bonzini , Radim =?utf-8?B?S3LEjW3DocWZ?= , Alexander Graf , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Doug Ledford , Sean Hefty , Hal Rosenstock , Mike Marciniszyn , Dennis Dalessandro , Christian Benvenuti , Dave Goodell , Sudeep Dutt , Ashutosh Dixit , Alex Williamson , Alexei Starovoitov To: Topi Miettinen Return-path: Content-Disposition: inline In-Reply-To: <1468578983-28229-10-git-send-email-toiwoton@gmail.com> Sender: owner-linux-mm@kvack.org List-Id: netdev.vger.kernel.org On 07/15, Topi Miettinen wrote: > > Track maximum size of locked memory, to be able to configure > RLIMIT_MEMLOCK resource limits. The information is available > with taskstats and cgroupstats netlink socket. So I personally still dislike the very idea of this series... but I won't argue if you convince maintainers. > @@ -2020,6 +2020,10 @@ static int acct_stack_growth(struct vm_area_struct *vma, unsigned long size, uns > return -ENOMEM; > > update_resource_highwatermark(RLIMIT_STACK, actual_size); > + if (vma->vm_flags & VM_LOCKED) > + update_resource_highwatermark(RLIMIT_MEMLOCK, > + (mm->locked_vm + grow) << > + PAGE_SHIFT); Btw this is not right. The same for the previous patch which tracks RLIMIT_STACK. The "current" task can debugger/etc. Yes, yes, this just reminds that the whole rlimit logic in this path is broken but still... Oleg. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org