21 Jun, 2016

1 commit

  • time_to_tm() takes time_t as an argument.
    time_t is not y2038 safe.
    Add time64_to_tm() that takes time64_t as an argument
    which is y2038 safe.
    The plan is to eventually replace all calls to time_to_tm()
    by time64_to_tm().

    Cc: Prarit Bhargava
    Cc: Richard Cochran
    Cc: Thomas Gleixner
    Cc: Ingo Molnar
    Signed-off-by: Deepa Dinamani
    Signed-off-by: John Stultz

    Deepa Dinamani
     

11 Dec, 2015

1 commit

  • For adjtimex()'s ADJ_SETOFFSET, make sure the tv_usec value is
    sane. We might multiply them later which can cause an overflow
    and undefined behavior.

    This patch introduces new helper functions to simplify the
    checking code and adds comments to clarify

    Orginally this patch was by Sasha Levin, but I've basically
    rewritten it, so he should get credit for finding the issue
    and I should get the blame for any mistakes made since.

    Also, credit to Richard Cochran for the phrasing used in the
    comment for what is considered valid here.

    Cc: Sasha Levin
    Cc: Richard Cochran
    Cc: Thomas Gleixner
    Reported-by: Sasha Levin
    Signed-off-by: John Stultz

    John Stultz
     

22 Jan, 2015

1 commit


08 Jan, 2015

1 commit

  • An unvalidated user input is multiplied by a constant, which can result in
    an undefined behaviour for large values. While this is validated later,
    we should avoid triggering undefined behaviour.

    Cc: Thomas Gleixner
    Cc: Ingo Molnar
    Cc: stable
    Signed-off-by: Sasha Levin
    [jstultz: include trivial milisecond->microsecond correction noticed
    by Andy]
    Signed-off-by: John Stultz

    Sasha Levin
     

22 Nov, 2014

1 commit

  • As part of addressing "y2038 problem" for in-kernel uses, this
    patch adds safe mktime64() using time64_t.

    After this patch, mktime() is deprecated and all its call sites
    will be fixed using mktime64(), after that it can be removed.

    Signed-off-by: pang.xunlei
    Signed-off-by: John Stultz

    pang.xunlei
     

24 Jul, 2014

4 commits

  • Right now we have time related prototypes in 3 different header
    files. Move it to a single timekeeping header file and move the core
    internal stuff into a core private header.

    Signed-off-by: Thomas Gleixner
    Signed-off-by: John Stultz

    Thomas Gleixner
     
  • Define the timespec64 structure and standard helper functions.

    [ tglx: Make it 32bit only. 64bit really can map timespec to timespec64 ]

    Signed-off-by: John Stultz
    Signed-off-by: Thomas Gleixner
    Signed-off-by: John Stultz

    John Stultz
     
  • The non-scalar ktime_t implementation is basically a timespec
    which has to be changed to support dates past 2038 on 32bit
    systems.

    This patch removes the non-scalar ktime_t implementation, forcing
    the scalar s64 nanosecond version on all architectures.

    This may have additional performance overhead on some 32bit
    systems when converting between ktime_t and timespec structures,
    however the majority of 32bit systems (arm and i386) were already
    using scalar ktime_t, so no performance regressions will be seen
    on those platforms.

    On affected platforms, I'm open to finding optimizations, including
    avoiding converting to timespecs where possible.

    [ tglx: We can now cleanup the ktime_t.tv64 mess, but thats a
    different issue and we can throw a coccinelle script at it ]

    Signed-off-by: John Stultz
    Signed-off-by: Thomas Gleixner
    Signed-off-by: John Stultz

    John Stultz
     
  • Rather then having two similar but totally different implementations
    that provide timekeeping state to the hrtimer code, try to unify the
    two implementations to be more simliar.

    Thus this clarifies ktime_get_update_offsets to
    ktime_get_update_offsets_now and changes get_xtime... to
    ktime_get_update_offsets_tick.

    Signed-off-by: John Stultz
    Signed-off-by: Thomas Gleixner
    Signed-off-by: John Stultz

    John Stultz
     

15 May, 2013

1 commit

  • Kay Sievers noted that the ALWAYS_USE_PERSISTENT_CLOCK config,
    which enables some minor compile time optimization to avoid
    uncessary code in mostly the suspend/resume path could cause
    problems for userland.

    In particular, the dependency for RTC_HCTOSYS on
    !ALWAYS_USE_PERSISTENT_CLOCK, which avoids setting the time
    twice and simplifies suspend/resume, has the side effect
    of causing the /sys/class/rtc/rtcN/hctosys flag to always be
    zero, and this flag is commonly used by udev to setup the
    /dev/rtc symlink to /dev/rtcN, which can cause pain for
    older applications.

    While the udev rules could use some work to be less fragile,
    breaking userland should strongly be avoided. Additionally
    the compile time optimizations are fairly minor, and the code
    being optimized is likely to be reworked in the future, so
    lets revert this change.

    Reported-by: Kay Sievers
    Signed-off-by: John Stultz
    Cc: stable #3.9
    Cc: Feng Tang
    Cc: Jason Gunthorpe
    Link: http://lkml.kernel.org/r/1366828376-18124-1-git-send-email-john.stultz@linaro.org
    Signed-off-by: Thomas Gleixner

    John Stultz
     

23 Mar, 2013

2 commits


22 Feb, 2013

1 commit

  • Pull ARM SoC cleanups from Arnd Bergmann:
    "A large number of cleanups, all over the platforms. This is dominated
    largely by the Samsung platforms (s3c, s5p, exynos) and a few of the
    others moving code out of arch/arm into more appropriate subsystems.

    The clocksource and irqchip drivers are now abstracted to the point
    where platforms that are already cleaned up do not need to even
    specify the driver they use, it can all get configured from the device
    tree as we do for normal device drivers. The clocksource changes
    basically touch every single platform in the process.

    We further clean up the use of platform specific header files here,
    with the goal of turning more of the platforms over to being
    "multiplatform" enabled, which implies that they cannot expose their
    headers to architecture independent code any more.

    It is expected that no functional changes are part of the cleanup.
    The overall reduction in total code lines is mostly the result of
    removing broken and obsolete code."

    * tag 'cleanup' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (133 commits)
    ARM: mvebu: correct gated clock documentation
    ARM: kirkwood: add missing include for nsa310
    ARM: exynos: move exynos4210-combiner to drivers/irqchip
    mfd: db8500-prcmu: update resource passing
    drivers/db8500-cpufreq: delete dangling include
    ARM: at91: remove NEOCORE 926 board
    sunxi: Cleanup the reset code and add meaningful registers defines
    ARM: S3C24XX: header mach/regs-mem.h local
    ARM: S3C24XX: header mach/regs-power.h local
    ARM: S3C24XX: header mach/regs-s3c2412-mem.h local
    ARM: S3C24XX: Remove plat-s3c24xx directory in arch/arm/
    ARM: S3C24XX: transform s3c2443 subirqs into new structure
    ARM: S3C24XX: modify s3c2443 irq init to initialize all irqs
    ARM: S3C24XX: move s3c2443 irq code to irq.c
    ARM: S3C24XX: transform s3c2416 irqs into new structure
    ARM: S3C24XX: modify s3c2416 irq init to initialize all irqs
    ARM: S3C24XX: move s3c2416 irq init to common irq code
    ARM: S3C24XX: Modify s3c_irq_wake to use the hwirq property
    ARM: S3C24XX: Move irq syscore-ops to irq-pm
    clocksource: always define CLOCKSOURCE_OF_DECLARE
    ...

    Linus Torvalds
     

09 Feb, 2013

1 commit

  • At init time, if the system time is "warped" forward in warp_clock()
    it will differ from the hardware clock by sys_tz.tz_minuteswest. This time
    difference is not taken into account when ntp updates the hardware clock,
    and this causes the system time to jump forward by this offset every reboot.

    The kernel must take this offset into account when writing the system time
    to the hardware clock in the ntp code. This patch adds
    persistent_clock_is_local which indicates that an offset has been applied
    in warp_clock() and accounts for the "warp" before writing the hardware
    clock.

    x86 does not have this problem as rtc writes are software limited to a
    +/-15 minute window relative to the current rtc time. Other arches, such
    as powerpc, however do a full synchronization of the system time to the
    rtc and will see this problem.

    [v2]: generated against tip/timers/core

    Signed-off-by: Prarit Bhargava
    Cc: John Stultz
    Cc: Thomas Gleixner
    Signed-off-by: John Stultz

    Prarit Bhargava
     

30 Jan, 2013

1 commit


16 Jan, 2013

3 commits

  • Make the persistent clock check a kernel config option, so that some
    platform can explicitely select it, also make CONFIG_RTC_HCTOSYS and
    RTC_SYSTOHC depend on its non-existence, which could prevent the
    persistent clock and RTC code from doing similar thing twice during
    system's init/suspend/resume phases.

    If the CONFIG_HAS_PERSISTENT_CLOCK=n, then no change happens for kernel
    which still does the persistent clock check in timekeeping_init().

    Cc: Thomas Gleixner
    Suggested-by: John Stultz
    Signed-off-by: Feng Tang
    [jstultz: Added dependency for RTC_SYSTOHC as well]
    Signed-off-by: John Stultz

    Feng Tang
     
  • In current kernel, there are several places which need to check
    whether there is a persistent clock for the platform. Current check
    is done by calling the read_persistent_clock() and validating its
    return value.

    So one optimization is to do the check only once in timekeeping_init(),
    and use a flag persistent_clock_exist to record it.

    v2: Add a has_persistent_clock() helper function, as suggested by John.

    Cc: Thomas Gleixner
    Cc: John Stultz
    Signed-off-by: Feng Tang
    Signed-off-by: John Stultz

    Feng Tang
     
  • The pstore RAM backend can get called during resume, and must be defensive
    against a suspended time source. Expose getnstimeofday logic that returns
    an error instead of a WARN. This can be detected and the timestamp can
    be zeroed out.

    Reported-by: Doug Anderson
    Cc: John Stultz
    Cc: Anton Vorontsov
    Signed-off-by: Kees Cook
    Signed-off-by: John Stultz

    Kees Cook
     

25 Dec, 2012

1 commit

  • Currently, whenever CONFIG_ARCH_USES_GETTIMEOFFSET is enabled, each
    arch core provides a single implementation of arch_gettimeoffset(). In
    many cases, different sub-architectures, different machines, or
    different timer providers exist, and so the arch ends up implementing
    arch_gettimeoffset() as a call-through-pointer anyway. Examples are
    ARM, Cris, M68K, and it's arguable that the remaining architectures,
    M32R and Blackfin, should be doing this anyway.

    Modify arch_gettimeoffset so that it itself is a function pointer, which
    the arch initializes. This will allow later changes to move the
    initialization of this function into individual machine support or timer
    drivers. This is particularly useful for code in drivers/clocksource
    which should rely on an arch-independant mechanism to register their
    implementation of arch_gettimeoffset().

    This patch also converts the Cris architecture to set arch_gettimeoffset
    directly to the final implementation in time_init(), because Cris already
    had separate time_init() functions per sub-architecture. M68K and ARM
    are converted to set arch_gettimeoffset to the final implementation in
    later patches, because they already have function pointers in place for
    this purpose.

    Cc: Russell King
    Cc: Mike Frysinger
    Cc: Mikael Starvik
    Cc: Hirokazu Takata
    Cc: Thomas Gleixner
    Acked-by: Geert Uytterhoeven
    Acked-by: Jesper Nilsson
    Acked-by: John Stultz
    Signed-off-by: Stephen Warren

    Stephen Warren
     

13 Oct, 2012

1 commit


02 Sep, 2012

1 commit

  • Andreas Bombe reported that the added ktime_t overflow checking added to
    timespec_valid in commit 4e8b14526ca7 ("time: Improve sanity checking of
    timekeeping inputs") was causing problems with X.org because it caused
    timeouts larger then KTIME_T to be invalid.

    Previously, these large timeouts would be clamped to KTIME_MAX and would
    never expire, which is valid.

    This patch splits the ktime_t overflow checking into a new
    timespec_valid_strict function, and converts the timekeeping codes
    internal checking to use this more strict function.

    Reported-and-tested-by: Andreas Bombe
    Cc: Zhouping Liu
    Cc: Ingo Molnar
    Cc: Prarit Bhargava
    Cc: Thomas Gleixner
    Cc: stable@vger.kernel.org
    Signed-off-by: John Stultz
    Signed-off-by: Linus Torvalds

    John Stultz
     

15 Aug, 2012

1 commit

  • Unexpected behavior could occur if the time is set to a value large
    enough to overflow a 64bit ktime_t (which is something larger then the
    year 2262).

    Also unexpected behavior could occur if large negative offsets are
    injected via adjtimex.

    So this patch improves the sanity check timekeeping inputs by
    improving the timespec_valid() check, and then makes better use of
    timespec_valid() to make sure we don't set the time to an invalid
    negative value or one that overflows ktime_t.

    Note: This does not protect from setting the time close to overflowing
    ktime_t and then letting natural accumulation cause the overflow.

    Reported-by: CAI Qian
    Reported-by: Sasha Levin
    Signed-off-by: John Stultz
    Cc: Peter Zijlstra
    Cc: Prarit Bhargava
    Cc: Zhouping Liu
    Cc: Ingo Molnar
    Cc: stable@vger.kernel.org
    Link: http://lkml.kernel.org/r/1344454580-17031-1-git-send-email-john.stultz@linaro.org
    Signed-off-by: Thomas Gleixner

    John Stultz
     

27 Jul, 2012

1 commit

  • Recently, glibc made a change to suppress sign-conversion warnings in
    FD_SET (glibc commit ceb9e56b3d1). This uncovered an issue with the
    kernel's definition of __NFDBITS if applications #include
    after including . A build failure would
    be seen when passing the -Werror=sign-compare and -D_FORTIFY_SOURCE=2
    flags to gcc.

    It was suggested that the kernel should either match the glibc
    definition of __NFDBITS or remove that entirely. The current in-kernel
    uses of __NFDBITS can be replaced with BITS_PER_LONG, and there are no
    uses of the related __FDELT and __FDMASK defines. Given that, we'll
    continue the cleanup that was started with commit 8b3d1cda4f5f
    ("posix_types: Remove fd_set macros") and drop the remaining unused
    macros.

    Additionally, linux/time.h has similar macros defined that expand to
    nothing so we'll remove those at the same time.

    Reported-by: Jeff Law
    Suggested-by: Linus Torvalds
    CC:
    Signed-off-by: Josh Boyer
    [ .. and fix up whitespace as per akpm ]
    Signed-off-by: Linus Torvalds

    Josh Boyer
     

22 May, 2012

1 commit


30 Mar, 2012

1 commit

  • Pull x32 support for x86-64 from Ingo Molnar:
    "This tree introduces the X32 binary format and execution mode for x86:
    32-bit data space binaries using 64-bit instructions and 64-bit kernel
    syscalls.

    This allows applications whose working set fits into a 32 bits address
    space to make use of 64-bit instructions while using a 32-bit address
    space with shorter pointers, more compressed data structures, etc."

    Fix up trivial context conflicts in arch/x86/{Kconfig,vdso/vma.c}

    * 'x86-x32-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (71 commits)
    x32: Fix alignment fail in struct compat_siginfo
    x32: Fix stupid ia32/x32 inversion in the siginfo format
    x32: Add ptrace for x32
    x32: Switch to a 64-bit clock_t
    x32: Provide separate is_ia32_task() and is_x32_task() predicates
    x86, mtrr: Use explicit sizing and padding for the 64-bit ioctls
    x86/x32: Fix the binutils auto-detect
    x32: Warn and disable rather than error if binutils too old
    x32: Only clear TIF_X32 flag once
    x32: Make sure TS_COMPAT is cleared for x32 tasks
    fs: Remove missed ->fds_bits from cessation use of fd_set structs internally
    fs: Fix close_on_exec pointer in alloc_fdtable
    x32: Drop non-__vdso weak symbols from the x32 VDSO
    x32: Fix coding style violations in the x32 VDSO code
    x32: Add x32 VDSO support
    x32: Allow x32 to be configured
    x32: If configured, add x32 system calls to system call tables
    x32: Handle process creation
    x32: Signal-related system calls
    x86: Add #ifdef CONFIG_COMPAT to
    ...

    Linus Torvalds
     

24 Mar, 2012

1 commit

  • Commit 9863c90f682fba34cdc26c3437e8c00da6c83fa4 (x86, vmware: Remove
    deprecated VMI kernel support) removed the only place which set
    no_sync_cmos_clock. Since that commit, this variable is never set.

    Signed-off-by: Cesar Eduardo Barros
    Signed-off-by: John Stultz

    Cesar Eduardo Barros
     

20 Feb, 2012

1 commit

  • Delete the __FD_*() functions for operating on fd_set structs from
    linux/time.h as they're no longer used within the kernel with the preceding
    patch and are not exported to userspace.

    Whilst linux/time.h *does* export the FD_*() equivalents as wrappers around
    __FD_*(), userspace provides its own definition of __FD_*().

    Note that the definition of FD_ZERO() in linux/time.h may not be used with the
    fd_sets associated with struct fdtable as the fd_set may have been allocated in
    a truncated fashion.

    Signed-off-by: David Howells
    Link: http://lkml.kernel.org/r/20120216175006.23314.18984.stgit@warthog.procyon.org.uk
    Signed-off-by: H. Peter Anvin
    Cc: Al Viro

    David Howells
     

15 Feb, 2012

1 commit

  • includes a set of macros that operate on file
    descriptors. Way long ago those were exported to user space, but
    nowadays they are #ifdef __KERNEL__.

    However, they are nothing but standard (nonatomic) bit operations, and
    we already have optimized versions of bit operations in the kernel.
    We can't include in but we can
    move the definitions to and define them there in terms
    of standard kernel bitops.

    [ v2: folds the following fixes in:

    a) Stray space in __FD_SET(), reported by Andrew Morton
    b) #include needed for memset(), reported by Tony Luck ]

    Signed-off-by: H. Peter Anvin
    Link: http://lkml.kernel.org/r/1328677745-20121-22-git-send-email-hpa@zytor.com
    Cc: Arnd Bergmann
    Cc: Tony Luck
    Cc: Andrew Morton

    H. Peter Anvin
     

27 Apr, 2011

2 commits

  • This patch exposes alarm-timers to userland via the posix clock
    and timers interface, using two new clockids: CLOCK_REALTIME_ALARM
    and CLOCK_BOOTTIME_ALARM. Both clockids behave identically to
    CLOCK_REALTIME and CLOCK_BOOTTIME, respectively, but timers
    set against the _ALARM suffixed clockids will wake the system if
    it is suspended.

    Some background can be found here:
    https://lwn.net/Articles/429925/

    The concept for Alarm-timers was inspired by the Android Alarm
    driver (by Arve Hjønnevåg) found in the Android kernel tree.

    See: http://android.git.kernel.org/?p=kernel/common.git;a=blob;f=drivers/rtc/alarm.c;h=1250edfbdf3302f5e4ea6194847c6ef4bb7beb1c;hb=android-2.6.36

    While the in-kernel interface is pretty similar between
    alarm-timers and Android alarm driver, the user-space interface
    for the Android alarm driver is via ioctls to a new char device.
    As mentioned above, I've instead chosen to export this functionality
    via the posix interface, as it seemed a little simpler and avoids
    creating duplicate interfaces to things like CLOCK_REALTIME and
    CLOCK_MONOTONIC under alternate names (ie:ANDROID_ALARM_RTC and
    ANDROID_ALARM_SYSTEMTIME).

    The semantics of the Android alarm driver are different from what
    this posix interface provides. For instance, threads other then
    the thread waiting on the Android alarm driver are able to modify
    the alarm being waited on. Also this interface does not allow
    the same wakelock semantics that the Android driver provides
    (ie: kernel takes a wakelock on RTC alarm-interupt, and holds it
    through process wakeup, and while the process runs, until the
    process either closes the char device or calls back in to wait
    on a new alarm).

    One potential way to implement similar semantics may be via
    the timerfd infrastructure, but this needs more research.

    There may also need to be some sort of sysfs system level policy
    hooks that allow alarm timers to be disabled to keep them
    from firing at inappropriate times (ie: laptop in a well insulated
    bag, mid-flight).

    CC: Arve Hjønnevåg
    CC: Thomas Gleixner
    CC: Alessandro Zummo
    Acked-by: Arnd Bergmann
    Signed-off-by: John Stultz

    John Stultz
     
  • Some platforms cannot implement read_persistent_clock, as
    their RTC devices are only accessible when interrupts are enabled.
    This keeps them from being used by the timekeeping code on resume
    to measure the time in suspend.

    The RTC layer tries to work around this, by calling do_settimeofday
    on resume after irqs are reenabled to set the time properly. However,
    this only corrects CLOCK_REALTIME, and does not properly adjust
    the sleep time value. This causes btime in /proc/stat to be incorrect
    as well as making the new CLOCK_BOTTTIME inaccurate.

    This patch resolves the issue by introducing a new timekeeping hook
    to allow the RTC layer to inject the sleep time on resume.

    The code also checks to make sure that read_persistent_clock is
    nonfunctional before setting the sleep time, so that should the RTC's
    HCTOSYS option be configured in on a system that does support
    read_persistent_clock we will not increase the total_sleep_time twice.

    CC: Arve Hjønnevåg
    CC: Thomas Gleixner
    Acked-by: Arnd Bergmann
    Signed-off-by: John Stultz

    John Stultz
     

22 Feb, 2011

3 commits

  • CLOCK_MONOTONIC stops while the system is in suspend. This is because
    to applications system suspend is invisible. However, there is a
    growing set of applications that are wanting to be suspend-aware,
    but do not want to deal with the complications of CLOCK_REALTIME
    (which might jump around if settimeofday is called).

    For these applications, I propose a new clockid: CLOCK_BOOTTIME.
    CLOCK_BOOTTIME is idential to CLOCK_MONOTONIC, except it also
    includes any time spent in suspend.

    This patch add hrtimer base for CLOCK_BOOTTIME, using
    get_monotonic_boottime/ktime_get_boottime, to allow
    in kernel users to set timers against.

    CC: Jamie Lokier
    CC: Thomas Gleixner
    CC: Alexander Shishkin
    CC: Arve Hjønnevåg
    Signed-off-by: John Stultz

    John Stultz
     
  • Extend get_xtime_and_monotonic_offset to
    get_xtime_and_monotonic_and_sleep_offset().

    CC: Jamie Lokier
    CC: Thomas Gleixner
    CC: Alexander Shishkin
    CC: Arve Hjønnevåg
    Signed-off-by: John Stultz

    John Stultz
     
  • This adds new functions that return the monotonic time since boot
    (in other words, CLOCK_MONOTONIC + suspend time).

    CC: Jamie Lokier
    CC: Thomas Gleixner
    CC: Alexander Shishkin
    CC: Arve Hjønnevåg
    Signed-off-by: John Stultz

    John Stultz
     

02 Feb, 2011

2 commits

  • This adds a kernel-internal timekeeping interface to add or subtract
    a fixed amount from CLOCK_REALTIME. This makes it so kernel users or
    interfaces trying to do so do not have to read the time, then add an
    offset and then call settimeofday(), which adds some extra error in
    comparision to just simply adding the offset in the kernel timekeeping
    core.

    Signed-off-by: John Stultz
    Signed-off-by: Richard Cochran
    LKML-Reference:
    Signed-off-by: Thomas Gleixner

    John Stultz
     
  • Both settimeofday() and clock_settime() promise with a 'const'
    attribute not to alter the arguments passed in. This patch adds the
    missing 'const' attribute into the various kernel functions
    implementing these calls.

    Signed-off-by: Richard Cochran
    Acked-by: John Stultz
    LKML-Reference:
    Signed-off-by: Thomas Gleixner

    Richard Cochran
     

01 Feb, 2011

1 commit

  • All callers of do_timer() are converted to xtime_update(). The only
    users of xtime_lock are in kernel/time/. Make both local to
    kernel/time/ and remove them from the global header files.

    [ tglx: Reuse tick-internal.h instead of creating another local header
    file. Massaged changelog ]

    Signed-off-by: Torben Hohn
    Cc: Peter Zijlstra
    Cc: johnstul@us.ibm.com
    Cc: yong.zhang0@gmail.com
    Cc: hch@infradead.org
    Signed-off-by: Thomas Gleixner

    Torben Hohn
     

31 Jan, 2011

3 commits


14 Jan, 2011

1 commit

  • MONOTONIC_RAW clock timestamps are ideally suited for frequency
    calculation and also fit well into the original NTP hardpps design. Now
    phase and frequency can be adjusted separately: the former based on
    REALTIME clock and the latter based on MONOTONIC_RAW clock.

    A new function getnstime_raw_and_real is added to timekeeping subsystem to
    capture both timestamps at the same time and atomically.

    Signed-off-by: Alexander Gordeev
    Acked-by: John Stultz
    Cc: Rodolfo Giometti
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexander Gordeev