18 Apr, 2013

2 commits

  • Remove the unused variable *node introduced by commit 5ed67f05 (posix
    timers: Allocate timer id per process)

    Signed-off-by: Thomas Gleixner
    Cc: Pavel Emelyanov

    Thomas Gleixner
     
  • Currently kernel generates IDs for posix timers in a global manner --
    there's a kernel-wide IDR tree from which IDs are created. This makes
    it impossible to recreate a timer with a desired ID (in particular
    this is done by the CRIU checkpoint-restore project) -- since these
    IDs are global it may happen, that at the time we recreate a timer, the
    ID we want for it is already busy by some other timer.

    In order to address this, replace the IDR tree with a global hash
    table for timers and makes timer IDs unique per signal_struct (to
    which timers are linked anyway). With this, two timers belonging to
    different processes may have equal IDs and we can recreate either of
    them with the ID we want.

    Signed-off-by: Pavel Emelyanov
    Cc: Peter Zijlstra
    Cc: Michael Kerrisk
    Cc: Matthew Helsley
    Link: http://lkml.kernel.org/r/513D9FF5.9010004@parallels.com
    Signed-off-by: Thomas Gleixner

    Pavel Emelyanov
     

23 Mar, 2013

2 commits


28 Feb, 2013

1 commit


22 Feb, 2013

1 commit

  • When idr_find() was fed a negative ID, it used to look up the ID
    ignoring the sign bit before recent ("idr: remove MAX_IDR_MASK and
    move left MAX_IDR_* into idr.c") patch. Now a negative ID triggers
    a WARN_ON_ONCE().

    __lock_timer() feeds timer_id from userland directly to idr_find()
    without sanitizing it which can trigger the above malfunctions. Add a
    range check on @timer_id before invoking idr_find() in __lock_timer().

    While timer_t is defined as int by all archs at the moment, Andrew
    worries that it may be defined as a larger type later on. Make the
    test cover larger integers too so that it at least is guaranteed to
    not return the wrong timer.

    Note that WARN_ON_ONCE() in idr_find() on id < 0 is transitional
    precaution while moving away from ignoring MSB. Once it's gone we can
    remove the guard as long as timer_t isn't larger than int.

    Signed-off-by: Tejun Heo nnn
    Reported-by: Sasha Levin
    Cc: Andrew Morton
    Cc: stable@vger.kernel.org
    Link: http://lkml.kernel.org/r/20130220232412.GL3570@htj.dyndns.org
    Signed-off-by: Thomas Gleixner

    Tejun Heo
     

16 Jan, 2013

1 commit


31 Oct, 2011

1 commit

  • The changed files were only including linux/module.h for the
    EXPORT_SYMBOL infrastructure, and nothing else. Revector them
    onto the isolated export header for faster compile times.

    Nothing to see here but a whole lot of instances of:

    -#include
    +#include

    This commit is only changing the kernel dir; next targets
    will probably be mm, fs, the arch dirs, etc.

    Signed-off-by: Paul Gortmaker

    Paul Gortmaker
     

24 May, 2011

1 commit

  • Ben Nagy reported a scalability problem with KVM/QEMU that hit very hard
    a single spinlock (idr_lock) in posix-timers code, on its 48 core
    machine.

    Even on a 16 cpu machine (2x4x2), a single test can show 98% of cpu time
    used in ticket_spin_lock, from lock_timer

    Ref: http://www.spinics.net/lists/kvm/msg51526.html

    Switching to RCU is quite easy, IDR being already RCU ready. idr_lock
    should be locked only for an insert/delete, not a lookup.

    Benchmark on a 2x4x2 machine, 16 processes calling timer_gettime().

    Before :

    real 1m18.669s
    user 0m1.346s
    sys 1m17.180s

    After :

    real 0m3.296s
    user 0m1.366s
    sys 0m1.926s

    Reported-by: Ben Nagy
    Signed-off-by: Eric Dumazet
    Tested-by: Ben Nagy
    Cc: Oleg Nesterov
    Cc: Avi Kivity
    Cc: John Stultz
    Cc: Richard Cochran
    Cc: Paul E. McKenney
    Cc: Andrew Morton
    Signed-off-by: Thomas Gleixner

    Eric Dumazet
     

23 May, 2011

1 commit


31 Mar, 2011

1 commit


22 Feb, 2011

1 commit


02 Feb, 2011

22 commits


21 Oct, 2010

1 commit

  • lock_timer() conditionally grabs it_lock in case of returning non-NULL
    but unlock_timer() releases it unconditionally. This leads sparse to
    complain about the lock context imbalance. Rename and wrap lock_timer
    using __cond_lock() macro to make sparse happy.

    Signed-off-by: Namhyung Kim
    Signed-off-by: Andrew Morton
    Signed-off-by: Thomas Gleixner

    Namhyung Kim
     

23 Jul, 2010

1 commit


28 May, 2010

1 commit

  • Move CLOCK_DISPATCH(which_clock, timer_create, (new_timer)) after all
    posible EFAULT erros.

    *_timer_create may allocate/get resources.
    (for example posix_cpu_timer_create does get_task_struct)

    [ tglx: fold the remove crappy comment patch into this ]

    Signed-off-by: Andrey Vagin
    Cc: Oleg Nesterov
    Cc: Pavel Emelyanov
    Cc:
    Reviewed-by: Stanislaw Gruszka
    Signed-off-by: Andrew Morton
    Signed-off-by: Thomas Gleixner

    Andrey Vagin
     

05 Feb, 2010

1 commit


22 Aug, 2009

1 commit

  • After talking with some application writers who want very fast, but not
    fine-grained timestamps, I decided to try to implement new clock_ids
    to clock_gettime(): CLOCK_REALTIME_COARSE and CLOCK_MONOTONIC_COARSE
    which returns the time at the last tick. This is very fast as we don't
    have to access any hardware (which can be very painful if you're using
    something like the acpi_pm clocksource), and we can even use the vdso
    clock_gettime() method to avoid the syscall. The only trade off is you
    only get low-res tick grained time resolution.

    This isn't a new idea, I know Ingo has a patch in the -rt tree that made
    the vsyscall gettimeofday() return coarse grained time when the
    vsyscall64 sysctrl was set to 2. However this affects all applications
    on a system.

    With this method, applications can choose the proper speed/granularity
    trade-off for themselves.

    Signed-off-by: John Stultz
    Cc: Andi Kleen
    Cc: nikolag@ca.ibm.com
    Cc: Darren Hart
    Cc: arjan@infradead.org
    Cc: jonathan@jonmasters.org
    LKML-Reference:
    Signed-off-by: Thomas Gleixner

    john stultz
     

04 Aug, 2009

1 commit