1. 04 Aug, 2009 6 commits
    • Jason Wessel's avatar
      kgdb: continue and warn on signal passing from gdb · 98517d8f
      Jason Wessel authored
      On some architectures for the segv trap, gdb wants to pass the signal
      back on continue.  For kgdb this is not the default behavior, because
      it can cause the kernel to crash if you arbitrarily pass back a
      exception outside of kgdb.
      
      Instead of causing instability, pass a message back to gdb about the
      supported kgdb signal passing and execute a standard kgdb continue
      operation.
      Signed-off-by: default avatarJason Wessel <jason.wessel@windriver.com>
      98517d8f
    • Jason Wessel's avatar
      kgdb: allow for cpu switch when single stepping · 96195aaf
      Jason Wessel authored
      The kgdb core should not assume that a single step operation of a
      kernel thread will complete on the same CPU.  The single step flag is
      set at the "thread" level and it is possible in a multi cpu system
      that a kernel thread can get scheduled on another cpu the next time it
      run.
      Signed-off-by: default avatarJason Wessel <jason.wessel@windriver.com>
      96195aaf
    • Jason Wessel's avatar
      kgdb,i386: Fix corner case access to sp with NMI watch dog exception · 1cde8881
      Jason Wessel authored
      It is possible for the user_mode_vm(regs) check to return true for a
      non master kgdb cpu or when the master kgdb cpu handles the NMI watch
      dog exception.
      
      The solution is simply to select the correct stack pointer location
      based on the check to user_mode_vm(regs).
      Signed-off-by: default avatarJason Wessel <jason.wessel@windriver.com>
      1cde8881
    • Jason Wessel's avatar
      softlockup: add sched_clock_tick() to avoid kernel warning on kgdb resume · b460e199
      Jason Wessel authored
      When CONFIG_HAVE_UNSTABLE_SCHED_CLOCK is set sched_clock() gets the
      time from hardware, such as from TSC.  In this configuration kgdb will
      report a softlock warning messages on resuming or detaching from a
      debug session.
      
      Sequence of events in the problem case:
      
      1) "cpu sched clock" and "hardware time" are at 100 sec prior
         to a call to kgdb_handle_exception()
      
      2) Debugger waits in kgdb_handle_exception() for 80 sec and on exit
         the following is called ...  touch_softlockup_watchdog() -->
         __raw_get_cpu_var(touch_timestamp) = 0;
      
      3) "cpu sched clock" = 100s (it was not updated, because the interrupt
         was disabled in kgdb) but the "hardware time" = 180 sec
      
      4) The first timer interrupt after resuming from kgdb_handle_exception
         updates the watchdog from the "cpu sched clock"
      
      update_process_times() { ...  run_local_timers() --> softlockup_tick()
      --> check (touch_timestamp == 0) (it is "YES" here, we have set
      "touch_timestamp = 0" at kgdb) --> __touch_softlockup_watchdog()
      ***(A)--> reset "touch_timestamp" to "get_timestamp()" (Here, the
      "touch_timestamp" will still be set to 100s.)  ...
      
          scheduler_tick() ***(B)--> sched_clock_tick() (update "cpu sched
          clock" to "hardware time" = 180s) ...  }
      
      5) The Second timer interrupt handler appears to have a large jump and
         trips the softlockup warning.
      
      update_process_times() { ...  run_local_timers() --> softlockup_tick()
      --> "cpu sched clock" - "touch_timestamp" = 180s-100s > 60s --> printk
      "soft lockup error messages" ...  }
      
      note: ***(A) reset "touch_timestamp" to "get_timestamp(this_cpu)"
      
      Why "touch_timestamp" is 100 sec, instead of 180 sec?
      
      With the CONFIG_HAVE_UNSTABLE_SCHED_CLOCK" set the call trace of
      get_timestamp() is:
      
      get_timestamp(this_cpu) -->cpu_clock(this_cpu)
      -->sched_clock_cpu(this_cpu) -->__update_sched_clock(sched_clock_data,
      now)
      
      The __update_sched_clock() function uses the GTOD tick value to create
      a window to normalize the "now" values.  So if "now" values is too big
      for sched_clock_data, it will be ignored.
      
      The fix is to invoke sched_clock_tick() to update "cpu sched clock" in
      order to recover from this state.  This is done by introducing the
      function touch_softlockup_watchdog_sync(), which allows kgdb to
      request that the sched clock is updated when the watchdog thread runs
      the first time after a resume from kgdb.
      Signed-off-by: default avatarJason Wessel <jason.wessel@windriver.com>
      Signed-off-by: default avatarDongdong Deng <Dongdong.Deng@windriver.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: peterz@infradead.org
      b460e199
    • Jason Wessel's avatar
      kgdb: Read buffer overflow · 0529da0e
      Jason Wessel authored
      Roel Kluin reported an error found with Parfait.  Where we want to
      ensure that that kgdb_info[-1] never gets accessed.
      
      Also check to ensure any negative tid does not exceed the size of the
      shadow CPU arrary, else report critical debug context because it is an
      internal kgdb failure.
      Reported-by: default avatarRoel Kluin <roel.kluin@gmail.com>
      Signed-off-by: default avatarJason Wessel <jason.wessel@windriver.com>
      0529da0e
    • Roel Kluin's avatar
      x86 kgdb: remove redundant test · 0b7f56b6
      Roel Kluin authored
      The for loop starts with a breakno of 0, and ends when it's 4. so
      this test is always true.
      Signed-off-by: default avatarRoel Kluin <roel.kluin@gmail.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarJason Wessel <jason.wessel@windriver.com>
      0b7f56b6
  2. 03 Aug, 2009 8 commits
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://neil.brown.name/md · a33a052f
      Linus Torvalds authored
      * 'for-linus' of git://neil.brown.name/md:
        md: Use revalidate_disk to effect changes in size of device.
        md: allow raid5_quiesce to work properly when reshape is happening.
        md/raid5: set reshape_position correctly when reshape starts.
        md: Handle growth of v1.x metadata correctly.
        md: avoid array overflow with bad v1.x metadata
        md: when a level change reduces the number of devices, remove the excess.
        md: Push down data integrity code to personalities.
        md/raid6: release spare page at ->stop()
      a33a052f
    • NeilBrown's avatar
      md: Use revalidate_disk to effect changes in size of device. · 449aad3e
      NeilBrown authored
      As revalidate_disk calls check_disk_size_change, it will cause
      any capacity change of a gendisk to be propagated to the blockdev
      inode.  So use that instead of mucking about with locks and
      i_size_write.
      
      Also add a call to revalidate_disk in do_md_run and a few other places
      where the gendisk capacity is changed.
      Signed-off-by: default avatarNeilBrown <neilb@suse.de>
      449aad3e
    • NeilBrown's avatar
      md: allow raid5_quiesce to work properly when reshape is happening. · 64bd660b
      NeilBrown authored
      The ->quiesce method is not supposed to stop resync/recovery/reshape,
      just normal IO.
      But in raid5 we don't have a way to know which stripes are being
      used for normal IO and which for resync etc, so we need to wait for
      all stripes to be idle to be sure that all writes have completed.
      
      However reshape keeps at least some stripe busy for an extended period
      of time, so a call to raid5_quiesce can block for several seconds
      needlessly.
      So arrange for reshape etc to pause briefly while raid5_quiesce is
      trying to quiesce the array so that the active_stripes count can
      drop to zero.
      Signed-off-by: default avatarNeilBrown <neilb@suse.de>
      64bd660b
    • NeilBrown's avatar
      md/raid5: set reshape_position correctly when reshape starts. · e516402c
      NeilBrown authored
      As the internal reshape_progress counter is the main driver
      for reshape, the fact that reshape_position sometimes starts with the
      wrong value has minimal effect.  It is visible in sysfs and that
      is all.
      Signed-off-by: default avatarNeilBrown <neilb@suse.de>
      e516402c
    • NeilBrown's avatar
      md: Handle growth of v1.x metadata correctly. · 70471daf
      NeilBrown authored
      The v1.x metadata does not have a fixed size and can grow
      when devices are added.
      If it grows enough to require an extra sector of storage,
      we need to update the 'sb_size' to match.
      
      Without this, md can write out an incomplete superblock with a
      bad checksum, which will be rejected when trying to re-assemble
      the array.
      
      Cc: stable@kernel.org
      Signed-off-by: default avatarNeilBrown <neilb@suse.de>
      70471daf
    • NeilBrown's avatar
      md: avoid array overflow with bad v1.x metadata · 3673f305
      NeilBrown authored
      We trust the 'desc_nr' field in v1.x metadata enough to use it
      as an index in an array.  This isn't really safe.
      So range-check the value first.
      Signed-off-by: default avatarNeilBrown <neilb@suse.de>
      3673f305
    • NeilBrown's avatar
      md: when a level change reduces the number of devices, remove the excess. · 3a981b03
      NeilBrown authored
      When an array is changed from RAID6 to RAID5, fewer drives are
      needed.  So any device that is made superfluous by the level
      conversion must be marked as not-active.
      For the RAID6->RAID5 conversion, this will be a drive which only
      has 'Q' blocks on it.
      
      Cc: stable@kernel.org
      Signed-off-by: default avatarNeilBrown <neilb@suse.de>
      3a981b03
    • Andre Noll's avatar
      md: Push down data integrity code to personalities. · ac5e7113
      Andre Noll authored
      This patch replaces md_integrity_check() by two new public functions:
      md_integrity_register() and md_integrity_add_rdev() which are both
      personality-independent.
      
      md_integrity_register() is called from the ->run and ->hot_remove
      methods of all personalities that support data integrity.  The
      function iterates over the component devices of the array and
      determines if all active devices are integrity capable and if their
      profiles match. If this is the case, the common profile is registered
      for the mddev via blk_integrity_register().
      
      The second new function, md_integrity_add_rdev() is called from the
      ->hot_add_disk methods, i.e. whenever a new device is being added
      to a raid array. If the new device does not support data integrity,
      or has a profile different from the one already registered, data
      integrity for the mddev is disabled.
      
      For raid0 and linear, only the call to md_integrity_register() from
      the ->run method is necessary.
      Signed-off-by: default avatarAndre Noll <maan@systemlinux.org>
      Signed-off-by: default avatarNeilBrown <neilb@suse.de>
      ac5e7113
  3. 02 Aug, 2009 21 commits
  4. 01 Aug, 2009 3 commits
  5. 31 Jul, 2009 2 commits