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: Mon, 18 Jul 2016 17:38:03 +0200 Message-ID: <20160718153802.GA31174@redhat.com> References: <1468578983-28229-1-git-send-email-toiwoton@gmail.com> <1468578983-28229-10-git-send-email-toiwoton@gmail.com> <20160715151408.GA32317@redhat.com> <5c43bc33-6625-ceb7-e96e-adf7df5b642c@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <5c43bc33-6625-ceb7-e96e-adf7df5b642c@gmail.com> Sender: owner-linux-mm@kvack.org To: Topi Miettinen 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 List-Id: linux-rdma@vger.kernel.org On 07/15, Topi Miettinen wrote: > > On 07/15/16 15:14, Oleg Nesterov wrote: > > > > Btw this is not right. The same for the previous patch which tracks > > RLIMIT_STACK. The "current" task can debugger/etc. > > acct_stack_growth() is called from expand_upwards() and > expand_downwards(). They call security_mmap_addr() and the various LSM > implementations also use current task in the checks. Are these also not > right? Just suppose that the stack grows because you read/write to /proc/pid/mem. > > Yes, yes, this just reminds that the whole rlimit logic in this path > > is broken but still... > > I'd be happy to fix the logic with a separate prerequisite patch and > then use the right logic for this patch, but I'm not sure I know how. > Could you elaborate a bit? If only I Knew how to fix this ;) I mean, if only I could suggest a simple fix. Because IMHO we do not really care, rlimts are obsolete. 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk0-f199.google.com (mail-qk0-f199.google.com [209.85.220.199]) by kanga.kvack.org (Postfix) with ESMTP id 07B406B0253 for ; Mon, 18 Jul 2016 11:37:59 -0400 (EDT) Received: by mail-qk0-f199.google.com with SMTP id a123so398776536qkd.2 for ; Mon, 18 Jul 2016 08:37:59 -0700 (PDT) Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTPS id q51si10809868qtc.117.2016.07.18.08.37.58 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Jul 2016 08:37:58 -0700 (PDT) Date: Mon, 18 Jul 2016 17:38:03 +0200 From: Oleg Nesterov Subject: Re: [PATCH 09/14] resource limits: track highwater mark of locked memory Message-ID: <20160718153802.GA31174@redhat.com> References: <1468578983-28229-1-git-send-email-toiwoton@gmail.com> <1468578983-28229-10-git-send-email-toiwoton@gmail.com> <20160715151408.GA32317@redhat.com> <5c43bc33-6625-ceb7-e96e-adf7df5b642c@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5c43bc33-6625-ceb7-e96e-adf7df5b642c@gmail.com> Sender: owner-linux-mm@kvack.org List-ID: To: Topi Miettinen 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 , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Alexander Shishkin , Andrew Morton , Jiri Slaby , Konstantin Khlebnikov , Cyrill Gorcunov , Dave Hansen , Thomas Gleixner , Greg Kroah-Hartman , Dan Carpenter , Vlastimil Babka , Michal Hocko , "Kirill A. Shutemov" , Eric B Munson , Alexey Klimov , Andrea Arcangeli , Chen Gang , Andrey Ryabinin , David Rientjes , Hugh Dickins , Alexander Kuleshov , "open list:IA64 (Itanium) PLATFORM" , "open list:KERNEL VIRTUAL MACHINE (KVM)" , "open list:KERNEL VIRTUAL MACHINE (KVM) FOR POWERPC" , "open list:LINUX FOR POWERPC (32-BIT AND 64-BIT)" , "open list:INFINIBAND SUBSYSTEM" , "open list:BPF (Safe dynamic programs and tools)" , "open list:MEMORY MANAGEMENT" On 07/15, Topi Miettinen wrote: > > On 07/15/16 15:14, Oleg Nesterov wrote: > > > > Btw this is not right. The same for the previous patch which tracks > > RLIMIT_STACK. The "current" task can debugger/etc. > > acct_stack_growth() is called from expand_upwards() and > expand_downwards(). They call security_mmap_addr() and the various LSM > implementations also use current task in the checks. Are these also not > right? Just suppose that the stack grows because you read/write to /proc/pid/mem. > > Yes, yes, this just reminds that the whole rlimit logic in this path > > is broken but still... > > I'd be happy to fix the logic with a separate prerequisite patch and > then use the right logic for this patch, but I'm not sure I know how. > Could you elaborate a bit? If only I Knew how to fix this ;) I mean, if only I could suggest a simple fix. Because IMHO we do not really care, rlimts are obsolete. 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3rtS474Xh3zDqDX for ; Tue, 19 Jul 2016 01:37:59 +1000 (AEST) Date: Mon, 18 Jul 2016 17:38:03 +0200 From: Oleg Nesterov To: Topi Miettinen 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 , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Alexander Shishkin , Andrew Morton , Jiri Slaby , Konstantin Khlebnikov , Cyrill Gorcunov , Dave Hansen , Thomas Gleixner , Greg Kroah-Hartman , Dan Carpenter , Vlastimil Babka , Michal Hocko , "Kirill A. Shutemov" , Eric B Munson , Alexey Klimov , Andrea Arcangeli , Chen Gang , Andrey Ryabinin , David Rientjes , Hugh Dickins , Alexander Kuleshov , "open list:IA64 (Itanium) PLATFORM" , "open list:KERNEL VIRTUAL MACHINE (KVM)" , "open list:KERNEL VIRTUAL MACHINE (KVM) FOR POWERPC" , "open list:LINUX FOR POWERPC (32-BIT AND 64-BIT)" , "open list:INFINIBAND SUBSYSTEM" , "open list:BPF (Safe dynamic programs and tools)" , "open list:MEMORY MANAGEMENT" Subject: Re: [PATCH 09/14] resource limits: track highwater mark of locked memory Message-ID: <20160718153802.GA31174@redhat.com> References: <1468578983-28229-1-git-send-email-toiwoton@gmail.com> <1468578983-28229-10-git-send-email-toiwoton@gmail.com> <20160715151408.GA32317@redhat.com> <5c43bc33-6625-ceb7-e96e-adf7df5b642c@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <5c43bc33-6625-ceb7-e96e-adf7df5b642c@gmail.com> List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On 07/15, Topi Miettinen wrote: > > On 07/15/16 15:14, Oleg Nesterov wrote: > > > > Btw this is not right. The same for the previous patch which tracks > > RLIMIT_STACK. The "current" task can debugger/etc. > > acct_stack_growth() is called from expand_upwards() and > expand_downwards(). They call security_mmap_addr() and the various LSM > implementations also use current task in the checks. Are these also not > right? Just suppose that the stack grows because you read/write to /proc/pid/mem. > > Yes, yes, this just reminds that the whole rlimit logic in this path > > is broken but still... > > I'd be happy to fix the logic with a separate prerequisite patch and > then use the right logic for this patch, but I'm not sure I know how. > Could you elaborate a bit? If only I Knew how to fix this ;) I mean, if only I could suggest a simple fix. Because IMHO we do not really care, rlimts are obsolete. Oleg.