1. 21 Jun, 2007 34 commits
  2. 17 Jun, 2007 1 commit
  3. 16 Jun, 2007 5 commits
    • Eric W. Biederman's avatar
      shm: fix the filename of hugetlb sysv shared memory · 9d66586f
      Eric W. Biederman authored
      Some user space tools need to identify SYSV shared memory when examining
      /proc/<pid>/maps.  To do so they look for a block device with major zero, a
      dentry named SYSV<sysv key>, and having the minor of the internal sysv
      shared memory kernel mount.
      
      To help these tools and to make it easier for people just browsing
      /proc/<pid>/maps this patch modifies hugetlb sysv shared memory to use the
      SYSV<key> dentry naming convention.
      
      User space tools will still have to be aware that hugetlb sysv shared
      memory lives on a different internal kernel mount and so has a different
      block device minor number from the rest of sysv shared memory.
      Signed-off-by: default avatarEric W. Biederman <ebiederm@xmission.com>
      Cc: "Serge E. Hallyn" <serge@hallyn.com>
      Cc: Albert Cahalan <acahalan@gmail.com>
      Cc: Badari Pulavarty <pbadari@us.ibm.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      9d66586f
    • Adam Litke's avatar
      hugetlb: fix get_policy for stacked shared memory files · 22741925
      Adam Litke authored
      Here's another breakage as a result of shared memory stacked files :(
      
      The NUMA policy for a VMA is determined by checking the following (in the
      order given):
      
      1) vma->vm_ops->get_policy() (if defined)
      2) vma->vm_policy (if defined)
      3) task->mempolicy (if defined)
      4) Fall back to default_policy
      
      By switching to stacked files for shared memory, get_policy() is now always
      set to shm_get_policy which is a wrapper function.  This causes us to stop
      at step 1, which yields NULL for hugetlb instead of task->mempolicy which
      was the previous (and correct) result.
      
      This patch modifies the shm_get_policy() wrapper to maintain steps 1-3 for
      the wrapped vm_ops.
      
      (akpm: the refcounting of mempolicies is busted and this patch does nothing to
      improve it)
      Signed-off-by: default avatarAdam Litke <agl@us.ibm.com>
      Acked-by: default avatarWilliam Irwin <bill.irwin@oracle.com>
      Cc: dean gaudet <dean@arctic.org>
      Cc: Christoph Lameter <clameter@sgi.com>
      Cc: Andi Kleen <ak@suse.de>
      Cc: <stable@kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      22741925
    • Jan Kara's avatar
      udf: fix possible leakage of blocks · 74584ae5
      Jan Kara authored
      We have to take care that when we call udf_discard_prealloc() from
      udf_clear_inode() we have to write inode ourselves afterwards (otherwise,
      some changes might be lost leading to leakage of blocks, use of free blocks
      or improperly aligned extents).
      
      Also udf_discard_prealloc() does two different things - it removes
      preallocated blocks and truncates the last extent to exactly match i_size.
      We move the latter functionality to udf_truncate_tail_extent(), call
      udf_discard_prealloc() when last reference to a file is dropped and call
      udf_truncate_tail_extent() when inode is being removed from inode cache
      (udf_clear_inode() call).
      
      We cannot call udf_truncate_tail_extent() earlier as subsequent open+write
      would find the last block of the file mapped and happily write to the end
      of it, although the last extent says it's shorter.
      
      [akpm@linux-foundation.org: Make checkpatch.pl happier]
      Signed-off-by: default avatarJan Kara <jack@suse.cz>
      Cc: Eric Sandeen <sandeen@sandeen.net>
      Cc: Cyrill Gorcunov <gorcunov@gmail.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      74584ae5
    • Christoph Lameter's avatar
      SLUB: minimum alignment fixes · 4b356be0
      Christoph Lameter authored
      If ARCH_KMALLOC_MINALIGN is set to a value greater than 8 (SLUBs smallest
      kmalloc cache) then SLUB may generate duplicate slabs in sysfs (yes again)
      because the object size is padded to reach ARCH_KMALLOC_MINALIGN.  Thus the
      size of the small slabs is all the same.
      
      No arch sets ARCH_KMALLOC_MINALIGN larger than 8 though except mips which
      for some reason wants a 128 byte alignment.
      
      This patch increases the size of the smallest cache if
      ARCH_KMALLOC_MINALIGN is greater than 8.  In that case more and more of the
      smallest caches are disabled.
      
      If we do that then the count of the active general caches that is displayed
      on boot is not correct anymore since we may skip elements of the kmalloc
      array.  So count them separately.
      
      This approach was tested by Havard yesterday.
      Signed-off-by: default avatarChristoph Lameter <clameter@sgi.com>
      Cc: Haavard Skinnemoen <hskinnemoen@atmel.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      4b356be0
    • Benjamin Herrenschmidt's avatar
      Rework ptep_set_access_flags and fix sun4c · 8dab5241
      Benjamin Herrenschmidt authored
      Some changes done a while ago to avoid pounding on ptep_set_access_flags and
      update_mmu_cache in some race situations break sun4c which requires
      update_mmu_cache() to always be called on minor faults.
      
      This patch reworks ptep_set_access_flags() semantics, implementations and
      callers so that it's now responsible for returning whether an update is
      necessary or not (basically whether the PTE actually changed).  This allow
      fixing the sparc implementation to always return 1 on sun4c.
      
      [akpm@linux-foundation.org: fixes, cleanups]
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Hugh Dickins <hugh@veritas.com>
      Cc: David Miller <davem@davemloft.net>
      Cc: Mark Fortescue <mark@mtfhpc.demon.co.uk>
      Acked-by: default avatarWilliam Lee Irwin III <wli@holomorphy.com>
      Cc: "Luck, Tony" <tony.luck@intel.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      8dab5241