05 Dec, 2015

1 commit

  • Although expedited grace periods can be quite useful, and although their
    OS jitter has been greatly reduced, they can still pose problems for
    extreme real-time workloads. This commit therefore adds a rcu_normal
    kernel boot parameter (which can also be manipulated via sysfs)
    to suppress expedited grace periods, that is, to treat requests for
    expedited grace periods as if they were requests for normal grace periods.
    If both rcu_expedited and rcu_normal are specified, rcu_normal wins.
    This means that if you are relying on expedited grace periods to speed up
    boot, you will want to specify rcu_expedited on the kernel command line,
    and then specify rcu_normal via sysfs once boot completes.

    Signed-off-by: Paul E. McKenney

    Paul E. McKenney
     

07 Oct, 2015

2 commits

  • Currently, __srcu_read_lock() cannot be invoked from restricted
    environments because it contains calls to preempt_disable() and
    preempt_enable(), both of which can invoke lockdep, which is a bad
    idea in some restricted execution modes. This commit therefore moves
    the preempt_disable() and preempt_enable() from __srcu_read_lock()
    to srcu_read_lock(). It also inserts the preempt_disable() and
    preempt_enable() around the call to __srcu_read_lock() in do_exit().

    Signed-off-by: Paul E. McKenney
    Reviewed-by: Josh Triplett

    Paul E. McKenney
     
  • As we now have rcu_callback_t typedefs as the type of rcu callbacks, we
    should use it in call_rcu*() and friends as the type of parameters. This
    could save us a few lines of code and make it clear which function
    requires an rcu callbacks rather than other callbacks as its argument.

    Besides, this can also help cscope to generate a better database for
    code reading.

    Signed-off-by: Boqun Feng
    Signed-off-by: Paul E. McKenney
    Reviewed-by: Josh Triplett

    Boqun Feng
     

23 Jul, 2015

1 commit


16 Jul, 2015

1 commit

  • Type-checking coccinelle spatches are being used to locate type mismatches
    between function signatures and return values in this case this produced:
    ./kernel/rcu/srcu.c:271 WARNING: return of wrong type
    int != unsigned long,

    srcu_readers_active() returns an int that is the sum of per_cpu unsigned
    long but the only user is cleanup_srcu_struct() which is using it as a
    boolean (condition) to see if there is any readers rather than actually
    using the approximate number of readers. The theoretically possible
    unsigned long overflow case does not need to be handled explicitly - if
    we had 4G++ readers then something else went wrong a long time ago.

    proposal: change the return type to boolean. The function name is left
    unchanged as it fits the naming expectation for a boolean.

    patch was compile tested for x86_64_defconfig (implies CONFIG_SRCU=y)

    patch is against 4.1-rc5 (localversion-next is -next-20150525)

    Signed-off-by: Nicholas Mc Guire
    Signed-off-by: Paul E. McKenney

    Nicholas Mc Guire
     

28 May, 2015

1 commit


20 Mar, 2015

1 commit


27 Feb, 2015

1 commit


26 Feb, 2015

1 commit


07 Jan, 2015

1 commit

  • When rcutorture used only the low-order 32 bits of the grace-period
    number, it was not a problem for SRCU to use a 32-bit completed field.
    However, rcutorture now uses the full 64 bits on 64-bit systems, so
    this commit converts SRCU's ->completed field to unsigned long so as to
    provide 64 bits on 64-bit systems.

    Signed-off-by: Paul E. McKenney

    Paul E. McKenney
     

10 Jul, 2014

1 commit

  • RCU contains code of the following forms:

    ACCESS_ONCE(x)++;
    ACCESS_ONCE(x) += y;
    ACCESS_ONCE(x) -= y;

    Now these constructs do operate correctly, but they really result in a
    pair of volatile accesses, one to do the load and another to do the store.
    This can be confusing, as the casual reader might well assume that (for
    example) gcc might generate a memory-to-memory add instruction for each
    of these three cases. In fact, gcc will do no such thing. Also, there
    is a good chance that the kernel will move to separate load and store
    variants of ACCESS_ONCE(), and constructs like the above could easily
    confuse both people and scripts attempting to make that sort of change.
    Finally, most of RCU's read-modify-write uses of ACCESS_ONCE() really
    only need the store to be volatile, so that the read-modify-write form
    might be misleading.

    This commit therefore changes the above forms in RCU so that each instance
    of ACCESS_ONCE() either does a load or a store, but not both. In a few
    cases, ACCESS_ONCE() was not critical, for example, for maintaining
    statisitics. In these cases, ACCESS_ONCE() has been dispensed with
    entirely.

    Suggested-by: Linus Torvalds
    Signed-off-by: Paul E. McKenney

    Paul E. McKenney
     

26 Feb, 2014

1 commit

  • The kbuild test bot uncovered an implicit dependence on the
    trace header being present before rcu.h in ia64 allmodconfig
    that looks like this:

    In file included from kernel/ksysfs.c:22:0:
    kernel/rcu/rcu.h: In function '__rcu_reclaim':
    kernel/rcu/rcu.h:107:3: error: implicit declaration of function 'trace_rcu_invoke_kfree_callback' [-Werror=implicit-function-declaration]
    kernel/rcu/rcu.h:112:3: error: implicit declaration of function 'trace_rcu_invoke_callback' [-Werror=implicit-function-declaration]
    cc1: some warnings being treated as errors

    Looking at other rcu.h users, we can find that they all
    were sourcing the trace header in advance of rcu.h itself,
    as seen in the context of this diff. There were also some
    inconsistencies as to whether it was or wasn't sourced based
    on the parent tracing Kconfig.

    Rather than "fix" it at each use site, and have inconsistent
    use based on whether "#ifdef CONFIG_RCU_TRACE" was used or not,
    lets just source the trace header just once, in the actual consumer
    of it, which is rcu.h itself. We include it unconditionally, as
    build testing shows us that is a hard requirement for some files.

    Reported-by: kbuild test robot
    Signed-off-by: Paul Gortmaker
    Signed-off-by: Paul E. McKenney

    Paul Gortmaker
     

18 Feb, 2014

2 commits

  • For better use of CPU idle time, allow the scheduler to select the CPU
    on which the SRCU grace period work would be scheduled. This improves
    idle residency time and conserves power.

    This functionality is enabled when CONFIG_WQ_POWER_EFFICIENT is selected.

    Cc: Lai Jiangshan
    Cc: "Paul E. McKenney"
    Cc: Dipankar Sarma
    Signed-off-by: Shaibal Dutta
    [zoran.markovic@linaro.org: Rebased to latest kernel version. Added commit
    message. Fixed code alignment.]
    Signed-off-by: Zoran Markovic
    Signed-off-by: Paul E. McKenney
    Reviewed-by: Josh Triplett

    Shaibal Dutta
     
  • All of the RCU source files have the usual GPL header, which contains a
    long-obsolete postal address for FSF. To avoid the need to track the
    FSF office's movements, this commit substitutes the URL where GPL may
    be found.

    Reported-by: Greg KH
    Reported-by: Steven Rostedt
    Signed-off-by: Paul E. McKenney
    Reviewed-by: Josh Triplett

    Paul E. McKenney
     

10 Dec, 2013

1 commit


04 Dec, 2013

1 commit


16 Oct, 2013

1 commit