Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934616AbZKYMpS (ORCPT ); Wed, 25 Nov 2009 07:45:18 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S934435AbZKYMpR (ORCPT ); Wed, 25 Nov 2009 07:45:17 -0500 Received: from mx1.redhat.com ([209.132.183.28]:29046 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934241AbZKYMpQ (ORCPT ); Wed, 25 Nov 2009 07:45:16 -0500 Date: Wed, 25 Nov 2009 13:44:33 +0100 From: Andrea Arcangeli To: David Rientjes Cc: KAMEZAWA Hiroyuki , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrew Morton , Hugh Dickins , vedran.furac@gmail.com, KOSAKI Motohiro Subject: Re: [PATCH] oom_kill: use rss value instead of vm size for badness Message-ID: <20091125124433.GB27615@random.random> References: <20091028175846.49a1d29c.kamezawa.hiroyu@jp.fujitsu.com> <20091029100042.973328d3.kamezawa.hiroyu@jp.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2294 Lines: 63 Hello, lengthy discussion on something I think is quite obviously better and I tried to change a couple of years back already (rss instead of total_vm). On Thu, Oct 29, 2009 at 01:31:59AM -0700, David Rientjes wrote: > total_vm > 708945 test > 195695 krunner > 168881 plasma-desktop > 130567 ktorrent > 127081 knotify4 > 125881 icedove-bin > 123036 akregator > 118641 kded4 > > rss > 707878 test > 42201 Xorg > 13300 icedove-bin > 10209 ktorrent > 9277 akregator > 8878 plasma-desktop > 7546 krunner > 4532 mysqld > > This patch would pick the memory hogging task, "test", first everytime That is by far the only thing that matters. There's plenty of logic in the oom killer to remove races with tasks with TIF_MEMDIE set, to ensure not to fall into the second task until the first task had the time to release all its memory back to the system. > just like the current implementation does. It would then prefer Xorg, You're focusing on the noise and not looking at the only thing that matters. The noise level with rss went down to 50000, it doesn't matter the order of what's below 50000. Only thing it matters is the _delta_ between "noise-level innocent apps" and "exploit". The delta is clearly increase from 708945-max(noise) to 707878-max(noise) which translates to a increase of precision from 513250 to 665677, which shows how much more rss is making the detection more accurate (i.e. the distance between exploit and first innocent app). The lower level the noise level starts, the less likely the innocent apps are killed. There's simply no way to get to perfection, some innocent apps will always have high total_vm or rss levels, but this at least removes lots of innocent apps from the equation. The fact X isn't less innocent than before is because its rss is quite big, and this is not an error, luckily much smaller than the hog itself. Surely there are ways to force X to load huge bitmaps into its address space too (regardless of total_vm or rss) but again no perfection, just better with rss even in this testcase. -- 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/