1. 05 9月, 2005 8 次提交
  2. 30 8月, 2005 1 次提交
    • N
      [PATCH] Lazy page table copies in fork() · d992895b
      Nick Piggin 提交于
      Defer copying of ptes until fault time when it is possible to reconstruct
      the pte from backing store. Idea from Andi Kleen and Nick Piggin.
      
      Thanks to input from Rik van Riel and Linus and to Hugh for correcting
      my blundering.
      
      Ray Fucillo <fucillo@intersystems.com> reports:
      
        "I applied this latest patch to a 2.6.12 kernel and found that it does
         resolve the problem.  Prior to the patch on this machine, I was
         seeing about 23ms spent in fork for ever 100MB of shared memory
         segment.
      
         After applying the patch, fork is taking about 1ms regardless of the
         shared memory size."
      Signed-off-by: NNick Piggin <npiggin@suse.de>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      d992895b
  3. 20 8月, 2005 1 次提交
    • L
      Fix nasty ncpfs symlink handling bug. · cc314eef
      Linus Torvalds 提交于
      This bug could cause oopses and page state corruption, because ncpfs
      used the generic page-cache symlink handlign functions.  But those
      functions only work if the page cache is guaranteed to be "stable", ie a
      page that was installed when the symlink walk was started has to still
      be installed in the page cache at the end of the walk.
      
      We could have fixed ncpfs to not use the generic helper routines, but it
      is in many ways much cleaner to instead improve on the symlink walking
      helper routines so that they don't require that absolute stability.
      
      We do this by allowing "follow_link()" to return a error-pointer as a
      cookie, which is fed back to the cleanup "put_link()" routine.  This
      also simplifies NFS symlink handling.
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      cc314eef
  4. 06 8月, 2005 1 次提交
  5. 05 8月, 2005 2 次提交
    • S
      [PATCH] __vm_enough_memory() signedness fix · 2f60f8d3
      Simon Derr 提交于
      We have found what seems to be a small bug in __vm_enough_memory() when
      sysctl_overcommit_memory is set to OVERCOMMIT_NEVER.
      
      When this bug occurs the systems fails to boot, with /sbin/init whining
      about fork() returning ENOMEM.
      
      We hunted down the problem to this:
      
      The deferred update mecanism used in vm_acct_memory(), on a SMP system,
      allows the vm_committed_space counter to have a negative value.
      
      This should not be a problem since this counter is known to be inaccurate.
      
      But in __vm_enough_memory() this counter is compared to the `allowed'
      variable, which is an unsigned long.  This comparison is broken since it
      will consider the negative values of vm_committed_space to be huge positive
      values, resulting in a memory allocation failure.
      
      Signed-off-by: <Jean-Marc.Saffroy@ext.bull.net>
      Signed-off-by: <Simon.Derr@bull.net>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      2f60f8d3
    • H
      [PATCH] fix VmSize and VmData after mremap · 1c5ad845
      Hugh Dickins 提交于
      mremap's move_vma is applying __vm_stat_account to the old vma which may
      have already been freed: move it to just before the do_munmap.
      
      mremapping to and fro with CONFIG_DEBUG_SLAB=y showed /proc/<pid>/status
      VmSize and VmData wrapping just like in kernel bugzilla #4842, and fixed by
      this patch - worth including in 2.6.13, though not yet confirmed that it
      fixes that specific report from Frank van Maarseveen.
      Signed-off-by: NHugh Dickins <hugh@veritas.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      1c5ad845
  6. 04 8月, 2005 2 次提交
    • L
      Fix up recent get_user_pages() handling · a68d2ebc
      Linus Torvalds 提交于
      The VM_FAULT_WRITE thing is an extra bit, not a valid return value, and
      has to be treated as such by get_user_pages().
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      a68d2ebc
    • N
      [PATCH] fix get_user_pages bug · f33ea7f4
      Nick Piggin 提交于
      Checking pte_dirty instead of pte_write in __follow_page is problematic
      for s390, and for copy_one_pte which leaves dirty when clearing write.
      
      So revert __follow_page to check pte_write as before, and make
      do_wp_page pass back a special extra VM_FAULT_WRITE bit to say it has
      done its full job: once get_user_pages receives this value, it no longer
      requires pte_write in __follow_page.
      
      But most callers of handle_mm_fault, in the various architectures, have
      switch statements which do not expect this new case.  To avoid changing
      them all in a hurry, make an inline wrapper function (using the old
      name) that masks off the new bit, and use the extended interface with
      double underscores.
      
      Yes, we do have a call to do_wp_page from do_swap_page, but no need to
      change that: in rare case it's needed, another do_wp_page will follow.
      Signed-off-by: NHugh Dickins <hugh@veritas.com>
      [ Cleanups by Nick Piggin ]
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      f33ea7f4
  7. 02 8月, 2005 3 次提交
    • E
      [PATCH] sys_set_mempolicy() doesnt check if mode < 0 · ba17101b
      Eric Dumazet 提交于
      A kernel BUG() is triggered by a call to set_mempolicy() with a negative
      first argument.  This is because the mode is declared as an int, and the
      validity check doesnt check < 0 values.  Alternatively, mode could be
      declared as unsigned int or unsigned long.
      Signed-off-by: NEric Dumazet <dada1@cosmosbay.com>
      Cc: Andi Kleen <ak@suse.de>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      ba17101b
    • H
      [PATCH] x86_64: access of some bad address · 690dbe1c
      Hugh Dickins 提交于
      x86_64 has a large sparse gate area between VSYSCALL_START and
      VSYSCALL_END, not all of it presently backed by pmds.  Alexander Nyberg has
      found that in some circumstances gdb may try to ptrace here, and hit
      get_user_pages BUG_ON.  It seems odd that gdb should be accessing here, but
      it certainly shouldn't crash in this way: relax BUG_ON to -EFAULT.  Fixes
      kernel bugzilla #4801.
      Signed-off-by: NHugh Dickins <hugh@veritas.com>
      Cc: Andi Kleen <ak@suse.de>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      690dbe1c
    • L
      Fix get_user_pages() race for write access · 4ceb5db9
      Linus Torvalds 提交于
      There's no real guarantee that handle_mm_fault() will always be able to
      break a COW situation - if an update from another thread ends up
      modifying the page table some way, handle_mm_fault() may end up
      requiring us to re-try the operation.
      
      That's normally fine, but get_user_pages() ended up re-trying it as a
      read, and thus a write access could in theory end up losing the dirty
      bit or be done on a page that had not been properly COW'ed.
      
      This makes get_user_pages() always retry write accesses as write
      accesses by making "follow_page()" require that a writable follow has
      the dirty bit set.  That simplifies the code and solves the race: if the
      COW break fails for some reason, we'll just loop around and try again.
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      4ceb5db9
  8. 31 7月, 2005 1 次提交
  9. 28 7月, 2005 4 次提交
    • A
      [PATCH] Remove bogus warning in page_alloc.c · 12b1c5f3
      Andy Whitcroft 提交于
      Originally __free_pages_bulk used the relative page number within a zone to
      define its buddies.  This meant that to maintain the "maximally aligned"
      requirements (that an allocation of size N will be aligned at least to N
      physically) zones had to also be aligned to 1<<MAX_ORDER pages.  When
      __free_pages_bulk was updated to use the relative page frame numbers of the
      free'd pages to pair buddies this released the alignment constraint on the
      'left' edge of the zone.  This allows _either_ edge of the zone to contain
      partial MAX_ORDER sized buddies.  These simply never will have matching
      buddies and thus will never make it to the 'top' of the pyramid.
      
      The patch below removes a now redundant check ensuring that the mem_map was
      aligned to MAX_ORDER.
      Signed-off-by: NAndy Whitcroft <apw@shadowen.org>
      Cc: Christoph Lameter <christoph@lameter.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      12b1c5f3
    • S
      [PATCH] madvise() does not always return -EBADF on non-file mapped area · 165cd402
      suzuki 提交于
      The madvise() system call returns -EBADF for areas which does not map to
      files, only for *behaviour* request MADV_WILLNEED.
      
      According to man pages, madvise returns :
      
      EBADF - the map exists, but the area maps something that isn't a file.
      
      Fixes bug 2995.
      Signed-off-by: NSuzuki K P <suzuki@in.ibm.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      165cd402
    • A
      [PATCH] check_user_page_readable() deadlock fix · 1aaf18ff
      Andrew Morton 提交于
      Fix bug identifued by Richard Purdie <rpurdie@rpsys.net>.
      
      oprofile calls check_user_page_readable() from interrupt context, so we
      deadlock over various VFS locks.
      
      But check_user_page_readable() doesn't imply either a read or a write of the
      page's contents.  Change __follow_page() so that check_user_page_readable()
      can tell __follow_page() that we're not accessing the page's contents, and use
      that info to avoid the troublesome lock-takings.
      
      Also, make follow_page() inline for the single callsite in memory.c to save a
      bit of stack space.
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      1aaf18ff
    • A
      [PATCH] Undo mempolicy shared policy rbtree microoptimization · 90c5029e
      Andi Kleen 提交于
      All mempolicy changes must be inside the spinlock and readding the rb_erase
      prevents a crash while doing:
      
      > echo "1" > /tmp/numatest
      > numactl --length=0x4000 --shm /tmp/numatest --localalloc
      > numactl --length=0x2000 --offset=0 --shm /tmp/numatest --membind=0
      > numactl --length=0x2000 --offset=0x2000 --shm /tmp/numatest --membind=1
      > ipcs
      > ipcrm -M "the_key_value_of_this_shm_area"
      
      Based on a patch by John Blackwood
      
      Cc: <john.blackwood@ccur.com>
      Cc: <andrea@suse.de>
      Signed-off-by: NAndi Kleen <ak@suse.de>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      90c5029e
  10. 16 7月, 2005 1 次提交
    • C
      [PATCH] execute-in-place fixes · afa597ba
      Carsten Otte 提交于
      This patch includes feedback from Andrew and Christoph. Thanks for
      taking time to review.
      
      Use of empty_zero_page was eliminated to fix compilation for architectures
      that don't have it.
      
      This patch removes setting pages up-to-date in ext2_get_xip_page and all
      bug checks to verify that the page is indeed up to date.  Setting the page
      state on mapping to userland is bogus.  None of the code patchs involved
      with these pages in mm cares about the page state.
      
      still on my ToDo list: identify a place outside second extended where
      __inode_direct_access should reside
      Signed-off-by: NCarsten Otte <cotte@de.ibm.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      afa597ba
  11. 13 7月, 2005 1 次提交
  12. 08 7月, 2005 4 次提交
  13. 07 7月, 2005 1 次提交
  14. 29 6月, 2005 1 次提交
  15. 28 6月, 2005 1 次提交
  16. 26 6月, 2005 7 次提交
  17. 24 6月, 2005 1 次提交