Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Thu, 18 Jul 2002 13:39:48 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Thu, 18 Jul 2002 13:39:48 -0400 Received: from gateway-1237.mvista.com ([12.44.186.158]:8434 "EHLO hermes.mvista.com") by vger.kernel.org with ESMTP id ; Thu, 18 Jul 2002 13:39:47 -0400 Subject: Re: [PATCH] strict VM overcommit for stock 2.4 From: Robert Love To: Szakacsits Szabolcs Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org In-Reply-To: References: Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Mailer: Ximian Evolution 1.0.8 Date: 18 Jul 2002 10:42:41 -0700 Message-Id: <1027014161.1086.123.camel@sinai> Mime-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1240 Lines: 31 On Thu, 2002-07-18 at 09:36, Szakacsits Szabolcs wrote: > This is what I would do first [make sure you don't hit any resource, > malloc, kernel memory mapping, etc limits -- this is a simulation that > must eat all available memory continually]: > main(){void *x;while(1)if(x=malloc(4096))memset(x,666,4096);} > > When the above used up all the memory try to ssh/login to the box as > root and clean up the mess. Can you do it? Three points: - with strict overcommit and the "allocations must meet backing store" rule (policy #3) the above can never use all physical memory - if your point is that a rogue user can use all of the systems memory, then you need per-user resource accounting. - the point of this patch is to not use MORE memory than the system has. I say nothing else except that I am trying to avoid OOM and push the allocation failures into the allocations themselves. Assuming the accounting is correct (and it seems to be) then Alan and I have succeeded. Robert Love - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/