lkml.org 
[lkml]   [2007]   [Jul]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[PATCH 2/7] readahead: mmap read-around simplification
    Fold file_ra_state.mmap_hit into file_ra_state.mmap_miss
    and make it an int.

    Signed-off-by: Fengguang Wu <wfg@mail.ustc.edu.cn>
    ---
    include/linux/fs.h | 3 +--
    mm/filemap.c | 4 ++--
    2 files changed, 3 insertions(+), 4 deletions(-)

    --- linux-2.6.22-rc6-mm1.orig/include/linux/fs.h
    +++ linux-2.6.22-rc6-mm1/include/linux/fs.h
    @@ -777,8 +777,7 @@ struct file_ra_state {
    there are only # of pages ahead */

    unsigned int ra_pages; /* Maximum readahead window */
    - unsigned long mmap_hit; /* Cache hit stat for mmap accesses */
    - unsigned long mmap_miss; /* Cache miss stat for mmap accesses */
    + int mmap_miss; /* Cache miss stat for mmap accesses */
    unsigned long prev_index; /* Cache last read() position */
    unsigned int prev_offset; /* Offset where last read() ended in a page */
    };
    --- linux-2.6.22-rc6-mm1.orig/mm/filemap.c
    +++ linux-2.6.22-rc6-mm1/mm/filemap.c
    @@ -1389,7 +1389,7 @@ retry_find:
    * Do we miss much more than hit in this file? If so,
    * stop bothering with read-ahead. It will only hurt.
    */
    - if (ra->mmap_miss > ra->mmap_hit + MMAP_LOTSAMISS)
    + if (ra->mmap_miss > MMAP_LOTSAMISS)
    goto no_cached_page;

    /*
    @@ -1415,7 +1415,7 @@ retry_find:
    }

    if (!did_readaround)
    - ra->mmap_hit++;
    + ra->mmap_miss--;

    /*
    * We have a locked page in the page cache, now we need to check
    --
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2007-07-21 06:49    [W:0.021 / U:31.276 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site