1. 15 Jun, 2002 2 commits
  2. 14 Jun, 2002 6 commits
    • Robert Love's avatar
      [PATCH] kernel preemption bits (2/2) · 4d0b85ea
      Robert Love authored
      In both preempt_schedule in sched.c and resume_kernel in entry.S, it is
      possible to return with need_resched set and thus a pending preemption
      but not service that preemption for some time.
      
      Consider:
      
      	- return from schedule() to preempt_schedule
      	- interrupt occurs, sets need_resched
      	- we cannot preempt since preempt_count = PREEMPT_ACTIVE
      	- back in preempt_schedule, set preempt_count = 0
      
      Now we again can preempt, but we will not.  Instead we return and
      continue executing.  On the next interrupt, we will redo the whole
      fiasco which is a waste since we could of reentered schedule while we
      were there.  Worse, if we acquire a lock before the next interrupt we
      can potentially delay the pending reschedule a very long time.  This is
      not acceptable.
      
      The solution is to check for and loop on need_resched on resume_kernel
      and preempt_schedule like schedule itself does.
      4d0b85ea
    • Robert Love's avatar
      [PATCH] kernel preemption bits (1/2) · d257b778
      Robert Love authored
      Two big ouches in x86 entry.S:
      
      (1) Up until 2.5.20, we were not properly reading the irq_stat
          and bh_count values from the right CPU.  Brian Gerst sent you
          a patch to fix this.  This raises the question: why was this not
          a problem?  Seems we do not need this check at all as having a
          nonzero irq_star or bh_count implies having a nonzero preempt_count,
          which we test for above.  Thus this patch removes those tests and
          the related defines.
      
      (2) What if it is possible to preempt even with interrupts disabled?
          Turns out it is.  Consider if we take an exception (say, for a
          TLB miss) and enter resume_kernel and preempt.  Even if interrupts
          are disabled, an exception can occur and end up in resume_kernel.
          We need to check to make sure interrupts are not off, to ensure
          we are not coming off an unmasked exception.
      
      Even with the added check from issue #2, we have less code after #1 so
      we can walk away with a bugfix and an optimization here. ;)
      
      Thanks to George Anzinger, with whom I actually had #2 bite me, and who
      helped with these issues.
      d257b778
    • Martin Dalecki's avatar
      [PATCH] 2.5.21 IDE 91 · 826267d3
      Martin Dalecki authored
       - Realize that the only place where ata_do_taskfile gets used is ide-disk.c
         move it and its "friends' over there.
      
       - Unify the do_request method for disk devices. This saves quite a lot of code.
      
       - Make task_muin_intr and task_in_intr use the same busy status checks on
         entry.
      
       - Unfold get_command at the single only place where it's used.
      
       - Add missing __ata_end_request on kill_rq path.
      
       - Rename udma_tcq_taskfile() to udma_tcq_init to make the code look like to
         normal udma_init. Revert the logics of udma_init and it's
         implementations to mirror that of udma_tcq_init().
      
       - Fix a tiny bug in pmac_udma_init() where it was reporting the wrong value up
         on failure.
      
       - Revert the logics of udma_start(). It's called from udma_init context.
         Realize that it is always returning ide_started. Make it self and the
         implementations of it return void.
      826267d3
    • Martin Dalecki's avatar
      [PATCH] 2.5.21 IDE 90 · 3fb57bd6
      Martin Dalecki authored
       - Implement the assertion that the lock is already held, if we run
         ata_status_poll.
      
       - The usual host chip code load from Bartomiej onierkiewicz.  Fortunately
         I'm able to check the sis5513 fixes on a life system.
      
         More serious stuff... for IDE 88:
      
      	- implement ata_best_pio_mode() in ata-timing.c
      	  (play safer than driver's config_chipset_for_pio())
      
      	- replace config_chipset_for_pio() by ata_best_pio_mode()
      	  in host chips drivers
      	  (trivial for hpt34x.c, hpt366.c and serverworks.c,
      	   non-trivial for cmd64x.c and sis5513.c)
      
      	- set PIO also for (U)DMA modes in cmd64x_tune_chipset()
      	  (cmd64x.c)
      
      	- fix bug in setting PIO0-2 for devices also supporting PIO3/4
      	  (sis5513.c)
      
      	- misc cleanups
      
       - Rename XXX_do_request back do do_request. This was just tmporary tagging.
      
       - Move ata_taskfile() call down to the ide-disk request handler.c, which is the
         only place needing it. Rename ata_taskfile to ata_do_taskfile().  This
         allowed us to implement the assertion that ata_do_taskfile() will be only
         called with the channel lock already held.
      3fb57bd6
    • Martin Dalecki's avatar
      [PATCH] 2.5.21 IDE 89 · caede697
      Martin Dalecki authored
       - fix lock initialization  for device tree handling. Well I would be lucky if
         it would be just a device tree like in Solaris.  But after studying the code
         which goes in right now it appears to develop quite fast in to a "just in
         case" and "ad-hoc" inferface mess we have already in /proc. Shit!
      
         Look for example at the initialization of a device struct. First we have a
         name to the directory encompassing the device and the immediately we fill in
         the georgeous name field - which is enterly unnecessary.
      
       - Pull locking out from the device type drivers do_request handlers.  This
         allowed us to remove the draddy unlocking on entry to start_request.
      
         Much more of host controller rigister acces on crutial code paths is
         now covered by the queue access lock.
      caede697
    • Zwane Mwaikambo's avatar
      ec5d3aca
  3. 13 Jun, 2002 2 commits
  4. 14 Jun, 2002 1 commit
  5. 13 Jun, 2002 15 commits
    • Hugh Dickins's avatar
      [PATCH] swap 3/3 unsafe Dirty check · bff61867
      Hugh Dickins authored
      Todd R. Eigenschink <todd@tekinteractive.com> reported 2.4 swapoff
      kernel BUG at filemap.c:122 to LKML 24 May.  Other problems on that
      system may have contributed, but yes, despite __delete_from_swap_cache
      doing ClearPageDirty before __remove_inode_page to avoid the BUG(),
      a concurrent zap_pte_range might race to set_page_dirty.  So skip
      that oops in PageSwapCache case.  Remove the prior ClearPageDirty?
      maybe but not without deeper thought: let stay for now.
      bff61867
    • Hugh Dickins's avatar
      [PATCH] swap 2/3 unsafe SwapCache check · f53bfec8
      Hugh Dickins authored
      Recent testing has shown that BUG() check in try_to_unuse is unsafe.
      delete_from_swap_cache does final swap_free just after removing page
      from swap cache, and add_to_swap_cache does swap_duplicate just before
      putting page into swap cache, therefore swapin_readahead may resurrect
      a dying swap entry and assign a new page to it.  That's fine, there's
      no need to change this ordering; but it does mean that try_to_unuse's
      page may have left the swap cache yet its swap_map count still be set.
      That BUG() has done good service for swapoff sanity, but now abandon it.
      f53bfec8
    • Hugh Dickins's avatar
      [PATCH] swap 1/3 swapon leak · 59e469ce
      Hugh Dickins authored
      Burton Windle <bwindle@fint.org> reported Kernel memory leak with
      swapon/swapoff? LKML 31 May.  swapon uses rw_swap_page_nolock to read
      swap_header page (peculiar! should probably rework that sometime),
      nothing freed the buffers from the page, thus page also never freed.
      59e469ce
    • Hugh Dickins's avatar
      [PATCH] tmpfs 5/5 SMP-safe · 0e9699d3
      Hugh Dickins authored
      Remove /* SMP-safe */ comments before shmem_truncate and shmem_mknod:
      don't know who or why put there, but they seem to imply that the rest
      of shmem.c is unsafe.
      0e9699d3
    • Hugh Dickins's avatar
      [PATCH] tmpfs 4/5 swapoff tweaks · 13e79df9
      Hugh Dickins authored
      Several simple speedups to tmpfs swapoff: without patch, swapoff of a
      kernel tree in tmpfs might take take 2 minutes, with patch 4 seconds.
      Inline search go no further than necessary; only search inode when it
      has swapped pages; start next search from same inode; list in order.
      
      (There's a "list_move_tail" in this patch: not available in 2.5.21,
      but I believe you now have it in your ongoing tree.)
      13e79df9
    • Hugh Dickins's avatar
      [PATCH] tmpfs 3/5 mknod times · acd1293e
      Hugh Dickins authored
      shmem_mknod should not update directory times if it cannot get an inode.
      acd1293e
    • Hugh Dickins's avatar
      [PATCH] tmpfs 2/5 long symlinks · 467a0077
      Hugh Dickins authored
      shmem_symlink was letting a long symlink overwrite its vfs_inode, now
      included within struct shmem_inode_info - oops! and failed long symlink
      inodes were freed but still left on the shmem_inodes list, causing oops
      in swapoff at shutdown (if not earlier).
      467a0077
    • Hugh Dickins's avatar
      [PATCH] tmpfs 1/5 rename nlink · 004b361e
      Hugh Dickins authored
      shmem_rename was not maintaining the correct link count on the
      parent directories when a directory was moved from one to another.
      This patch from Christoph Rohland <cr@sap.com>, already in 2.5-dj.
      004b361e
    • Martin Dalecki's avatar
      [PATCH] 2.5.21 IDE 88 · eccec1ce
      Martin Dalecki authored
       - Bunch of cleanups by Bartlomiej (accounts for over a half of the patch):
      
          cmd64x.c:
      	- kill SPLIT_BYTE() macro
      	- kill wrappers for cmd64x_config_drive_for_dma()
      	- misc cleanups
      
          cy82c693.c:
      	- kill obsolete comments
      	- clean cy82c693_tune_drive() and calc_clk()
      	- misc cleanups
      
          hpt34x.c:
      	- kill obsolete comment
      	- kill SPLIT_BYTE()
      	- kill hpt34x_clear_chipset()
      	- simplify hpt34x_tune_drive()
      
          hpt366.c:
      	- kill hpt_min_rev()
      	- kill redundant hpt368_tune_chipset() and hpt374_tune_chipset()
      	- fix badlists checking in config_chipset_for_dma()
      	- misc cleanups
      
          pdc202xx.c:
      	- clean registers decoding
      	- clean pdc202xx_tune_chipset()
      	- kill pdc202xx_udma_irq_status(), use generic udma_pci_irq_status()
      	- rationalize pdc202xx_reset()
      	- kill UDMA_SPEED_FLAG() and PDC_CLOCK() macros,
      	  do it right by defining constants PDC_UDMA and PDC_CLK
      	- kill init_high_16() inline, no need to hide internals
      	- clean pdc202xx_init_chipset()
      	- split ata66_pdc202xx() and pdc202xx_init_chipset()
      	- clean config_chipset_for_dma()
      	- misc cleanups
      
       - Fix plug in of CF cards. The previously used sub device driver attach method
         lookup was entirely hosed.
      
       - Enforce indentation style on ide-cs.c. Enable debugging there. (Makes the
         patch quite big...)
      eccec1ce
    • Benjamin LaHaise's avatar
      [PATCH] 2.5.20 x86 iobitmap cleanup · ded80dca
      Benjamin LaHaise authored
      This makes the IO bitmap allocations a separately allocated structure,
      shrinking the default task size.
      
      We alloc it in sys_ioperm() and copy_thread() and frees in
      exit_thread().  It also gets rid of the IO_BITMAP_SIZE+1 crap, as only
      the tss actually needs the tail long, and we weren't copying it into the
      bitmap anyways.
      ded80dca
    • Stephen Rothwell's avatar
      [PATCH] utimes permission check · da615ea7
      Stephen Rothwell authored
      The utime and utimes should do exactly the smae permission check
      according to SUSv3.
      	"The effective user ID of the process shall match the owner of the file,
      or has write access to the file or appropriate privileges to use this call
      in this manner."
      
      utimes when passed a NULL second argument would fail on a read only
      file even if the file is owned by the caller.
      da615ea7
    • Linus Torvalds's avatar
      Merge penguin:v2.5/linux · a9a677ac
      Linus Torvalds authored
      into home.transmeta.com:/home/torvalds/v2.5/linux
      a9a677ac
    • Jens Axboe's avatar
      [PATCH] generic tag update · f39fc866
      Jens Axboe authored
      The following comes from James Bottemley, as he updated the SCSI layer
      to use the generic tagging.
      
      Basically just put blk_queue_tag_request() into ll_rw_blk.c and name it
      something more sane, blk_queue_find_tag(). In addition, remove REQ_CMD
      requirement in blk_queue_start_tag() -- this is actually IDE specific
      (we can only tag read/write requests there...), SCSI actually requires
      everything to be tagged once enabled. It's replaced with a safety check
      for an already tagged request.
      f39fc866
    • Jens Axboe's avatar
      [PATCH] final plug stuff · 3f1fe673
      Jens Axboe authored
      This is a merge of the two things that are needed for the plugging as it
      stands in 2.5.21. The first is fixing the locking to be both clearer and
      safe (Andrew repeatedly broke the old version). The second is a few
      changes that allow make_request_fn drivers to utilize plugging. This is
      needed for umem and raid, for instance, that have their private
      plugging.
      3f1fe673
    • Linus Torvalds's avatar
  6. 12 Jun, 2002 14 commits
    • Ingo Molnar's avatar
      · 873cbfcf
      Ingo Molnar authored
      - i've extended the scheduler context-switch mechanism with the following
        per-arch defines:
      
              prepare_arch_schedule(prev_task);
              finish_arch_schedule(prev_task);
              prepare_arch_switch(rq);
              finish_arch_switch(rq);
      
      - plus switch_to() takes 3 parameters again:
      
              switch_to(prev, next, last);
      
      - schedule_tail() has the 'prev' task parameter again, it must be passed
        over in switch_to() and passed in to the fork() startup path.
      
      architectures that need to unlock the runqueue before doing the switch can
      do the following:
      
       #define prepare_arch_schedule(prev)             task_lock(prev)
       #define finish_arch_schedule(prev)              task_unlock(prev)
       #define prepare_arch_switch(rq)                 spin_unlock(&(rq)->lock)
       #define finish_arch_switch(rq)                  __sti()
      
      this way the task-lock makes sure that a task is not scheduled on some
      other CPU before the switch-out finishes, but the runqueue lock is
      dropped. (Local interrupts are kept disabled in this variant, just to
      exclude things like TLB flushes - if that matters.)
      
      architectures that can hold the runqueue lock during context-switch can do
      the following simplification:
      
       #define prepare_arch_schedule(prev)             do { } while(0)
       #define finish_arch_schedule(prev)              do { } while(0)
       #define prepare_arch_switch(rq)                 do { } while(0)
       #define finish_arch_switch(rq)                  spin_unlock_irq(&(rq)->lock)
      
      further optimizations possible in the 'simple' variant:
      
      - an architecture does not have to handle the 'last' parameter in
        switch_to() if the 'prev' parameter is unused in finish_arch_schedule().
        This way the inlined return value of context_switch() too gets optimized
        away at compile-time.
      
      - an architecture does not have to pass the 'prev' pointer to
        schedule_tail(), if the 'prev' parameter is unused in
        finish_arch_schedule().
      
      the x86 architecture makes use of these optimizations.
      
      Via this solution we have a reasonably flexible context-switch setup which
      falls back to the current (faster) code on x86, but on other platforms the
      runqueue lock can be dropped before doing the context-switch as well.
      
              Ingo
      
      NOTE: i have coded and tested the 'complex' variant on x86 as well to make
            sure it works for you on Sparc64 - but since x86's switch_mm() is
            not too subtle it can use the simpler variant. [ The following
            things had to be done to make x86 arch use the complex variant: the
            4 complex macros have to be used in system.h, entry.S has to
            'pushl %ebx' and 'addl $4, %esp' around the call to schedule_tail(),
            and switch_to() had to be reverted to the 3-parameter variant
            present in the 2.4 kernels.
      
      NOTE2: prepare_to_switch() functionality has been moved into the
             prepare_arch_switch() macro.
      
      NOTE3: please use macros for prepare|finish_arch_switch() so that we can
             keep the scheduler data structures internal to sched.c.
      873cbfcf
    • Andrew Morton's avatar
      [PATCH] fix smbfs oops · 4c6924d4
      Andrew Morton authored
      Silly oversight - read_pages needs to pass the file *
      down to ->readpage().
      4c6924d4
    • Andrew Morton's avatar
      [PATCH] writeback memory allocation robustness · 711daf00
      Andrew Morton authored
      - If we're PF_MEMALLOC and BIO allocation failed, fall back to try
        to allocate a smaller BIO (from a different mempool)
      
      - When writepages() gets confused, call a_ops->writepage()
        instead of going directly to block_write_full_page().  It
        gives the fs more flexibility, and XFS may want this.
      711daf00
    • Andrew Morton's avatar
      [PATCH] stram.c compile fix · f8ca858c
      Andrew Morton authored
      It will need swapops.h for swp_entry().
      f8ca858c
    • Andrew Morton's avatar
      [PATCH] ext3 ordering fix · e6946b9a
      Andrew Morton authored
      Fix the order of inodes being marked dirty in a couple of corner cases.
      
      The only impact of this bug is that the on-disk copies of i_version
      might got out of sync for a directory, or that an error inserting an
      inode into a directory might leave its i_nlinks incorrect on disk for a
      short interval.  Neither problem will cause trouble for ext3 during
      normal operation, but the nlink problem might cause e2fsck to emit
      unnecessary warnings if we crash while the incorrect version of the
      inode is in the journal.
      e6946b9a
    • Andrew Morton's avatar
      [PATCH] ext2_put_inode race fix · 63959896
      Andrew Morton authored
      Removes the put_iode optimisation.  It's racy, as
      Chris pointed out.
      63959896
    • Andrew Morton's avatar
      [PATCH] ext3 out-of-inodes fix · bd054167
      Andrew Morton authored
      ext3 will remount the fs readonly if it runs out of inode
      space.  It shouldn't do that - it should just return -ENOSPC.
      bd054167
    • Linus Torvalds's avatar
      revert to correct C99 behaviour · 95bd6a79
      Linus Torvalds authored
      Cset exclude: bcrl@redhat.com|ChangeSet|20020429021546|12619
      95bd6a79
    • Andy Grover's avatar
      [PATCH] ACPI cleanups [2/2] · 82edfcdc
      Andy Grover authored
      This allows compilation without ACPI_DEBUG defined.
      82edfcdc
    • Andy Grover's avatar
      [PATCH] ACPI cleanups [1/2] · b6f11992
      Andy Grover authored
      This adds an export so that processor.o and thermal.o can be compiled as
      modules
      b6f11992
    • Linus Torvalds's avatar
      Merge http://linux-isdn.bkbits.net/linux-2.5.make · 709ae377
      Linus Torvalds authored
      into penguin.transmeta.com:/home/penguin/torvalds/repositories/kernel/linux
      709ae377
    • Kai Germaschewski's avatar
      Merge tp1.ruhr-uni-bochum.de:/home/kai/kernel/v2.5/linux-2.5 · 81b177ea
      Kai Germaschewski authored
      into tp1.ruhr-uni-bochum.de:/home/kai/kernel/v2.5/linux-2.5.make
      81b177ea
    • Kai Germaschewski's avatar
      kbuild: Move various targets into noconfig section · 4ee66bc0
      Kai Germaschewski authored
      A couple of targets were still in the main part of the Makefile,
      even though they did not need .config to exist for execution.
      
      Move them into the noconfig section of the Makefile, allowing them
      to be executed before make *config.
      4ee66bc0
    • Linus Torvalds's avatar
      Merge http://linux-isdn.bkbits.net/linux-2.5.isdn · 4cecf071
      Linus Torvalds authored
      into penguin.transmeta.com:/home/penguin/torvalds/repositories/kernel/linux
      4cecf071