31 Jul, 2011

1 commit

  • shm_try_destroy_orphaned() and shm_try_destroy_current() didn't handle
    the case of separate PID namespaces, but a single IPC namespace. If
    there are tasks with the same PID values using the same shmem object,
    the wrong destroy decision could be reached.

    On shm segment creation store the pointer to the creator task in
    shmid_kernel->shm_creator field and zero it on task exit. Then
    use the ->shm_creator insread of shm_cprid in both functions. As
    shmid_kernel object is already locked at this stage, no additional
    locking is needed.

    Signed-off-by: Vasiliy Kulikov
    Acked-by: Serge Hallyn
    Signed-off-by: Linus Torvalds

    Vasiliy Kulikov
     

27 Jul, 2011

1 commit

  • Add support for the shm_rmid_forced sysctl. If set to 1, all shared
    memory objects in current ipc namespace will be automatically forced to
    use IPC_RMID.

    The POSIX way of handling shmem allows one to create shm objects and
    call shmdt(), leaving shm object associated with no process, thus
    consuming memory not counted via rlimits.

    With shm_rmid_forced=1 the shared memory object is counted at least for
    one process, so OOM killer may effectively kill the fat process holding
    the shared memory.

    It obviously breaks POSIX - some programs relying on the feature would
    stop working. So set shm_rmid_forced=1 only if you're sure nobody uses
    "orphaned" memory. Use shm_rmid_forced=0 by default for compatability
    reasons.

    The feature was previously impemented in -ow as a configure option.

    [akpm@linux-foundation.org: fix documentation, per Randy]
    [akpm@linux-foundation.org: fix warning]
    [akpm@linux-foundation.org: readability/conventionality tweaks]
    [akpm@linux-foundation.org: fix shm_rmid_forced/shm_forced_rmid confusion, use standard comment layout]
    Signed-off-by: Vasiliy Kulikov
    Cc: Randy Dunlap
    Cc: "Eric W. Biederman"
    Cc: "Serge E. Hallyn"
    Cc: Daniel Lezcano
    Cc: Oleg Nesterov
    Cc: Tejun Heo
    Cc: Ingo Molnar
    Cc: Alan Cox
    Cc: Solar Designer
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Vasiliy Kulikov
     

08 Feb, 2008

1 commit

  • Do not export asm/page.h during make headers_install. This removes PAGE_SIZE
    from userspace headers.

    Signed-off-by: Kirill A. Shutemov
    Reviewed-by: David Woodhouse
    Cc: David Howells
    Cc: Martin Schwidefsky
    Cc: Heiko Carstens
    Cc: Thomas Gleixner
    Cc: Ingo Molnar
    Cc: H. Peter Anvin
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kirill A. Shutemov
     

20 Oct, 2007

1 commit

  • This patch introduces ipcs storage into IDRs. The main changes are:
    . This ipc_ids structure is changed: the entries array is changed into a
    root idr structure.
    . The grow_ary() routine is removed: it is not needed anymore when adding
    an ipc structure, since we are now using the IDR facility.
    . The ipc_rmid() routine interface is changed:
    . there is no need for this routine to return the pointer passed in as
    argument: it is now declared as a void
    . since the id is now part of the kern_ipc_perm structure, no need to
    have it as an argument to the routine

    Signed-off-by: Nadia Derbey
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Nadia Derbey
     

17 Oct, 2007

1 commit

  • SHMLBA cant possible be used in userspace, see sparc versions of that header.

    Do not export asm/shmparam.h during make headers_install_all
    This removes another uservisible place of PAGE_SIZE

    Signed-off-by: Olaf Hering
    Cc: Paul Mackerras
    Cc: Benjamin Herrenschmidt
    Cc: "David S. Miller"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Olaf Hering
     

02 Mar, 2007

1 commit

  • This patch provides the following hugetlb-related fixes to the recent stacked
    shm files changes:
    - Update is_file_hugepages() so it will reconize hugetlb shm segments.
    - get_unmapped_area must be called with the nested file struct to handle
    the sfd->file->f_ops->get_unmapped_area == NULL case.
    - The fsync f_op must be wrapped since it is specified in the hugetlbfs
    f_ops.

    This is based on proposed fixes from Eric Biederman that were debugged and
    tested by me. Without it, attempting to use hugetlb shared memory segments
    on powerpc (and likely ia64) will kill your box.

    Signed-off-by: Adam Litke
    Cc: Eric Biederman
    Cc: Andrew Morton
    Acked-by: William Irwin
    Signed-off-by: Linus Torvalds

    Adam Litke
     

07 Nov, 2005

1 commit

  • Add SHM_NORESERVE functionality similar to MAP_NORESERVE for shared memory
    segments.

    This is mainly to avoid abuse of OVERCOMMIT_ALWAYS and this flag is ignored
    for OVERCOMMIT_NEVER.

    Signed-off-by: Badari Pulavarty
    Cc: Hugh Dickins
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Badari Pulavarty
     

17 Apr, 2005

1 commit

  • Initial git repository build. I'm not bothering with the full history,
    even though we have it. We can create a separate "historical" git
    archive of that later if we want to, and in the meantime it's about
    3.2GB when imported into git - space that would just make the early
    git days unnecessarily complicated, when we don't have a lot of good
    infrastructure for it.

    Let it rip!

    Linus Torvalds