From mboxrd@z Thu Jan 1 00:00:00 1970 From: Glauber Costa Subject: Re: [PATCH v5 13/14] protect architectures where THREAD_SIZE >= PAGE_SIZE against fork bombs Date: Thu, 18 Oct 2012 13:37:39 +0400 Message-ID: <507FCDE3.1050408@parallels.com> References: <1350382611-20579-1-git-send-email-glommer@parallels.com> <1350382611-20579-14-git-send-email-glommer@parallels.com> <20121017151245.f11c4d18.akpm@linux-foundation.org> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20121017151245.f11c4d18.akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org> Sender: cgroups-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-ID: Content-Type: text/plain; charset="us-ascii" To: Andrew Morton Cc: linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org, cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Mel Gorman , Tejun Heo , Michal Hocko , Johannes Weiner , kamezawa.hiroyu-+CUm20s59erQFUHtdCDX3A@public.gmane.org, Christoph Lameter , David Rientjes , Pekka Enberg , devel-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Pekka Enberg , Suleiman Souhlal On 10/18/2012 02:12 AM, Andrew Morton wrote: > On Tue, 16 Oct 2012 14:16:50 +0400 > Glauber Costa wrote: > >> @@ -146,7 +146,7 @@ void __weak arch_release_thread_info(struct thread_info *ti) >> static struct thread_info *alloc_thread_info_node(struct task_struct *tsk, >> int node) >> { >> - struct page *page = alloc_pages_node(node, THREADINFO_GFP, >> + struct page *page = alloc_pages_node(node, THREADINFO_GFP_ACCOUNTED, >> THREAD_SIZE_ORDER); > > yay, we actually used all this code for something ;) > Happy to be of use, sir! > I don't think we really saw a comprehensive list of what else the kmem > controller will be used for, but I believe that all other envisaged > applications will require slab accounting, yes? > > > So it appears that all we have at present is a > yet-another-fork-bomb-preventer, but one which requires that the > culprit be in a container? That's reasonable, given your > hosted-environment scenario. It's unclear (to me) that we should merge > all this code for only this feature. Again, it would be good to have a > clear listing of and plan for other applications of this code. > I agree. This doesn't buy me much without slab accounting. But reiterating what I've just said in another e-mail, slab accounting is not really in plan stage, but had also been through extensive development. As a matter of fact, it used to be only "slab accounting" in the beginning, without this. I've split it more recently because I believe it would allow people to do a more focused review, leading to better code. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx129.postini.com [74.125.245.129]) by kanga.kvack.org (Postfix) with SMTP id 2E0C06B0062 for ; Thu, 18 Oct 2012 05:37:55 -0400 (EDT) Message-ID: <507FCDE3.1050408@parallels.com> Date: Thu, 18 Oct 2012 13:37:39 +0400 From: Glauber Costa MIME-Version: 1.0 Subject: Re: [PATCH v5 13/14] protect architectures where THREAD_SIZE >= PAGE_SIZE against fork bombs References: <1350382611-20579-1-git-send-email-glommer@parallels.com> <1350382611-20579-14-git-send-email-glommer@parallels.com> <20121017151245.f11c4d18.akpm@linux-foundation.org> In-Reply-To: <20121017151245.f11c4d18.akpm@linux-foundation.org> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Andrew Morton Cc: linux-mm@kvack.org, cgroups@vger.kernel.org, Mel Gorman , Tejun Heo , Michal Hocko , Johannes Weiner , kamezawa.hiroyu@jp.fujitsu.com, Christoph Lameter , David Rientjes , Pekka Enberg , devel@openvz.org, linux-kernel@vger.kernel.org, Pekka Enberg , Suleiman Souhlal On 10/18/2012 02:12 AM, Andrew Morton wrote: > On Tue, 16 Oct 2012 14:16:50 +0400 > Glauber Costa wrote: > >> @@ -146,7 +146,7 @@ void __weak arch_release_thread_info(struct thread_info *ti) >> static struct thread_info *alloc_thread_info_node(struct task_struct *tsk, >> int node) >> { >> - struct page *page = alloc_pages_node(node, THREADINFO_GFP, >> + struct page *page = alloc_pages_node(node, THREADINFO_GFP_ACCOUNTED, >> THREAD_SIZE_ORDER); > > yay, we actually used all this code for something ;) > Happy to be of use, sir! > I don't think we really saw a comprehensive list of what else the kmem > controller will be used for, but I believe that all other envisaged > applications will require slab accounting, yes? > > > So it appears that all we have at present is a > yet-another-fork-bomb-preventer, but one which requires that the > culprit be in a container? That's reasonable, given your > hosted-environment scenario. It's unclear (to me) that we should merge > all this code for only this feature. Again, it would be good to have a > clear listing of and plan for other applications of this code. > I agree. This doesn't buy me much without slab accounting. But reiterating what I've just said in another e-mail, slab accounting is not really in plan stage, but had also been through extensive development. As a matter of fact, it used to be only "slab accounting" in the beginning, without this. I've split it more recently because I believe it would allow people to do a more focused review, leading to better code. -- 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: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755158Ab2JRJhy (ORCPT ); Thu, 18 Oct 2012 05:37:54 -0400 Received: from mx2.parallels.com ([64.131.90.16]:36156 "EHLO mx2.parallels.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754798Ab2JRJhx (ORCPT ); Thu, 18 Oct 2012 05:37:53 -0400 Message-ID: <507FCDE3.1050408@parallels.com> Date: Thu, 18 Oct 2012 13:37:39 +0400 From: Glauber Costa User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121009 Thunderbird/16.0 MIME-Version: 1.0 To: Andrew Morton CC: , , Mel Gorman , Tejun Heo , Michal Hocko , Johannes Weiner , , Christoph Lameter , David Rientjes , "Pekka Enberg" , , , Pekka Enberg , Suleiman Souhlal Subject: Re: [PATCH v5 13/14] protect architectures where THREAD_SIZE >= PAGE_SIZE against fork bombs References: <1350382611-20579-1-git-send-email-glommer@parallels.com> <1350382611-20579-14-git-send-email-glommer@parallels.com> <20121017151245.f11c4d18.akpm@linux-foundation.org> In-Reply-To: <20121017151245.f11c4d18.akpm@linux-foundation.org> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/18/2012 02:12 AM, Andrew Morton wrote: > On Tue, 16 Oct 2012 14:16:50 +0400 > Glauber Costa wrote: > >> @@ -146,7 +146,7 @@ void __weak arch_release_thread_info(struct thread_info *ti) >> static struct thread_info *alloc_thread_info_node(struct task_struct *tsk, >> int node) >> { >> - struct page *page = alloc_pages_node(node, THREADINFO_GFP, >> + struct page *page = alloc_pages_node(node, THREADINFO_GFP_ACCOUNTED, >> THREAD_SIZE_ORDER); > > yay, we actually used all this code for something ;) > Happy to be of use, sir! > I don't think we really saw a comprehensive list of what else the kmem > controller will be used for, but I believe that all other envisaged > applications will require slab accounting, yes? > > > So it appears that all we have at present is a > yet-another-fork-bomb-preventer, but one which requires that the > culprit be in a container? That's reasonable, given your > hosted-environment scenario. It's unclear (to me) that we should merge > all this code for only this feature. Again, it would be good to have a > clear listing of and plan for other applications of this code. > I agree. This doesn't buy me much without slab accounting. But reiterating what I've just said in another e-mail, slab accounting is not really in plan stage, but had also been through extensive development. As a matter of fact, it used to be only "slab accounting" in the beginning, without this. I've split it more recently because I believe it would allow people to do a more focused review, leading to better code.