From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Fri, 6 Apr 2012 08:13:05 +0200 From: Nikola Ciprich To: Mel Gorman Cc: Ben Hutchings , linux-kernel@vger.kernel.org, stable@vger.kernel.org, torvalds@linux-foundation.org, akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk, Stuart Foster , Hugh Dickins , Johannes Weiner , Rik van Riel , Christoph Lameter , Greg KH , nikola.ciprich@linuxbox.cz Subject: Re: [ 101/175] mm: vmscan: forcibly scan highmem if there are too many buffer_heads pinning highmem Message-ID: <20120406061248.GA16549@pcnci2.linuxbox.cz> References: <20120330194845.531765417@linuxfoundation.org> <1333422093.443.32.camel@deadeye> <20120405202435.GA11562@suse.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="St7VIuEGZ6dlpu13" Content-Disposition: inline In-Reply-To: <20120405202435.GA11562@suse.de> Sender: linux-kernel-owner@vger.kernel.org List-ID: --St7VIuEGZ6dlpu13 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, sorry it took me a bit longer. here's my backport, compiles fine, kernel boots without any problems. please review. n. Signed-off-by: Nikola Ciprich mem_cgroup, &vm_flags)) { nr_rotated +=3D hpage_nr_pages(page); @@ -2053,6 +2061,14 @@ struct zoneref *z; struct zone *zone; =20 + /* + * If the number of buffer_heads in the machine exceeds the maximum + * allowed level, force direct reclaim to scan the highmem zone as + * highmem pages could be pinning lowmem pages storing buffer_heads + */ + if (buffer_heads_over_limit) + sc->gfp_mask |=3D __GFP_HIGHMEM; + for_each_zone_zonelist_nodemask(zone, z, zonelist, gfp_zone(sc->gfp_mask), sc->nodemask) { if (!populated_zone(zone)) @@ -2514,7 +2530,8 @@ (zone->present_pages + KSWAPD_ZONE_BALANCE_GAP_RATIO-1) / KSWAPD_ZONE_BALANCE_GAP_RATIO); - if (!zone_watermark_ok_safe(zone, order, + if ((buffer_heads_over_limit && is_highmem_idx(i)) || + !zone_watermark_ok_safe(zone, order, high_wmark_pages(zone) + balance_gap, end_zone, 0)) { shrink_zone(priority, zone, &sc); @@ -2543,6 +2560,17 @@ continue; } =20 + /* + * If the number of buffer_heads in the machine + * exceeds the maximum allowed level and this node + * has a highmem zone, force kswapd to reclaim from + * it to relieve lowmem pressure. + */ + if (buffer_heads_over_limit && is_highmem_idx(i)) { + end_zone =3D i; + break; + } + if (!zone_watermark_ok_safe(zone, order, high_wmark_pages(zone), end_zone, 0)) { all_zones_ok =3D 0; --St7VIuEGZ6dlpu13 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (GNU/Linux) iEYEARECAAYFAk9+iXEACgkQ3xdJJrLygV51twCglNnUc9/iJtFf3CqQlGaLelQ5 pGUAn0yKTum8qL8e1wbfagXB9JvUb5OS =O+CH -----END PGP SIGNATURE----- --St7VIuEGZ6dlpu13--