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]
Message-ID: <4F63DF17.3070603@linaro.org>
Date:	Fri, 16 Mar 2012 17:47:19 -0700
From:	John Stultz <john.stultz@...aro.org>
To:	John Stultz <john.stultz@...aro.org>
CC:	linux-kernel@...r.kernel.org,
	Andrew Morton <akpm@...ux-foundation.org>,
	Android Kernel Team <kernel-team@...roid.com>,
	Robert Love <rlove@...gle.com>, Mel Gorman <mel@....ul.ie>,
	Hugh Dickins <hughd@...gle.com>,
	Dave Hansen <dave@...ux.vnet.ibm.com>,
	Rik van Riel <riel@...hat.com>,
	Dmitry Adamushko <dmitry.adamushko@...il.com>,
	Dave Chinner <david@...morbit.com>, Neil Brown <neilb@...e.de>,
	Andrea Righi <andrea@...terlinux.com>,
	"Aneesh Kumar K.V" <aneesh.kumar@...ux.vnet.ibm.com>
Subject: [PATCH] fadvise volatile fixes from Dmitry

On 03/16/2012 03:51 PM, John Stultz wrote:
> This patch provides new fadvise flags that can be used to mark
> file pages as volatile, which will allow it to be discarded if the
> kernel wants to reclaim memory.
Right after sending this I realized I had forgotten to include
some fixes for issues Dmitry pointed out. So I've included them
here.

Signed-off-by: John Stultz<john.stultz@...aro.org>
---
  mm/volatile.c |    5 +++--
  1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/mm/volatile.c b/mm/volatile.c
index e412a8b..f40c02e 100644
--- a/mm/volatile.c
+++ b/mm/volatile.c
@@ -220,11 +220,12 @@ long mapping_range_nonvolatile(struct address_space *mapping,
  			new->mapping = mapping;
  			new->range_node.start = end + 1;
  			new->range_node.end = node->end;
-			volatile_range_resize(vrange, node->start, start-1);
+			new->purged = vrange->purged;
  			range_tree_add(&mapping->volatile_root,
  						&new->range_node);
  			if (range_on_lru(new))
  				lru_add(new);
+			volatile_range_resize(vrange, node->start, start-1);

  			break;
  		}
@@ -263,7 +264,7 @@ void mapping_clear_volatile_ranges(struct address_space *mapping)
  static int volatile_shrink(struct shrinker *ignored, struct shrink_control *sc)
  {
  	struct volatile_range *range, *next;
-	unsigned long nr_to_scan = sc->nr_to_scan;
+	s64 nr_to_scan = sc->nr_to_scan;
  	const gfp_t gfp_mask = sc->gfp_mask;

  	if (nr_to_scan&&  !(gfp_mask&  __GFP_FS))
-- 
1.7.3.2.146.gca209



--
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