1. 12 2月, 2007 2 次提交
  2. 10 2月, 2007 4 次提交
  3. 01 2月, 2007 1 次提交
  4. 31 1月, 2007 2 次提交
    • A
      [PATCH] Don't allow the stack to grow into hugetlb reserved regions · 0d59a01b
      Adam Litke 提交于
      When expanding the stack, we don't currently check if the VMA will cross
      into an area of the address space that is reserved for hugetlb pages.
      Subsequent faults on the expanded portion of such a VMA will confuse the
      low-level MMU code, resulting in an OOPS.  Check for this.
      Signed-off-by: NAdam Litke <agl@us.ibm.com>
      Cc: David Gibson <david@gibson.dropbear.id.au>
      Cc: William Lee Irwin III <wli@holomorphy.com>
      Cc: Hugh Dickins <hugh@veritas.com>
      Cc: <stable@kernel.org>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      0d59a01b
    • H
      [PATCH] mm: mremap correct rmap accounting · 701dfbc1
      Hugh Dickins 提交于
      Nick Piggin points out that page accounting on MIPS multiple ZERO_PAGEs
      is not maintained by its move_pte, and could lead to freeing a ZERO_PAGE.
      
      Instead of complicating that move_pte, just forget the minor optimization
      when mremapping, and change the one thing which needed it for correctness
      - filemap_xip use ZERO_PAGE(0) throughout instead of according to address.
      
      [ "There is no block device driver one could use for XIP on mips
         platforms" - Carsten Otte ]
      Signed-off-by: NHugh Dickins <hugh@veritas.com>
      Cc: Nick Piggin <nickpiggin@yahoo.com.au>
      Cc: Andrew Morton <akpm@osdl.org>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Carsten Otte <cotte@de.ibm.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      701dfbc1
  5. 30 1月, 2007 1 次提交
    • L
      Fix balance_dirty_page() calculations with CONFIG_HIGHMEM · dc6e29da
      Linus Torvalds 提交于
      This makes balance_dirty_page() always base its calculations on the
      amount of non-highmem memory in the machine, rather than try to base it
      on total memory and then falling back on non-highmem memory if the
      mapping it was writing wasn't highmem capable.
      
      This not only fixes a situation where two different writers can have
      wildly different notions about what is a "balanced" dirty state, but it
      also means that people with highmem machines don't run into an OOM
      situation when regular memory fills up with dirty pages.
      
      We used to try to handle the latter case by scaling down the dirty_ratio
      if the machine had a lot of highmem pages in page_writeback_init(), but
      it wasn't aggressive enough for some situations, and since basing the
      dirty ratio on highmem memory was broken in the first place, let's just
      stop doing so.
      
      (A variation of this theme fixed Justin Piszcz's OOM problem when
      copying an 18GB file on a RAID setup).
      Acked-by: NNick Piggin <nickpiggin@yahoo.com.au>
      Cc: Justin Piszcz <jpiszcz@lucidpixels.com>
      Cc: Andrew Morton <akpm@osdl.org>
      Cc: Neil Brown <neilb@suse.de>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Randy Dunlap <rdunlap@xenotime.net>
      Cc: Christoph Lameter <clameter@sgi.com>
      Cc: Jens Axboe <jens.axboe@oracle.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Adrian Bunk <bunk@stusta.de>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      dc6e29da
  6. 27 1月, 2007 4 次提交
  7. 23 1月, 2007 1 次提交
  8. 13 1月, 2007 1 次提交
  9. 12 1月, 2007 2 次提交
    • T
      [PATCH] NFS: Fix race in nfs_release_page() · e3db7691
      Trond Myklebust 提交于
          NFS: Fix race in nfs_release_page()
      
          invalidate_inode_pages2() may find the dirty bit has been set on a page
          owing to the fact that the page may still be mapped after it was locked.
          Only after the call to unmap_mapping_range() are we sure that the page
          can no longer be dirtied.
          In order to fix this, NFS has hooked the releasepage() method and tries
          to write the page out between the call to unmap_mapping_range() and the
          call to remove_mapping(). This, however leads to deadlocks in the page
          reclaim code, where the page may be locked without holding a reference
          to the inode or dentry.
      
          Fix is to add a new address_space_operation, launder_page(), which will
          attempt to write out a dirty page without releasing the page lock.
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      
          Also, the bare SetPageDirty() can skew all sort of accounting leading to
          other nasties.
      
      [akpm@osdl.org: cleanup]
      Signed-off-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Trond Myklebust <Trond.Myklebust@netapp.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      e3db7691
    • D
      [PATCH] Fix sparsemem on Cell · a2f3aa02
      Dave Hansen 提交于
      Fix an oops experienced on the Cell architecture when init-time functions,
      early_*(), are called at runtime.  It alters the call paths to make sure
      that the callers explicitly say whether the call is being made on behalf of
      a hotplug even, or happening at boot-time.
      
      It has been compile tested on ppc64, ia64, s390, i386 and x86_64.
      Acked-by: NArnd Bergmann <arndb@de.ibm.com>
      Signed-off-by: NDave Hansen <haveblue@us.ibm.com>
      Cc: Yasunori Goto <y-goto@jp.fujitsu.com>
      Acked-by: NAndy Whitcroft <apw@shadowen.org>
      Cc: Christoph Lameter <clameter@engr.sgi.com>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Acked-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      a2f3aa02
  10. 09 1月, 2007 1 次提交
    • R
      [ARM] pass vma for flush_anon_page() · a6f36be3
      Russell King 提交于
      Since get_user_pages() may be used with processes other than the
      current process and calls flush_anon_page(), flush_anon_page() has to
      cope in some way with non-current processes.
      
      It may not be appropriate, or even desirable to flush a region of
      virtual memory cache in the current process when that is different to
      the process that we want the flush to occur for.
      
      Therefore, pass the vma into flush_anon_page() so that the architecture
      can work out whether the 'vmaddr' is for the current process or not.
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      a6f36be3
  11. 06 1月, 2007 6 次提交
  12. 31 12月, 2006 4 次提交
  13. 30 12月, 2006 1 次提交
    • L
      VM: Fix nasty and subtle race in shared mmap'ed page writeback · 7658cc28
      Linus Torvalds 提交于
      The VM layer (on the face of it, fairly reasonably) expected that when
      it does a ->writepage() call to the filesystem, it would write out the
      full page at that point in time.  Especially since it had earlier marked
      the whole page dirty with "set_page_dirty()".
      
      But that isn't actually the case: ->writepage() does not actually write
      a page, it writes the parts of the page that have been explicitly marked
      dirty before, *and* that had not got written out for other reasons since
      the last time we told it they were dirty.
      
      That last caveat is the important one.
      
      Which _most_ of the time ends up being the whole page (since we had
      called "set_page_dirty()" on the page earlier), but if the filesystem
      had done any dirty flushing of its own (for example, to honor some
      internal write ordering guarantees), it might end up doing only a
      partial page IO (or none at all) when ->writepage() is actually called.
      
      That is the correct thing in general (since we actually often _want_
      only the known-dirty parts of the page to be written out), but the
      shared dirty page handling had implicitly forgotten about these details,
      and had a number of cases where it was doing just the "->writepage()"
      part, without telling the low-level filesystem that the whole page might
      have been re-dirtied as part of being mapped writably into user space.
      
      Since most of the time the FS did actually write out the full page, we
      didn't notice this for a loong time, and this needed some really odd
      patterns to trigger.  But it caused occasional corruption with rtorrent
      and with the Debian "apt" database, because both use shared mmaps to
      update the end result.
      
      This fixes it. Finally. After way too much hair-pulling.
      Acked-by: NNick Piggin <nickpiggin@yahoo.com.au>
      Acked-by: NMartin J. Bligh <mbligh@google.com>
      Acked-by: NMartin Michlmayr <tbm@cyrius.com>
      Acked-by: NMartin Johansson <martin@fatbob.nu>
      Acked-by: NIngo Molnar <mingo@elte.hu>
      Acked-by: NAndrei Popa <andrei.popa@i-neo.ro>
      Cc: High Dickins <hugh@veritas.com>
      Cc: Andrew Morton <akpm@osdl.org>,
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Segher Boessenkool <segher@kernel.crashing.org>
      Cc: David Miller <davem@davemloft.net>
      Cc: Arjan van de Ven <arjan@infradead.org>
      Cc: Gordon Farquharson <gordonfarquharson@gmail.com>
      Cc: Guillaume Chazarain <guichaz@yahoo.fr>
      Cc: Theodore Tso <tytso@mit.edu>
      Cc: Kenneth Cheng <kenneth.w.chen@intel.com>
      Cc: Tobias Diedrich <ranma@tdiedrich.de>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      7658cc28
  14. 24 12月, 2006 1 次提交
  15. 23 12月, 2006 7 次提交
  16. 22 12月, 2006 2 次提交
    • A
      [PATCH] truncate: clear page dirtiness before running try_to_free_buffers() · 3e67c098
      Andrew Morton 提交于
      truncate presently invalidates the dirty page's buffer_heads then shoots down
      the page.  But try_to_free_buffers() will now bale out because the page is
      dirty.
      
      Net effect: the LRU gets filled with dirty pages which have invalidated
      buffer_heads attached.  They have no ->mapping and hence cannot be cleaned.
      The machine leaks memory at an enormous rate.
      
      Fix this by cleaning the page before running try_to_free_buffers(), so
      try_to_free_buffers() can do its work.
      
      Also, remember to do dirty-page-acoounting in cancel_dirty_page() so the
      machine won't wedge up trying to write non-existent dirty pages.
      
      Probably still wrong, but now less so.
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      3e67c098
    • L
      VM: Remove "clear_page_dirty()" and "test_clear_page_dirty()" functions · fba2591b
      Linus Torvalds 提交于
      They were horribly easy to mis-use because of their tempting naming, and
      they also did way more than any users of them generally wanted them to
      do.
      
      A dirty page can become clean under two circumstances:
      
       (a) when we write it out.  We have "clear_page_dirty_for_io()" for
           this, and that function remains unchanged.
      
           In the "for IO" case it is not sufficient to just clear the dirty
           bit, you also have to mark the page as being under writeback etc.
      
       (b) when we actually remove a page due to it becoming inaccessible to
           users, notably because it was truncate()'d away or the file (or
           metadata) no longer exists, and we thus want to cancel any
           outstanding dirty state.
      
      For the (b) case, we now introduce "cancel_dirty_page()", which only
      touches the page state itself, and verifies that the page is not mapped
      (since cancelling writes on a mapped page would be actively wrong as it
      is still accessible to users).
      
      Some filesystems need to be fixed up for this: CIFS, FUSE, JFS,
      ReiserFS, XFS all use the old confusing functions, and will be fixed
      separately in subsequent commits (with some of them just removing the
      offending logic, and others using clear_page_dirty_for_io()).
      
      This was confirmed by Martin Michlmayr to fix the apt database
      corruption on ARM.
      
      Cc: Martin Michlmayr <tbm@cyrius.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Hugh Dickins <hugh@veritas.com>
      Cc: Nick Piggin <nickpiggin@yahoo.com.au>
      Cc: Arjan van de Ven <arjan@infradead.org>
      Cc: Andrei Popa <andrei.popa@i-neo.ro>
      Cc: Andrew Morton <akpm@osdl.org>
      Cc: Dave Kleikamp <shaggy@linux.vnet.ibm.com>
      Cc: Gordon Farquharson <gordonfarquharson@gmail.com>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Trond Myklebust <trond.myklebust@fys.uio.no>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      fba2591b