1. 22 Mar, 2003 28 commits
    • Andrew Morton's avatar
      [PATCH] ext3: fix use-after-free bug · 7dbfb92c
      Andrew Morton authored
      ext3_writepage() calls ext3_journal_stop(), which dereferences the affected
      inode.
      
      It does this _after_ writing the page out, which is illegal.  The IO can
      complete, the page can be repeased from the inode and the inode can be freed
      up.
      
      It's a long-standing bug.  It has been reported happening on preemptible
      kernels, where the timing window is larger.
      
      Fix that up by teaching ext3_journal_stop to locate the superblock via the
      journal structure, not via the inode.
      
      This means that ext3_journal_stop() does not need the inode argument at all.
      
      Also uninline the affected functions.  It saves 5.5 kbytes.
      
      Also remove the setting of sb->s_dirt in ext3_journal_stop().  That was an
      awkward way of telling sys_sync() that the filesystem needs a commit, and
      with the ext3_sync_fs() that is no longer needed.
      7dbfb92c
    • Andrew Morton's avatar
      [PATCH] pagecache accounting speedup · 34f2047d
      Andrew Morton authored
      From: Alex Tomas <bzzz@tmi.comex.ru>
      
      This is the second half of the vm_enough_memory() speedup.
      
      When overcommit_memory != 1, vm_enough_memory() calls get_page_state() to
      calculate the amount of used pagecache.  It does this on every call to
      sys_brk().
      
      get_page_state() is really expensive on SMP.
      
      So the patch arranges for pagecache accounting to be in a global atomic_t,
      with per-cpu batching and approximate accounting to amortise the cost of the
      global atomic.
      
      The nr_pagecache field of /proc/vmstat is removed.
      34f2047d
    • Andrew Morton's avatar
      [PATCH] simplify the timer lockup avoidance code · ff0cbc78
      Andrew Morton authored
      From: george anzinger <george@mvista.com>
      
      The recently-added code which avoids a lockup when a timer handler re-adds
      the timer right now can be simplified.
      
      If we change __run_timers() to increment base->timer_jiffies _before_ running
      the timers, then any re-additions will not be inserted in the list which
      __run_timers is presently walking.
      ff0cbc78
    • Andrew Morton's avatar
      [PATCH] timer simplification · c6e7381d
      Andrew Morton authored
      From: george anzinger <george@mvista.com>
      
      Remove the `index' field from the timer structures.  It contains the same
      info as the timer_jiffies field.
      
      So just use the base->timer_jiffies field directly.
      c6e7381d
    • Andrew Morton's avatar
      [PATCH] dev_t [3/3]: major.h cleanups · 2fea0250
      Andrew Morton authored
      Patch from Andries.Brouwer@cwi.nl
      
      The third patch removes the last occurrences of MAX_BLKDEV and MAX_CHRDEV and
      sorts the majors in major.h.  It also updates the definition of
      SCSI_DISK_MAJOR.
      2fea0250
    • Andrew Morton's avatar
      [PATCH] dev_t [2/3] - remove MAX_CHRDEV · 826d245f
      Andrew Morton authored
      Patch from Andries.Brouwer@cwi.nl
      
      The actual patch for today is this part.  I already quoted most of this on
      the list earlier this week.
      
      In order not to have to change all drivers, I did
      
      +int register_chrdev(unsigned int major, const char *name,
      +                   struct file_operations *fops)
      +{
      +       return register_chrdev_region(major, 0, 256, name, fops);
      +}
      
      so that the old register_chrdev registers a single major and 256 minors.
      Later this can be changed (but see my letter to Al last week).
      
      The only driver that is tricky is the tty driver.  Here some major cleanup
      happened - all tty specific stuff disappeared from char_dev.c, and tty uses
      the actual register_chrdev_region() call.
      
      There is a race in register_chrdev_region() that I did not worry about: when
      two dynamic majors 0 are registered simultaneously, one of them will be first
      and the other one gets -EBUSY.  If this is a problem, the code there will
      have to be uglified a little.  I didn't do that because it disappears again
      in a subsequent patch.
      826d245f
    • Andrew Morton's avatar
      [PATCH] dev_t [1/3]: kill cdev · c2e562b9
      Andrew Morton authored
      Patch from Andries.Brouwer@cwi.nl
      
      Now that 2.5.65 is out, the next dev_t patch.  It was a bit large and
      unreadable, so I split it into three clean pieces.  Afterwards, since many
      people ask for this, a fourth patch that actually changes the type of dev_t
      (not to be applied yet, that is just for playing).
      
      The first patch is the cdev-kill patch that I sent out earlier.  It is no use
      having two forms of chardev registration in the source, and my version of the
      path of small modifications does not pass through this version, although the
      final result will not be that different.  So, kill cdev_cachep,
      cdev_cache_init, cdfind, cdget, cdput, inode->i_cdev, struct char_device.
      All of this is dead code today.
      
      The second patch removes MAX_CHRDEV.
      
      The third patch polishes linux/major.h.
      c2e562b9
    • Andrew Morton's avatar
      [PATCH] mwave oops fixes · c290f965
      Andrew Morton authored
      The mwave driver oopses if you do not have the hardware installed.  It is
      running device_unregister() and device_remove_file() against things whch were
      never created.
      c290f965
    • Andrew Morton's avatar
      [PATCH] make the bdevname() API sane · 500b81a8
      Andrew Morton authored
      bdevname returns a pointer to a static string.  Change it so that the caller
      passes in the buffer.
      500b81a8
    • Andrew Morton's avatar
      [PATCH] register_blkdev() fixes · b548867b
      Andrew Morton authored
      - It was racy, if two threads try to register a blockdev with major=0 they
        could both choose the same major for different devices.
      
        Fix that by extending the coverage of the rwsem.
      
      - kmalloced local variable `p' was leaking on an error path.
      b548867b
    • Andrew Morton's avatar
      [PATCH] __bdevname atomicity fix · 17817dc3
      Andrew Morton authored
      This function was recently converted to use rwsem locking.  But it is called
      from interrupts in (at least) buffer_io_error().
      
      And we do want a function like this to be robust and atomic.  So convert it
      to use spinlocking.
      17817dc3
    • Andrew Morton's avatar
      [PATCH] remove lock_kernel() from readdir implementations. · 81140ca3
      Andrew Morton authored
      Filesystems which are using generic_file_llseek() do not need lock_kernel()
      in their readir implementations.  All operations (including llseek) are
      serialised by the directory's i_sem.
      
      Just fix ext2 and ext3 for now.  Others may need locking between readdir and
      who-knows-what.
      81140ca3
    • Andrew Morton's avatar
      [PATCH] speed up vm_enough_memory() · 29580832
      Andrew Morton authored
      This function is called a lot.  Every brk().  The atomic_add() against a
      global counter hurts on large SMP machines.
      
      The patch simply reduces the rate at which that atomic operation is
      performed, by accumulating a per-cpu count which is spilled into the global
      counter when the local counter overflows.
      
      It trades off efficiency for a little inaccuracy.
      
      I tried various implementations involving kmalloc_percpu() and open-coded
      per-cpu arrays in a generic "per-cpu counter" thing.  They all were
      surprisingly sucky - the additional cache misses involved in walking the more
      complex data structures really showed up.
      29580832
    • Andrew Morton's avatar
      [PATCH] remove lock_kernel() from inode_setattr's · 061afd80
      Andrew Morton authored
      vmtruncate() does not need lock_kernel().  And lock_kernel() is not taken by
      other vmtruncate() callers.
      061afd80
    • Andrew Morton's avatar
      [PATCH] Implement a/c/time speedup in ext2 & ext3 · 7018133c
      Andrew Morton authored
      Turn on MS_ONE_SECOND in ext2 and ext3.
      7018133c
    • Andrew Morton's avatar
      [PATCH] inode a/c/mtime modification speedup · fd2134bb
      Andrew Morton authored
      For some filesystems (ext3, reiserfs at least), ->dirty_inode() is very
      expensive.  The kernel is currently calling mark_inode_dirty() at up to 1000
      times/sec/inode.  But there is no need to do this if the filesystem cannot
      store high-resolution times on-disk.
      
      This patch restores the optimisation of only dirtying the filesystem inode
      when its on-disk representation has actually changed.
      
      The filesystem will set the MS_ONE_SECOND flag in sb->s_flags to indicate
      that it wishes to receive this treatment.
      
      The patch does reduce the call rate to ext3_mark_inode_dirty() from 1000/sec
      to 1/sec, but it doesn't make much difference at all to performance because
      we're calling ext3_mark_inode_dirty() from other callsites as well.  Those
      can be optimised too.
      fd2134bb
    • Andrew Morton's avatar
      [PATCH] ppc64 support for file file-offset-in-pte · 00bc7fc6
      Andrew Morton authored
      ppc64 support for file file-offset-in-pte
      00bc7fc6
    • Andrew Morton's avatar
      [PATCH] x86_64: support for file offsets in pte's · 545b71ea
      Andrew Morton authored
      Path from Andi Kleen <ak@muc.de>
      
      Add x86_64 support for file offsets in pte's.
      545b71ea
    • Andrew Morton's avatar
      [PATCH] filemap_populate speedup · 3ec36cbe
      Andrew Morton authored
      filemap_populate() is currently doing page-at-a-time synchronous I/O.  Add a
      call to do_page_cache_readahead() in there so we do a big slurp of IO first.
      
      This is minimal - a lot of the filemap_populate() code can be
      rationalised yet.
      3ec36cbe
    • Andrew Morton's avatar
      [PATCH] Make nonlinear mappings fully pageable · e1513512
      Andrew Morton authored
      This patch requires arch support.  I have patches for ia32, ppc64 and x86_64.
      Other architectures will break.  It is a five-minute fix.  See
      
      	http://mail.nl.linux.org/linux-mm/2003-03/msg00174.html
      
      for implementation details.
      
      
      Patch from: Ingo Molnar <mingo@elte.hu>
      
      the attached patch, against BK-curr, is a preparation to make
      remap_file_pages() usable on swappable vmas as well.  When 'swapping out'
      shared-named mappings the page offset is written into the pte.
      
      it takes one bit from the swap-type bits, otherwise it does not change the
      pte layout - so it should be easy to adapt any other architecture to this
      change as well.  (this patch does not introduce the protection-bits-in-pte
      approach used in my previous patch.)
      
      On 32-bit pte sizes with an effective usable pte range of 29 bits, this
      limits mmap()-able file size to 4096 * 2^29 == 2 TBs.  If the usable range is
      smaller, then the maximum mmap() size is reduced as well.  The worst-case i
      found (PPC) was 2 hw-reserved bits in the swap-case, which limits us to 1 TB
      filesize.  Is there any other hw that has an even worse ratio of sw-usable
      pte bits?
      
      this mmap() limit can be eliminated by simply not converting the swapped out
      pte to a file-pte, but clearning it and falling back to the linear mapping
      upon swapin.  This puts the limit into remap_file_pages() alone, but i really
      hope no-one wants to use remap_file_pages() on a 32-bit platform, on a larger
      than 1-2 TB file.
      
      sys_remap_file_pages() is now enforcing the 'prot' parameter to be zero.
      This restriction might be lifted in the future - i really hope we can have
      more flexible remapping once 64-bit platforms are commonplace - eg.  things
      like memory debuggers could just use the permission bits directly, instead of
      creating many small vmas.
      
      i've tested swappable nonlinear ptes and they are swapped out/in
      correctly.
      
      some other changes in -A0 relative to 2.5.63-BK:
      
       - slightly smarter TLB flushing in install_page(). This is still only a
         stupid helper functions - a more efficient 'walk the pagecache tree
         and pagetable at once and use TLB-gather' implementation is preferred.
      
       - cleanup: pass on pgprot_t instead of unsigned long prot.
      
       - some sanity checks to make sure file_pte() rules are followed.
      
       - do not reduce the vma's default protection to PROT_NONE when using
         remap_file_pages() on it. With swappable ptes this is now safe.
      e1513512
    • Paul Mackerras's avatar
      [PATCH] fix powerbook media bay · 582a045d
      Paul Mackerras authored
      This patch fixes a couple of bugs and compile errors in the powerbook
      media bay driver.  It was getting initialized after the IDE subsystem,
      whereas it needs to be initialized before so that the IDE subsystem
      can see the CD-ROM drive in the bay.
      582a045d
    • Paul Mackerras's avatar
      [PATCH] update mac53c94 scsi driver · f301496d
      Paul Mackerras authored
      This patch updates the mac53c94 scsi HBA driver, used on older
      powermacs, to correspond with the recent scsi subsystem changes, to
      use the PCI DMA API, to not panic, and to use a spinlock instead of
      save_flags/restore_flags/cli/sti.
      f301496d
    • Paul Mackerras's avatar
      [PATCH] update MESH scsi driver · d132e137
      Paul Mackerras authored
      This patch updates the `mesh' scsi driver used on older powermacs to
      correspond with recent changes in the scsi subsystem (things like
      using cmd->device->id instead of cmd->target).
      d132e137
    • Paul Mackerras's avatar
      [PATCH] update via-pmu driver · 1e06dcf9
      Paul Mackerras authored
      This patch forward-ports various fixes to the driver for the PMU
      (power manager unit) on powermacs and powerbooks from 2.4, and in
      particular, some improvements to the battery charge calculations.
      
      From Ben Herrenschmidt.
      1e06dcf9
    • Paul Mackerras's avatar
      [PATCH] SMP-safe macserial driver · b1e16506
      Paul Mackerras authored
      The patch below removes the uses of save_flags/restore_flags/cli
      etc. from the macserial driver and replaces them with a spinlock.
      b1e16506
    • Paul Mackerras's avatar
      [PATCH] update via-cuda driver · c2970ed3
      Paul Mackerras authored
      This patch updates the CUDA driver (the power/reset/ADB controller on
      older powermacs) to fix some SMP issues and to match the 2.4 version
      of the driver.
      
      From Ben Herrenschmidt.
      c2970ed3
    • Paul Mackerras's avatar
      [PATCH] update macintosh-specific headers · 8f7d7732
      Paul Mackerras authored
      This patch updates include/linux/adb.h and include/linux/pmu.h with
      some additional definitions that we need on powermacs and powerbooks.
      8f7d7732
    • Linus Torvalds's avatar
      Merge bk://ppc.bkbits.net/for-linus-ppc · 8035f35c
      Linus Torvalds authored
      into home.transmeta.com:/home/torvalds/v2.5/linux
      8035f35c
  2. 24 Mar, 2003 1 commit
  3. 23 Mar, 2003 6 commits
  4. 22 Mar, 2003 5 commits