[lkml]   [2012]   [Mar]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    Patch in this message
    Subject[34-longterm 003/196] shmem: let shared anonymous be nonlinear again
    From: Hugh Dickins <>

    This is a commit scheduled for the next v2.6.34 longterm release.
    If you see a problem with using this for longterm, please comment.

    commit bee4c36a5cf5c9f63ce1d7372aa62045fbd16d47 upstream.

    Up to 2.6.22, you could use remap_file_pages(2) on a tmpfs file or a
    shared mapping of /dev/zero or a shared anonymous mapping. In 2.6.23 we
    disabled it by default, but set VM_CAN_NONLINEAR to enable it on safe
    mappings. We made sure to set it in shmem_mmap() for tmpfs files, but
    missed it in shmem_zero_setup() for the others. Fix that at last.

    Reported-by: Kenny Simpson <>
    Signed-off-by: Hugh Dickins <>
    Signed-off-by: Andrew Morton <>
    Signed-off-by: Linus Torvalds <>
    Signed-off-by: Paul Gortmaker <>
    mm/shmem.c | 1 +
    1 file changed, 1 insertion(+)

    diff --git a/mm/shmem.c b/mm/shmem.c
    index eef4ebe..0203cda 100644
    --- a/mm/shmem.c
    +++ b/mm/shmem.c
    @@ -2701,5 +2701,6 @@ int shmem_zero_setup(struct vm_area_struct *vma)
    vma->vm_file = file;
    vma->vm_ops = &shmem_vm_ops;
    + vma->vm_flags |= VM_CAN_NONLINEAR;
    return 0;

     \ /
      Last update: 2012-03-13 02:13    [W:3.155 / U:0.096 seconds]
    ©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site