1. 07 4月, 2009 10 次提交
    • M
      x86, ds: add task tracing selftest · 3a68eef9
      Markus Metzger 提交于
      Add selftests to cover per-task branch tracing.
      Signed-off-by: NMarkus Metzger <markus.t.metzger@intel.com>
      Cc: roland@redhat.com
      Cc: eranian@googlemail.com
      Cc: oleg@redhat.com
      Cc: juan.villacis@intel.com
      Cc: ak@linux.jf.intel.com
      LKML-Reference: <20090403144600.329346000@intel.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      3a68eef9
    • M
      x86, ds: selftest each cpu · 01f6569e
      Markus Metzger 提交于
      Perform debug store selftests on each cpu.
      
      Cover both the normal and the _noirq variant of the debug store interface.
      Signed-off-by: NMarkus Metzger <markus.t.metzger@intel.com>
      Cc: roland@redhat.com
      Cc: eranian@googlemail.com
      Cc: oleg@redhat.com
      Cc: juan.villacis@intel.com
      Cc: ak@linux.jf.intel.com
      LKML-Reference: <20090403144559.394583000@intel.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      01f6569e
    • M
      x86, ds: fix bounds check in ds selftest · 84f20113
      Markus Metzger 提交于
      Fix a bad bounds check in the debug store selftest.
      Signed-off-by: NMarkus Metzger <markus.t.metzger@intel.com>
      Cc: roland@redhat.com
      Cc: eranian@googlemail.com
      Cc: oleg@redhat.com
      Cc: juan.villacis@intel.com
      Cc: ak@linux.jf.intel.com
      LKML-Reference: <20090403144558.450027000@intel.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      84f20113
    • M
      x86, ds: fix compiler warning · 353afeea
      Markus Metzger 提交于
      Size_t is defined differently on i386 and x86_64.
      Change type to avoid compiler warning.
      Signed-off-by: NMarkus Metzger <markus.t.metzger@intel.com>
      Cc: roland@redhat.com
      Cc: eranian@googlemail.com
      Cc: oleg@redhat.com
      Cc: juan.villacis@intel.com
      Cc: ak@linux.jf.intel.com
      LKML-Reference: <20090403144557.523964000@intel.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      353afeea
    • M
      x86, bts, hw-branch-tracer: add _noirq variants to the debug store interface · de79f54f
      Markus Metzger 提交于
      The hw-branch-tracer uses debug store functions from an on_each_cpu()
      context, which is simply wrong since the functions may sleep.
      
      Add _noirq variants for most functions, which  may be called with
      interrupts disabled.
      
      Separate per-cpu and per-task tracing and allow per-cpu tracing to be
      controlled from any cpu.
      
      Make the hw-branch-tracer use the new debug store interface, synchronize
      with hotplug cpu event using get/put_online_cpus(), and remove the
      unnecessary spinlock.
      
      Make the ptrace bts and the ds selftest code use the new interface.
      
      Defer the ds selftest.
      Signed-off-by: NMarkus Metzger <markus.t.metzger@intel.com>
      Cc: roland@redhat.com
      Cc: eranian@googlemail.com
      Cc: oleg@redhat.com
      Cc: juan.villacis@intel.com
      Cc: ak@linux.jf.intel.com
      LKML-Reference: <20090403144555.658136000@intel.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      de79f54f
    • M
      x86, bts: use trace_clock_global() for timestamps · 15879d04
      Markus Metzger 提交于
      Rename the bts_struct timestamp field to event.
      
      Use trace_clock_global() for time measurement.
      Reported-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NMarkus Metzger <markus.t.metzger@intel.com>
      Cc: roland@redhat.com
      Cc: eranian@googlemail.com
      Cc: oleg@redhat.com
      Cc: juan.villacis@intel.com
      Cc: ak@linux.jf.intel.com
      LKML-Reference: <20090403144553.773216000@intel.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      15879d04
    • M
      x86, bts: fix race between per-task and per-cpu branch tracing · 38f80112
      Markus Metzger 提交于
      Per-task branch tracing installs a debug store context with the traced
      task. This immediately results in the branch trace control bits to be
      cleared for the next context switch of that task, if not set before.
      
      Either per-cpu or per-task tracing are allowed at the same time.
      
      An active per-cpu tracing would be disabled even if the per-task tracing
      request is rejected and the task debug store context removed.
      
      Check the tracing type (per-cpu or per-task) before installing a task
      debug store context.
      Signed-off-by: NMarkus Metzger <markus.t.metzger@intel.com>
      Cc: roland@redhat.com
      Cc: eranian@googlemail.com
      Cc: oleg@redhat.com
      Cc: juan.villacis@intel.com
      Cc: ak@linux.jf.intel.com
      LKML-Reference: <20090403144552.856000000@intel.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      38f80112
    • M
      x86, bts: wait until traced task has been scheduled out · 8d99b3ac
      Markus Metzger 提交于
      In order to stop branch tracing for a running task, we need to first
      clear the branch tracing control bits before we may free the tracing
      buffer.
      
      If the traced task is running, the cpu might still trace that task
      after the branch trace control bits have cleared.
      
      Wait until the traced task has been scheduled out before proceeding.
      
      A similar problem affects the task debug store context. We first remove
      the context, then we need to wait until the task has been scheduled
      out before we can free the context memory.
      Reviewed-by: NOleg Nesterov <oleg@redhat.com>
      Signed-off-by: NMarkus Metzger <markus.t.metzger@intel.com>
      Cc: roland@redhat.com
      Cc: eranian@googlemail.com
      Cc: juan.villacis@intel.com
      Cc: ak@linux.jf.intel.com
      LKML-Reference: <20090403144551.919636000@intel.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      8d99b3ac
    • M
      mm, x86, ptrace, bts: defer branch trace stopping · e2b371f0
      Markus Metzger 提交于
      When a ptraced task is unlinked, we need to stop branch tracing for
      that task.
      
      Since the unlink is called with interrupts disabled, and we need
      interrupts enabled to stop branch tracing, we defer the work.
      
      Collect all branch tracing related stuff in a branch tracing context.
      Reviewed-by: NOleg Nesterov <oleg@redhat.com>
      Signed-off-by: NMarkus Metzger <markus.t.metzger@intel.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: roland@redhat.com
      Cc: eranian@googlemail.com
      Cc: juan.villacis@intel.com
      Cc: ak@linux.jf.intel.com
      LKML-Reference: <20090403144550.712401000@intel.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      e2b371f0
    • M
      x86, bts: fix race when bts tracer is removed · cac94f97
      Markus Metzger 提交于
      When the bts tracer is removed while the traced task is running,
      the write to clear the bts tracer pointer races with context switch code.
      
      Read the tracer once during a context switch.
      
      When a new tracer is installed, the bts tracer is set in the ds context
      before the tracer is initialized in order to claim the context for that
      tracer.
      
      This may result in write accesses using an uninitialized trace configuration
      when scheduling timestamps have been requested.
      
      Store active tracing flags separately and only set active flags after
      the tracing configuration has been initialized.
      Reviewed-by: NOleg Nesterov <oleg@redhat.com>
      Signed-off-by: NMarkus Metzger <markus.t.metzger@intel.com>
      Cc: roland@redhat.com
      Cc: eranian@googlemail.com
      Cc: juan.villacis@intel.com
      Cc: ak@linux.jf.intel.com
      LKML-Reference: <20090403144548.881338000@intel.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      cac94f97
  2. 04 4月, 2009 5 次提交
  3. 03 4月, 2009 4 次提交
    • G
      preadv/pwritev: Add preadv and pwritev system calls. · f3554f4b
      Gerd Hoffmann 提交于
      This patch adds preadv and pwritev system calls.  These syscalls are a
      pretty straightforward combination of pread and readv (same for write).
      They are quite useful for doing vectored I/O in threaded applications.
      Using lseek+readv instead opens race windows you'll have to plug with
      locking.
      
      Other systems have such system calls too, for example NetBSD, check
      here: http://www.daemon-systems.org/man/preadv.2.html
      
      The application-visible interface provided by glibc should look like
      this to be compatible to the existing implementations in the *BSD family:
      
        ssize_t preadv(int d, const struct iovec *iov, int iovcnt, off_t offset);
        ssize_t pwritev(int d, const struct iovec *iov, int iovcnt, off_t offset);
      
      This prototype has one problem though: On 32bit archs is the (64bit)
      offset argument unaligned, which the syscall ABI of several archs doesn't
      allow to do.  At least s390 needs a wrapper in glibc to handle this.  As
      we'll need a wrappers in glibc anyway I've decided to push problem to
      glibc entriely and use a syscall prototype which works without
      arch-specific wrappers inside the kernel: The offset argument is
      explicitly splitted into two 32bit values.
      
      The patch sports the actual system call implementation and the windup in
      the x86 system call tables.  Other archs follow as separate patches.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: <linux-api@vger.kernel.org>
      Cc: <linux-arch@vger.kernel.org>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      f3554f4b
    • J
      sgi-gru: add macros for using the UV hub to send interrupts · 66666e50
      Jack Steiner 提交于
      Add macros for using the UV hub to send interrupts.  Change the IPI code
      to use these macros.  These macros will also be used in additional patches
      that will follow.
      Signed-off-by: NJack Steiner <steiner@sgi.com>
      Cc: "Luck, Tony" <tony.luck@intel.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      66666e50
    • O
      signals: remove 'handler' parameter to tracehook functions · 43918f2b
      Oleg Nesterov 提交于
      Container-init must behave like global-init to processes within the
      container and hence it must be immune to unhandled fatal signals from
      within the container (i.e SIG_DFL signals that terminate the process).
      
      But the same container-init must behave like a normal process to processes
      in ancestor namespaces and so if it receives the same fatal signal from a
      process in ancestor namespace, the signal must be processed.
      
      Implementing these semantics requires that send_signal() determine pid
      namespace of the sender but since signals can originate from workqueues/
      interrupt-handlers, determining pid namespace of sender may not always be
      possible or safe.
      
      This patchset implements the design/simplified semantics suggested by
      Oleg Nesterov.  The simplified semantics for container-init are:
      
      	- container-init must never be terminated by a signal from a
      	  descendant process.
      
      	- container-init must never be immune to SIGKILL from an ancestor
      	  namespace (so a process in parent namespace must always be able
      	  to terminate a descendant container).
      
      	- container-init may be immune to unhandled fatal signals (like
      	  SIGUSR1) even if they are from ancestor namespace. SIGKILL/SIGSTOP
      	  are the only reliable signals to a container-init from ancestor
      	  namespace.
      
      This patch:
      
      Based on an earlier patch submitted by Oleg Nesterov and comments from
      Roland McGrath (http://lkml.org/lkml/2008/11/19/258).
      
      The handler parameter is currently unused in the tracehook functions.
      Besides, the tracehook functions are called with siglock held, so the
      functions can check the handler if they later need to.
      
      Removing the parameter simiplifies changes to sig_ignored() in a follow-on
      patch.
      Signed-off-by: NSukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
      Acked-by: NRoland McGrath <roland@redhat.com>
      Signed-off-by: NOleg Nesterov <oleg@tv-sign.ru>
      Cc: "Eric W. Biederman" <ebiederm@xmission.com>
      Cc: Daniel Lezcano <daniel.lezcano@free.fr>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      43918f2b
    • A
      Simplify copy_thread() · 6f2c55b8
      Alexey Dobriyan 提交于
      First argument unused since 2.3.11.
      
      [akpm@linux-foundation.org: coding-style fixes]
      Signed-off-by: NAlexey Dobriyan <adobriyan@gmail.com>
      Cc: <linux-arch@vger.kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      6f2c55b8
  4. 02 4月, 2009 2 次提交
  5. 01 4月, 2009 2 次提交
  6. 31 3月, 2009 2 次提交
    • A
      proc 2/2: remove struct proc_dir_entry::owner · 99b76233
      Alexey Dobriyan 提交于
      Setting ->owner as done currently (pde->owner = THIS_MODULE) is racy
      as correctly noted at bug #12454. Someone can lookup entry with NULL
      ->owner, thus not pinning enything, and release it later resulting
      in module refcount underflow.
      
      We can keep ->owner and supply it at registration time like ->proc_fops
      and ->data.
      
      But this leaves ->owner as easy-manipulative field (just one C assignment)
      and somebody will forget to unpin previous/pin current module when
      switching ->owner. ->proc_fops is declared as "const" which should give
      some thoughts.
      
      ->read_proc/->write_proc were just fixed to not require ->owner for
      protection.
      
      rmmod'ed directories will be empty and return "." and ".." -- no harm.
      And directories with tricky enough readdir and lookup shouldn't be modular.
      We definitely don't want such modular code.
      
      Removing ->owner will also make PDE smaller.
      
      So, let's nuke it.
      
      Kudos to Jeff Layton for reminding about this, let's say, oversight.
      
      http://bugzilla.kernel.org/show_bug.cgi?id=12454Signed-off-by: NAlexey Dobriyan <adobriyan@gmail.com>
      99b76233
    • R
      PM: Rework handling of interrupts during suspend-resume · 2ed8d2b3
      Rafael J. Wysocki 提交于
      Use the functions introduced in by the previous patch,
      suspend_device_irqs(), resume_device_irqs() and check_wakeup_irqs(),
      to rework the handling of interrupts during suspend (hibernation) and
      resume.  Namely, interrupts will only be disabled on the CPU right
      before suspending sysdevs, while device drivers will be prevented
      from receiving interrupts, with the help of the new helper function,
      before their "late" suspend callbacks run (and analogously during
      resume).
      
      In addition, since the device interrups are now disabled before the
      CPU has turned all interrupts off and the CPU will ACK the interrupts
      setting the IRQ_PENDING bit for them, check in sysdev_suspend() if
      any wake-up interrupts are pending and abort suspend if that's the
      case.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: NIngo Molnar <mingo@elte.hu>
      2ed8d2b3
  7. 30 3月, 2009 1 次提交
  8. 28 3月, 2009 2 次提交
  9. 26 3月, 2009 3 次提交
  10. 25 3月, 2009 2 次提交
    • Y
      x86: use default_cpu_mask_to_apicid for 64bit · f56e5034
      Yinghai Lu 提交于
      Impact: cleanup
      
      Use online_mask directly on 64bit too.
      Signed-off-by: NYinghai Lu <yinghai@kernel.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: "Eric W. Biederman" <ebiederm@xmission.com>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      LKML-Reference: <49C94DAE.9070300@kernel.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      f56e5034
    • Y
      x86: fix set_extra_move_desc calling · fa74c907
      Yinghai Lu 提交于
      Impact: fix bug with irq-descriptor moving when logical flat
      
      Rusty observed:
      
      > The effect of setting desc->affinity (ie. from userspace via sysfs) has varied
      > over time.  In 2.6.27, the 32-bit code anded the value with cpu_online_map,
      > and both 32 and 64-bit did that anding whenever a cpu was unplugged.
      >
      > 2.6.29 consolidated this into one routine (and fixed hotplug) but introduced
      > another variation: anding the affinity with cfg->domain.  Is this right, or
      > should we just set it to what the user said?  Or as now, indicate that we're
      > restricting it.
      
      Eric pointed out that desc->affinity should be what the user requested,
      if it is at all possible to honor the user space request.
      
      This bug got introduced by commit 22f65d31 "x86: Update io_apic.c to use
      new cpumask API".
      
      Fix it by moving the masking to before the descriptor moving ...
      Reported-by: NRusty Russell <rusty@rustcorp.com.au>
      Reported-by: NEric W. Biederman <ebiederm@xmission.com>
      LKML-Reference: <49C94134.4000408@kernel.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      fa74c907
  11. 24 3月, 2009 2 次提交
  12. 23 3月, 2009 5 次提交