linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: John Stultz <john.stultz@linaro.org>
To: John Stultz <john.stultz@linaro.org>
Cc: linux-kernel@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>,
	Android Kernel Team <kernel-team@android.com>,
	Robert Love <rlove@google.com>, Mel Gorman <mel@csn.ul.ie>,
	Hugh Dickins <hughd@google.com>,
	Dave Hansen <dave@linux.vnet.ibm.com>,
	Rik van Riel <riel@redhat.com>,
	Dmitry Adamushko <dmitry.adamushko@gmail.com>,
	Dave Chinner <david@fromorbit.com>, Neil Brown <neilb@suse.de>,
	Andrea Righi <andrea@betterlinux.com>,
	"Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
Subject: [PATCH] fadvise volatile fixes from Dmitry
Date: Fri, 16 Mar 2012 17:47:19 -0700	[thread overview]
Message-ID: <4F63DF17.3070603@linaro.org> (raw)
In-Reply-To: <1331938267-13583-3-git-send-email-john.stultz@linaro.org>

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@linaro.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




  reply	other threads:[~2012-03-17  0:47 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-16 22:51 [PATCH 0/2] [RFC] Volatile ranges (v4) John Stultz
2012-03-16 22:51 ` [PATCH 1/2] [RFC] Range tree implementation John Stultz
2012-03-20 10:00   ` Dmitry Adamushko
2012-03-20 18:04     ` John Stultz
2012-03-20 16:44   ` Aneesh Kumar K.V
2012-03-16 22:51 ` [PATCH 2/2] [RFC] fadvise: Add _VOLATILE,_ISVOLATILE, and _NONVOLATILE flags John Stultz
2012-03-17  0:47   ` John Stultz [this message]
2012-03-17 16:21   ` Dmitry Adamushko
2012-03-18  9:13     ` Dmitry Adamushko
2012-03-20  0:18     ` John Stultz
2012-07-19 10:13 ` [PATCH 0/2] [RFC] Volatile ranges (v4) Dmitry Vyukov
     [not found]   ` <CAO6Zf6BSpq53UqYjCkq0b3pTPW=WDTnCorQ59tONnV7U-U6EOg@mail.gmail.com>
     [not found]     ` <CACT4Y+ZgBo9=HX5MHhmWBiQcdiGMss9RSS_reF4gJimivJx7sQ@mail.gmail.com>
2012-07-21 11:17       ` Dmitry Adamushko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F63DF17.3070603@linaro.org \
    --to=john.stultz@linaro.org \
    --cc=akpm@linux-foundation.org \
    --cc=andrea@betterlinux.com \
    --cc=aneesh.kumar@linux.vnet.ibm.com \
    --cc=dave@linux.vnet.ibm.com \
    --cc=david@fromorbit.com \
    --cc=dmitry.adamushko@gmail.com \
    --cc=hughd@google.com \
    --cc=kernel-team@android.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mel@csn.ul.ie \
    --cc=neilb@suse.de \
    --cc=riel@redhat.com \
    --cc=rlove@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).