lkml.org 
[lkml]   [2008]   [Jan]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC][PATCH 3/5] add /dev/mem_notify device
Hi Alan,

On Tue, Jan 15, 2008 at 11:20:27AM +0000, Alan Cox wrote:
> On Tue, 15 Jan 2008 19:59:02 +0900
> KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> wrote:
>
> >
> > > > the core of this patch series.
> > > > add /dev/mem_notify device for notification low memory to user process.
> > >
> > > As you only wake one process how would you use this API from processes
> > > which want to monitor and can free memory under load. Also what fairness
> > > guarantees are there...
> >
> > Sorry, I don't make sense what you mean fairness.
> > Could you tell more?
>
> If you have two processes each waiting on mem_notify is it not possible
> that one of them will keep being the one woken up and the other will
> remain stuck ?

Tasks are added to the end of waitqueue->task_list through
add_wait_queue_exclusive, and waken up from the start of the list. So
I don't think that can happen (its FIFO).

> It also appears there is no way to wait for memory shortages (processes
> that can free memory easily) only for memory to start appearing.

The notification is sent once the VM starts moving anonymous pages to
the inactive list (meaning there is memory shortage). So polling on the
device is all about waiting for memory shortage.

Or do you mean something else?



\
 
 \ /
  Last update: 2008-01-15 13:05    [W:0.056 / U:0.128 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site