Re: [PATCH] RFC: vmscan: add min_filelist_kbytes sysctl for protectingthe working set

From: Rik van Riel
Date: Thu Oct 28 2010 - 17:31:39 EST


On 10/28/2010 03:15 PM, Mandeep Singh Baines wrote:

+/*
+ * Check low watermark used to prevent fscache thrashing during low memory.
+ */
+static int file_is_low(struct zone *zone, struct scan_control *sc)
+{
+ unsigned long pages_min, active, inactive;
+
+ if (!scanning_global_lru(sc))
+ return false;
+
+ pages_min = min_filelist_kbytes>> (PAGE_SHIFT - 10);
+ active = zone_page_state(zone, NR_ACTIVE_FILE);
+ inactive = zone_page_state(zone, NR_INACTIVE_FILE);
+
+ return ((active + inactive)< pages_min);
+}

This is problematic.

It is quite possible for a NUMA system to have one zone
legitimately low on page cache (because all the binaries
and libraries got paged in on another NUMA node), without
the system being anywhere near out of memory.

This patch looks like it could cause a false OOM kill
in that scenario.

At the very minimum, you'd have to check that the system
is low on page cache globally, not just locally.

You do point out a real problem though, and it would be
nice to find a generic solution to it...

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/