1. 24 Jan, 2008 3 commits
    • Larry Woodman's avatar
      fix hugepages leak due to pagetable page sharing · c5c99429
      Larry Woodman authored
      
      The shared page table code for hugetlb memory on x86 and x86_64
      is causing a leak.  When a user of hugepages exits using this code
      the system leaks some of the hugepages.
      
      -------------------------------------------------------
      Part of /proc/meminfo just before database startup:
      HugePages_Total:  5500
      HugePages_Free:   5500
      HugePages_Rsvd:      0
      Hugepagesize:     2048 kB
      
      Just before shutdown:
      HugePages_Total:  5500
      HugePages_Free:   4475
      HugePages_Rsvd:      0
      Hugepagesize:     2048 kB
      
      After shutdown:
      HugePages_Total:  5500
      HugePages_Free:   4988
      HugePages_Rsvd:
      0 Hugepagesize:     2048 kB
      ----------------------------------------------------------
      
      The problem occurs durring a fork, in copy_hugetlb_page_range().  It
      locates the dst_pte using huge_pte_alloc().  Since huge_pte_alloc() calls
      huge_pmd_share() it will share the pmd page if can, yet the main loop in
      copy_hugetlb_page_range() does a get_page() on every hugepage.  This is a
      violation of the shared hugepmd pagetable protocol and creates additional
      referenced to the hugepages causing a leak when the unmap of the VMA
      occurs.  We can skip the entire replication of the ptes when the hugepage
      pagetables are shared.  The attached patch skips copying the ptes and the
      get_page() calls if the hugetlbpage pagetable is shared.
      
      [akpm@linux-foundation.org: coding-style cleanups]
      Signed-off-by: default avatarLarry Woodman <lwoodman@redhat.com>
      Signed-off-by: default avatarAdam Litke <agl@us.ibm.com>
      Cc: Badari Pulavarty <pbadari@us.ibm.com>
      Cc: Ken Chen <kenchen@google.com>
      Cc: David Gibson <david@gibson.dropbear.id.au>
      Cc: William Lee Irwin III <wli@holomorphy.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      c5c99429
    • Eric W. Biederman's avatar
      sysctl: kill binary sysctl KERN_PPC_L2CR · c2f3dabe
      Eric W. Biederman authored
      
      : Stefan Roese <sr@denx.de> said:
      > ppc: 4xx: sysctl table check failed: /kernel/l2cr .1.31 Missing strategy
      >
      > I'm seeing this error message when booting an recent arch/ppc kernel on
      > 4xx platforms (tested on Ocotea and other 4xx platforms). Booting NFS
      > rootfs still works fine, but this message kind of makes me "nervous".
      > This is not seen on 4xx arch/powerpc platforms. Here the bootlog:
      
      Because the data field was never filled and a binary sysctl handler was
      never written this sysctl has never been usable through the sys_sysctl
      interface.  So just remove the binary sysctl number.  Making the kernel
      sanity checks happy.
      Signed-off-by: default avatarEric W. Biederman <ebiederm@xmission.com>
      Reported-by: default avatarStefan Roese <sr@denx.de>
      Cc: Josh Boyer <jwboyer@gmail.com>
      Cc: Wolfgang Denk <wd@denx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      c2f3dabe
    • Arjan van de Ven's avatar
      lockdep: fix kernel crash on module unload · fabe874a
      Arjan van de Ven authored
      Michael Wu noticed in his lkml post at
      
          http://marc.info/?l=linux-kernel&m=119396182726091&w=2
      
      
      
      that certain wireless drivers ended up having their name in module
      memory, which would then crash the kernel on module unload.
      
      The patch he proposed was a bit clumsy in that it increased the size of
      a lockdep entry significantly; the patch below tries another approach,
      it checks, on module teardown, if the name of a class is in module space
      and then zaps the class.  This is very similar to what we already do
      with keys that are in module space.
      Signed-off-by: default avatarArjan van de Ven <arjan@linux.intel.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      Acked-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      fabe874a
  2. 23 Jan, 2008 18 commits
  3. 22 Jan, 2008 14 commits
  4. 21 Jan, 2008 5 commits