1. 22 Dec, 2006 20 commits
  2. 21 Dec, 2006 20 commits
    • Andrew Morton's avatar
      [PATCH] truncate: clear page dirtiness before running try_to_free_buffers() · 3e67c098
      Andrew Morton authored
      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: default avatarAndrew Morton <akpm@osdl.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      3e67c098
    • David Chinner's avatar
      [PATCH] Fix XFS after clear_page_dirty() removal · 92132021
      David Chinner authored
      XFS appears to call clear_page_dirty to get the mapping tree dirty tag
      set correctly at the same time the page dirty flag is cleared.  I note
      that this can be done by set_page_writeback() if we clear the dirty flag
      on the page first when we are writing back the entire page.
      
      Hence it seems to me that the XFS call to clear_page_dirty() could
      easily be substituted by clear_page_dirty_for_io() followed by a call to
      set_page_writeback() to get the mapping tree tags set correctly after
      the page has been marked clean.
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      92132021
    • Miklos Szeredi's avatar
      [PATCH] fuse: remove clear_page_dirty() call · 9280f682
      Miklos Szeredi authored
      The use by FUSE was just a remnant of an optimization from the time
      when writable mappings were supported.
      
      Now FUSE never actually allows the creation of dirty pages, so this
      invocation of clear_page_dirty() is effectively a no-op.
      Signed-off-by: default avatarMiklos Szeredi <miklos@szeredi.hu>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      9280f682
    • Dave Kleikamp's avatar
      [PATCH] Fix JFS after clear_page_dirty() removal · d0e671a9
      Dave Kleikamp authored
      This patch removes some questionable code that attempted to make a
      no-longer-used page easier to reclaim.
      
      Calling metapage_writepage against such a page will not result in any
      I/O being performed, so removing this code shouldn't be a big deal.
      
      [ It's likely that we could have just replaced the "clear_page_dirty()"
        call with a call to "cancel_dirty_page()" instead, but in the
        meantime this is cleaner and simpler anyway, so unless there is some
        overriding reason (and Dave implies there isn't) I'll just use this
        patch as-is.			- Linus ]
      Signed-off-by: default avatarDave Kleikamp <shaggy@linux.vnet.ibm.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      d0e671a9
    • Linus Torvalds's avatar
      VM: Remove "clear_page_dirty()" and "test_clear_page_dirty()" functions · fba2591b
      Linus Torvalds authored
      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: default avatarLinus Torvalds <torvalds@osdl.org>
      fba2591b
    • Linus Torvalds's avatar
      Clean up and make try_to_free_buffers() not race with dirty pages · 46d2277c
      Linus Torvalds authored
      This is preparatory work in our continuing saga on some hard-to-trigger
      file corruption with shared writable mmap() after the dirty page
      tracking changes (commit d08b3851 etc)
      were merged.
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      46d2277c
    • Ingo Molnar's avatar
      [PATCH] workqueue: fix schedule_on_each_cpu() · 9bfb1839
      Ingo Molnar authored
      fix the schedule_on_each_cpu() implementation: __queue_work() is now
      stricter, hence set the work-pending bit before passing in the new work.
      
      (found in the -rt tree, using Peter Zijlstra's files-lock scalability
      patchset)
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      9bfb1839
    • Al Viro's avatar
      [PATCH] fix leaks on pipe(2) failure exits · 5ccac88e
      Al Viro authored
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      5ccac88e
    • Linus Torvalds's avatar
      Merge master.kernel.org:/pub/scm/linux/kernel/git/steve/gfs2-2.6-fixes · ba6d8b1e
      Linus Torvalds authored
      * master.kernel.org:/pub/scm/linux/kernel/git/steve/gfs2-2.6-fixes:
        [GFS2] Fix Kconfig
        [DLM] fix compile warning
      ba6d8b1e
    • Peter Williams's avatar
      [PATCH] sched: improve efficiency of sched_fork() · bc947631
      Peter Williams authored
      Problem:
        sched_fork() has always called scheduler_tick() in some (unlikely)
        circumstances in order to update the current task in light of those
        circumstances.  It has always been the case that the work done by
        scheduler_tick() was more than was required to handle the problem in
        hand but no harm was done except for the waste of a few CPU cycles.
      
        However, the splitting of scheduler_tick() into two procedures in
        2.6.20-rc1 enables the wasted cycles to be saved as the new procedure
        task_running_tick() does all the work that is required to rectify the
        problem being handled.
      
      Solution:
        Replace the call to scheduler_tick() in sched_fork() with a call to
        task_running_tick().
      Signed-off-by: default avatarPeter Williams <pwil3058@bigpond.com.au>
      Acked-by: default avatarIngo Molnar <mingo@elte.hu>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      bc947631
    • Ingo Molnar's avatar
      [PATCH] x86_64: fix boot time hang in detect_calgary() · 136f1e7a
      Ingo Molnar authored
      if CONFIG_CALGARY_IOMMU is built into the kernel via
      CONFIG_CALGARY_IOMMU_ENABLED_BY_DEFAULT, or is enabled via the
      iommu=calgary boot option, then the detect_calgary() function runs to
      detect the presence of a Calgary IOMMU.
      
      detect_calgary() first searches the BIOS EBDA area for a "rio_table_hdr"
      BIOS table. It has this parsing algorithm for the EBDA:
      
      	while (offset) {
      		...
      		/* The next offset is stored in the 1st word. 0 means no more */
       		offset = *((unsigned short *)(ptr + offset));
      	}
      
      got that? Lets repeat it slowly: we've got a BIOS-supplied data
      structure, plus Linux kernel code that will only break out of an
      infinite parsing loop once the BIOS gives a zero offset. Ok?
      
      Translation: what an excellent opportunity for BIOS writers to lock up
      the Linux boot process in an utterly hard to debug place! Indeed the
      BIOS jumped on that opportunity on my box, which has the following EBDA
      chaining layout:
      
        384, 65282, 65535, 65535, 65535, 65535, 65535, 65535 ...
      
      see the pattern? So my, definitely non-Calgary system happily locks up
      in detect_calgary()!
      
      the patch below fixes the boot hang by trusting the BIOS-supplied data
      structure a bit less: the parser always has to make forward progress,
      and if it doesnt, we break out of the loop and i get the expected kernel
      message:
      
        Calgary: Unable to locate Rio Grande Table in EBDA - bailing!
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      Acked-by: default avatarMuli Ben-Yehuda <muli@il.ibm.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      136f1e7a
    • Ingo Molnar's avatar
      [PATCH] x86_64: fix boot hang caused by CALGARY_IOMMU_ENABLED_BY_DEFAULT · a9622f62
      Ingo Molnar authored
      one of my boxes didnt boot the 2.6.20-rc1-rt0 kernel rpm, it hung during
      early bootup. After an hour or two of happy debugging i narrowed it down
      to the CALGARY_IOMMU_ENABLED_BY_DEFAULT option, which was freshly added
      to 2.6.20 via the x86_64 tree and /enabled by default/.
      
      commit bff6547b claims:
      
          [PATCH] Calgary: allow compiling Calgary in but not using it by default
      
          This patch makes it possible to compile Calgary in but not use it by
          default. In this mode, use 'iommu=calgary' to activate it.
      
      but the change does not actually practice it:
      
       config CALGARY_IOMMU_ENABLED_BY_DEFAULT
              bool "Should Calgary be enabled by default?"
              default y
              depends on CALGARY_IOMMU
              help
                Should Calgary be enabled by default? if you choose 'y', Calgary
                will be used (if it exists). If you choose 'n', Calgary will not be
                used even if it exists. If you choose 'n' and would like to use
                Calgary anyway, pass 'iommu=calgary' on the kernel command line.
                If unsure, say Y.
      
      it's both 'default y', and says "If unsure, say Y". Clearly not a typo.
      
      disabling this option makes my box boot again. The patch below fixes the
      Kconfig entry. Grumble.
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      a9622f62
    • Geert Uytterhoeven's avatar
      [PATCH] __set_irq_handler bogus space · b039db8e
      Geert Uytterhoeven authored
      __set_irq_handler: Kill a bogus space
      Signed-off-by: default avatarGeert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
      b039db8e
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://brick.kernel.dk/data/git/linux-2.6-block · 46040967
      Linus Torvalds authored
      * 'for-linus' of git://brick.kernel.dk/data/git/linux-2.6-block:
        [PATCH] block: document io scheduler allow_merge_fn hook
        [PATCH] cfq-iosched: don't allow sync merges across queues
        [PATCH] Fixup blk_rq_unmap_user() API
        [PATCH] __blk_rq_unmap_user() fails to return error
        [PATCH] __blk_rq_map_user() doesn't need to grab the queue_lock
        [PATCH] Remove queue merging hooks
        [PATCH] ->nr_sectors and ->hard_nr_sectors are not used for BLOCK_PC requests
        [PATCH] cciss: fix XFER_READ/XFER_WRITE in do_cciss_request
        [PATCH] cciss: set default raid level when reading geometry fails
      46040967
    • Linus Torvalds's avatar
      Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev · 8df8bb4a
      Linus Torvalds authored
      * 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev:
        [libata] sata_svw, sata_vsc: kill iomem warnings
        [PATCH] libata: take scmd->cmd_len into account when translating SCSI commands
        [PATCH] libata: kill @cdb argument from xlat methods
        [PATCH] libata: clean up variable name usage in xlat related functions
        [libata] Move some PCI IDs from sata_nv to ahci
        [libata] pata_via: suspend/resume support fix
        [libata] pata_cs5530: suspend/resume support tweak
      8df8bb4a
    • Linus Torvalds's avatar
      Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6 · 28cb5ccd
      Linus Torvalds authored
      * master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6:
        Driver core: proper prototype for drivers/base/init.c:driver_init()
        kobject: kobject_uevent() returns manageable value
        kref refcnt and false positives
      28cb5ccd
    • Linus Torvalds's avatar
      Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/pci-2.6 · de9b2fcc
      Linus Torvalds authored
      * master.kernel.org:/pub/scm/linux/kernel/git/gregkh/pci-2.6: (22 commits)
        acpiphp: Link-time error for PCI Hotplug
        shpchp: cleanup shpchp.h
        shpchp: remove shpchprm_get_physical_slot_number
        shpchp: cleanup struct controller
        shpchp: remove unnecessary struct php_ctlr
        PCI: ATI sb600 sata quirk
        PCI legacy resource fix
        PCI: don't export device IDs to userspace
        PCI: Be a bit defensive in quirk_nvidia_ck804() so we don't risk dereferencing a NULL pdev.
        PCI: Fix multiple problems with VIA hardware
        PCI: Only check the HT capability bits in mpic.c
        PCI: Use pci_find_ht_capability() in drivers/pci/quirks.c
        PCI: Add #defines for Hypertransport MSI fields
        PCI: Use pci_find_ht_capability() in drivers/pci/htirq.c
        PCI: Add pci_find_ht_capability() for finding Hypertransport capabilities
        PCI: Create __pci_bus_find_cap_start() from __pci_bus_find_cap()
        pci: Introduce pci_find_present
        PCI: pcieport-driver: remove invalid warning message
        rpaphp: compiler warning cleanup
        PCI quirks: remove redundant check
        ...
      de9b2fcc
    • Linus Torvalds's avatar
      Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/usb-2.6 · fb34d203
      Linus Torvalds authored
      * master.kernel.org:/pub/scm/linux/kernel/git/gregkh/usb-2.6: (34 commits)
        USB Storage: remove duplicate Nokia entry in unusual_devs.h
        [PATCH] bluetooth: add support for another Kensington dongle
        [PATCH] usb serial: add support for Novatel S720/U720 CDMA/EV-DO modems
        [PATCH] USB: Nokia E70 is an unusual device
        USB: fix to usbfs_snoop logging of user defined control urbs
        USB: at91_udc: Additional checks
        USB: at91_udc: Cleanup variables after failure in usb_gadget_register_driver()
        USB: at91_udc: allow drivers that support high speed
        USB: u132-hcd/ftdi-elan: add support for Option GT 3G Quad card
        USB: at91_udc, misc fixes
        USB: at91 udc, support at91sam926x addresses
        USB: OHCI support for PNX8550
        USB: ohci handles hardware faults during root port resets
        USB: ohci at91 warning fix
        USB: ohci whitespace/comment fixups
        USB: MAINTAINERS update, EHCI and OHCI
        USB: gadget driver unbind() is optional; section fixes; misc
        UHCI: module parameter to ignore overcurrent changes
        USB: Nokia E70 is an unusual device
        USB AUERSWALD: replace kmalloc+memset with kzalloc
        ...
      fb34d203
    • Linus Torvalds's avatar
      Merge branch 'merge' of master.kernel.org:/pub/scm/linux/kernel/git/paulus/powerpc · 5576d187
      Linus Torvalds authored
      * 'merge' of master.kernel.org:/pub/scm/linux/kernel/git/paulus/powerpc:
        [POWERPC] Fix register save area alignment for swapcontext syscall
        [POWERPC] Fix PCI device channel state initialization
        [POWERPC] Update MTD OF documentation
        [POWERPC] Probe Efika platform before CHRP.
        [POWERPC] Fix build of cell zImage.initrd
        [POWERPC] iSeries: fix CONFIG_VIOPATH dependency
        [POWERPC] iSeries: fix viocons init
        [POWERPC] iSeries: fix viocd init
        [POWERPC] iSeries: fix iseries_veth init
        [POWERPC] iSeries: fix viotape init
        [POWERPC] iSeries: fix viodasd init
        [POWERPC] Workaround oldworld OF bug with IRQs & P2P bridges
        [POWERPC] powerpc: add scanning of ebc bus to of_platform
        [POWERPC] spufs: fix assignment of node numbers
        [POWERPC] cell: Fix spufs with "new style" device-tree
        [POWERPC] cell: Enable spider workarounds on all PCI buses
        [POWERPC] cell: add forward struct declarations to spu.h
        [POWERPC] cell: update cell_defconfig
      5576d187
    • Linus Torvalds's avatar
      Merge branch 'drm-patches' of master.kernel.org:/pub/scm/linux/kernel/git/airlied/drm-2.6 · ee2fae03
      Linus Torvalds authored
      * 'drm-patches' of master.kernel.org:/pub/scm/linux/kernel/git/airlied/drm-2.6:
        drm: Stop defining pci_pretty_name
        drm: r128: comment aligment with drm git
        drm: make kernel context switch same as for drm git tree.
        drm: fixup comment header style
        drm: savage: compat fix from drm git.
        drm: Unify radeon offset checking.
        i915_vblank_tasklet: Try harder to avoid tearing.
        DRM: handle pci_enable_device failure
        drm: fix return value check
      ee2fae03