Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Thu, 12 Sep 2002 14:26:58 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Thu, 12 Sep 2002 14:26:57 -0400 Received: from pD9E23F87.dip.t-dialin.net ([217.226.63.135]:38373 "EHLO hawkeye.luckynet.adm") by vger.kernel.org with ESMTP id ; Thu, 12 Sep 2002 14:26:56 -0400 Date: Thu, 12 Sep 2002 12:30:53 -0600 (MDT) From: Thunder from the hill X-X-Sender: thunder@hawkeye.luckynet.adm To: Giuliano Pochini cc: Jim Sibley , Troy Reed , , , Subject: RE: Killing/balancing processes when overcommited In-Reply-To: Message-ID: X-Location: Dorndorf/Steudnitz; Germany MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1432 Lines: 48 Hi, On Thu, 12 Sep 2002, Giuliano Pochini wrote: > It's not difficult to make the kerner choose the right processes > to kill. It's impossible. Not quite. But it's expensive. It adds 4 bytes per task, plus a second OOM killer. > Imagine that when it goes oom the system stops and asks you what > processes have to be killed. What do you kill ? Rather whom would you ask? > Probably we do need an oomd that the sysadmin can configure as he likes. That's bad, it could get killed. ;-) Mostly the mem eaters are those who hang in an malloc() deadloop. char *x = NULL; /* * We need this variable, so if we don't get it, we reallocate it * regardless of what happened. */ do { x = malloc(X_SIZE); } while (!x); That's possibly a candidate. So if we just count how often per second that stubborn process uses malloc(), you'll catch the right guy most of the time. If you don't get a process that's over the threshold, do usual OOM killing... Thunder -- --./../...-/. -.--/---/..-/.-./..././.-../..-. .---/..-/.../- .- --/../-./..-/-/./--..-- ../.----./.-../.-.. --./../...-/. -.--/---/..- .- -/---/--/---/.-./.-./---/.--/.-.-.- --./.-/-.../.-./.././.-../.-.-.- - 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/