From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756056Ab2ARHRG (ORCPT ); Wed, 18 Jan 2012 02:17:06 -0500 Received: from mail-lpp01m010-f46.google.com ([209.85.215.46]:64353 "EHLO mail-lpp01m010-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755302Ab2ARHRE (ORCPT ); Wed, 18 Jan 2012 02:17:04 -0500 Date: Wed, 18 Jan 2012 09:16:49 +0200 (EET) From: Pekka Enberg X-X-Sender: penberg@tux.localdomain To: Minchan Kim cc: Rik van Riel , linux-mm , LKML , leonid.moiseichuk@nokia.com, kamezawa.hiroyu@jp.fujitsu.com, mel@csn.ul.ie, rientjes@google.com, KOSAKI Motohiro , Johannes Weiner , Marcelo Tosatti , Andrew Morton , Ronen Hod , KOSAKI Motohiro Subject: Re: [RFC 1/3] /dev/low_mem_notify In-Reply-To: <20120117232025.GB903@barrios-desktop.redhat.com> Message-ID: References: <1326788038-29141-1-git-send-email-minchan@kernel.org> <1326788038-29141-2-git-send-email-minchan@kernel.org> <4F15A34F.40808@redhat.com> <20120117232025.GB903@barrios-desktop.redhat.com> User-Agent: Alpine 2.02 (LFD 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 18 Jan 2012, Minchan Kim wrote: > I didn't look into your code(will do) but as I read description, > still I don't convince we need really some process specific threshold like 99% > I think application can know it by polling /proc/meminfo without this mechanism > if they really want. I'm not sure if we need arbitrary threshold either. However, we need to support the following cases: - We're about to swap - We're about to run out of memory - We're about to start OOM killing and I don't think your patch solves that. One possibility is to implement: VMNOTIFY_TYPE_ABOUT_TO_SWAP VMNOTIFY_TYPE_ABOUT_TO_OOM VMNOTIFY_TYPE_ABOUT_TO_OOM_KILL and maybe rip out support for arbitrary thresholds. Does that more reasonable? As for polling /proc/meminfo, I'd much rather deliver stats as part of vmnotify_read() because it's easier to extend the ABI rather than adding new fields to /proc/meminfo. On Wed, 18 Jan 2012, Minchan Kim wrote: > I would like to notify when system has a trobule with memory pressure without > some process specific threshold. Of course, applicatoin can't expect it.(ie, > application can know system memory pressure by /proc/meminfo but it can't know > when swapout really happens). Kernel low mem notify have to give such notification > to user space, I think. It should be simple to add support for VMNOTIFY_TYPE_MEM_PRESSURE that uses your hooks. Pekka