1. 18 Mar, 2009 3 commits
  2. 17 Mar, 2009 11 commits
    • Linus Torvalds's avatar
      Avoid 64-bit "switch()" statements on 32-bit architectures · ee568b25
      Linus Torvalds authored
      Commit ee6f779b ("filp->f_pos not
      correctly updated in proc_task_readdir") changed the proc code to use
      filp->f_pos directly, rather than through a temporary variable.  In the
      process, that caused the operations to be done on the full 64 bits, even
      though the offset is never that big.
      
      That's all fine and dandy per se, but for some unfathomable reason gcc
      generates absolutely horrid code when using 64-bit values in switch()
      statements.  To the point of actually calling out to gcc helper
      functions like __cmpdi2 rather than just doing the trivial comparisons
      directly the way gcc does for normal compares.  At which point we get
      link failures, because we really don't want to support that kind of
      crazy code.
      
      Fix this by just casting the f_pos value to "unsigned long", which
      is plenty big enough for /proc, and avoids the gcc code generation issue.
      Reported-by: default avatarAlexey Dobriyan <adobriyan@gmail.com>
      Cc: Zhang Le <r0bertz@gentoo.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      ee568b25
    • Masami Hiramatsu's avatar
      prevent boosting kprobes on exception address · 30390880
      Masami Hiramatsu authored
      Don't boost at the addresses which are listed on exception tables,
      because major page fault will occur on those addresses.  In that case,
      kprobes can not ensure that when instruction buffer can be freed since
      some processes will sleep on the buffer.
      
      kprobes-ia64 already has same check.
      Signed-off-by: default avatarMasami Hiramatsu <mhiramat@redhat.com>
      Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      30390880
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/agk/linux-2.6-dm · 18439c39
      Linus Torvalds authored
      * git://git.kernel.org/pub/scm/linux/kernel/git/agk/linux-2.6-dm:
        dm crypt: wait for endio to complete before destruction
        dm crypt: fix kcryptd_async_done parameter
        dm io: respect BIO_MAX_PAGES limit
        dm table: rework reference counting fix
        dm ioctl: validate name length when renaming
      18439c39
    • Linus Torvalds's avatar
      Fast TSC calibration: calculate proper frequency error bounds · 9e8912e0
      Linus Torvalds authored
      In order for ntpd to correctly synchronize the clocks, the frequency of
      the system clock must not be off by more than 500 ppm (or, put another
      way, 1:2000), or ntpd will end up giving up on trying to synchronize
      properly, and ends up reseting the clock in jumps instead.
      
      The fast TSC PIT calibration sometimes failed this test - it was
      assuming that the PIT reads always took about one microsecond each (2us
      for the two reads to get a 16-bit timer), and that calibrating TSC to
      the PIT over 15ms should thus be sufficient to get much closer than
      500ppm (max 2us error on both sides giving 4us over 15ms: a 270 ppm
      error value).
      
      However, that assumption does not always hold: apparently some hardware
      is either very much slower at reading the PIT registers, or there was
      other noise causing at least one machine to get 700+ ppm errors.
      
      So instead of using a fixed 15ms timing loop, this changes the fast PIT
      calibration to read the TSC delta over the individual PIT timer reads,
      and use the result to calculate the error bars on the PIT read timing
      properly.  We then successfully calibrate the TSC only if the maximum
      error bars fall below 500ppm.
      
      In the process, we also relax the timing to allow up to 25ms for the
      calibration, although it can happen much faster depending on hardware.
      Reported-and-tested-by: default avatarJesper Krogh <jesper@krogh.cc>
      Cc: john stultz <johnstul@us.ibm.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Acked-by: default avatarIngo Molnar <mingo@elte.hu>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      9e8912e0
    • Linus Torvalds's avatar
      Fix potential fast PIT TSC calibration startup glitch · a6a80e1d
      Linus Torvalds authored
      During bootup, when we reprogram the PIT (programmable interval timer)
      to start counting down from 0xffff in order to use it for the fast TSC
      calibration, we should also make sure to delay a bit afterwards to allow
      the PIT hardware to actually start counting with the new value.
      
      That will happens at the next CLK pulse (1.193182 MHz), so the easiest
      way to do that is to just wait at least one microsecond after
      programming the new PIT counter value.  We do that by just reading the
      counter value back once - which will take about 2us on PC hardware.
      Reported-and-tested-by: default avatarjohn stultz <johnstul@us.ibm.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      a6a80e1d
    • Ingo Molnar's avatar
      Merge branch 'tip/tracing/ftrace' of... · 4176935b
      Ingo Molnar authored
      Merge branch 'tip/tracing/ftrace' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace into tracing/ftrace
      4176935b
    • Tom Zanussi's avatar
      tracing: fix leak in event_format_read() · c269fc8c
      Tom Zanussi authored
      Impact: fix memory leak
      
      If event_format_read() exits early due to nonzero ppos, the
      previous kmalloc doesn't get freed - might as well do the
      check before the kmalloc and avoid the problem.
      Signed-off-by: default avatarTom Zanussi <tzanussi@gmail.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: =?ISO-8859-1?Q?Fr=E9d=E9ric?= Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <1237270859.8033.141.camel@charm-linux>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      c269fc8c
    • Ingo Molnar's avatar
      e4106133
    • Steven Rostedt's avatar
      tracing: stop comm recording on tracing off · 6adaad14
      Steven Rostedt authored
      Impact: fix for losing comms in trace
      
      The command lines of tasks are cached at sched switch to not need
      to record them at every trace point.  Disabling the tracing on stops
      the recording of traces, but does not stop the caching of command lines.
      When the tracing is off the cache may overflow and cause the tracing
      to show incorrect tasks matching the PIDs.
      
      This patch disables prevents updates to the comm cache when the ring buffer
      is off.
      Signed-off-by: default avatarSteven Rostedt <srostedt@redhat.com>
      6adaad14
    • Steven Rostedt's avatar
      tracing: protect reader of cmdline output · 4ca53085
      Steven Rostedt authored
      Impact: fix to one cause of incorrect comm outputs in trace
      
      The spinlock only protected the creation of a comm <=> pid pair.
      But it was possible that a reader could look up a pid, and get the
      wrong comm because it had no locking.
      
      This also required changing trace_find_cmdline to copy the comm cache
      and not just send back a pointer to it.
      Signed-off-by: default avatarSteven Rostedt <srostedt@redhat.com>
      4ca53085
    • Frederic Weisbecker's avatar
      tracing/ftrace: fix the check on nopped sites · 03303549
      Frederic Weisbecker authored
      Impact: fix a dynamic tracing failure
      
      Recently, the function and function graph tracers failed to use dynamic
      tracing after the following commit:
      
      fa9d13cf
      (ftrace: don't try to __ftrace_replace_code on !FTRACE_FL_CONVERTED rec)
      
      The patch is right except a mistake on the check for the FTRACE_FL_CONVERTED
      flag. The code patching is aborted in case of successfully nopped sites.
      What we want is the opposite: ignore the callsites that haven't been nopped.
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      Signed-off-by: default avatarSteven Rostedt <srostedt@redhat.com>
      03303549
  3. 16 Mar, 2009 26 commits