Re: [RFC 1/3] /dev/low_mem_notify

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 01/17/2012 04:27 AM, Pekka Enberg wrote:
On Tue, Jan 17, 2012 at 10:13 AM, Minchan Kim<minchan@xxxxxxxxxx>  wrote:
+static unsigned int low_mem_notify_poll(struct file *file, poll_table *wait)
+{
+        unsigned int ret = 0;
+
+        poll_wait(file,&low_mem_wait, wait);
+
+        if (atomic_read(&nr_low_mem) != 0) {
+                ret = POLLIN;
+                atomic_set(&nr_low_mem, 0);
+        }
+
+        return ret;
+}

Doesn't this mean that only one application will receive the notification?

One at a time, which could be a good thing since the last
thing we want to do when the system is under memory
pressure is create a thundering herd.

OTOH, we do need to ensure that programs take turns getting
the memory pressure notification.  I do not know whether
poll_wait automatically takes care of that...

--
All rights reversed

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]