lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 24 Jan 2007 18:03:12 +0530
From:	Vaidyanathan Srinivasan <svaidy@...ux.vnet.ibm.com>
To:	Christoph Lameter <clameter@....com>
CC:	Aubrey Li <aubreylee@...il.com>,
	Nick Piggin <nickpiggin@...oo.com.au>,
	Robin Getz <rgetz@...ckfin.uclinux.org>,
	"Henn, erich, Michael" <Michael.Hennerich@...log.com>,
	linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [RFC] Limit the size of the pagecache



Christoph Lameter wrote:
> This is a patch using some of Aubrey's work plugging it in what is IMHO
> the right way. Feel free to improve on it. I have gotten repeatedly
> requests to be able to limit the pagecache. With the revised VM statistics
> this is now actually possile. I'd like to know more about possible uses of
> such a feature.
> 
> 

[snip]

Hi Christoph,

With your patch, MMAP of a file that will cross the pagecache limit hangs the
system.  As I mentioned in my previous mail, without subtracting the
NR_FILE_MAPPED, the reclaim will infinitely try and fail.

I have tested your patch with the attached fix on my PPC64 box.

Signed-off-by: Vaidyanathan Srinivasan <svaidy@...ux.vnet.ibm.com>

---
 mm/page_alloc.c |    3 ++-
 mm/vmscan.c     |    3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

--- linux-2.6.20-rc5.orig/mm/page_alloc.c
+++ linux-2.6.20-rc5/mm/page_alloc.c
@@ -1171,7 +1171,8 @@ zonelist_scan:
                                goto try_next_zone;

                if ((gfp_mask & __GFP_PAGECACHE) &&
-                               zone_page_state(zone, NR_FILE_PAGES) >
+                               (zone_page_state(zone, NR_FILE_PAGES) -
+                                zone_page_state(zone, NR_FILE_MAPPED)) >
                                        zone->max_pagecache_pages)
                                goto try_next_zone;

--- linux-2.6.20-rc5.orig/mm/vmscan.c
+++ linux-2.6.20-rc5/mm/vmscan.c
@@ -936,7 +936,8 @@ static unsigned long shrink_zone(int pri
         * If the page cache is too big then focus on page cache
         * and ignore anonymous pages
         */
-       if (sc->may_swap && zone_page_state(zone, NR_FILE_PAGES)
+       if (sc->may_swap && (zone_page_state(zone, NR_FILE_PAGES) -
+                       zone_page_state(zone, NR_FILE_MAPPED))
                        > zone->max_pagecache_pages)
                sc->may_swap = 0;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ