lkml.org 
[lkml]   [2012]   [Mar]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    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@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




    \
     
     \ /
      Last update: 2012-03-17 01:49    [W:0.023 / U:0.324 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site