03 Apr, 2019

1 commit

  • Recently I added an RCU annotation check to rcu_assign_pointer(). All
    pointers assigned to RCU protected data are to be annotated with __rcu
    inorder to be able to use rcu_assign_pointer() similar to checks in
    other RCU APIs.

    This resulted in a sparse error:

    kernel//sched/cpufreq.c:41:9: sparse: error: incompatible types in comparison expression (different address spaces)

    Fix this by annotating cpufreq_update_util_data pointer with __rcu. This
    will also help sparse catch any future RCU misuage bugs.

    Signed-off-by: Joel Fernandes (Google)
    [ From an RCU perspective. ]
    Signed-off-by: Peter Zijlstra (Intel)
    Reviewed-by: Paul E. McKenney
    Cc: Josh Triplett
    Cc: Lai Jiangshan
    Cc: Linus Torvalds
    Cc: Luc Van Oostenryck
    Cc: Mathieu Desnoyers
    Cc: Mike Galbraith
    Cc: Morten Rasmussen
    Cc: Peter Zijlstra
    Cc: Steven Rostedt
    Cc: Thomas Gleixner
    Cc: keescook@chromium.org
    Cc: kernel-hardening@lists.openwall.com
    Cc: kernel-team@android.com
    Link: https://lkml.kernel.org/r/20190321003426.160260-2-joel@joelfernandes.org
    Signed-off-by: Ingo Molnar

    Joel Fernandes (Google)
     

26 Jan, 2019

1 commit

  • Now that synchronize_rcu() waits for preempt-disable regions of
    code as well as RCU read-side critical sections, synchronize_sched()
    can be replaced by synchronize_rcu(), in fact, synchronize_sched()
    is now completely equivalent to synchronize_rcu(). This commit
    therefore replaces synchronize_sched() with synchronize_rcu() so that
    synchronize_sched() can eventually be removed entirely.

    Signed-off-by: Paul E. McKenney
    Cc: Ingo Molnar
    Cc: Peter Zijlstra

    Paul E. McKenney
     

11 Dec, 2018

1 commit


04 Mar, 2018

1 commit

  • Do the following cleanups and simplifications:

    - sched/sched.h already includes , so no need to
    include it in sched/core.c again.

    - order the headers alphabetically

    - add all headers to kernel/sched/sched.h

    - remove all unnecessary includes from the .c files that
    are already included in kernel/sched/sched.h.

    Finally, make all scheduler .c files use a single common header:

    #include "sched.h"

    ... which now contains a union of the relied upon headers.

    This makes the various .c files easier to read and easier to handle.

    Cc: Linus Torvalds
    Cc: Mike Galbraith
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: linux-kernel@vger.kernel.org
    Signed-off-by: Ingo Molnar

    Ingo Molnar
     

17 Aug, 2016

1 commit

  • It is useful to know the reason why cpufreq_update_util() has just
    been called and that can be passed as flags to cpufreq_update_util()
    and to the ->func() callback in struct update_util_data. However,
    doing that in addition to passing the util and max arguments they
    already take would be clumsy, so avoid it.

    Instead, use the observation that the schedutil governor is part
    of the scheduler proper, so it can access scheduler data directly.
    This allows the util and max arguments of cpufreq_update_util()
    and the ->func() callback in struct update_util_data to be replaced
    with a flags one, but schedutil has to be modified to follow.

    Thus make the schedutil governor obtain the CFS utilization
    information from the scheduler and use the "RT" and "DL" flags
    instead of the special utilization value of ULONG_MAX to track
    updates from the RT and DL sched classes. Make it non-modular
    too to avoid having to export scheduler variables to modules at
    large.

    Next, update all of the other users of cpufreq_update_util()
    and the ->func() callback in struct update_util_data accordingly.

    Suggested-by: Peter Zijlstra
    Signed-off-by: Rafael J. Wysocki
    Acked-by: Peter Zijlstra (Intel)
    Acked-by: Viresh Kumar

    Rafael J. Wysocki
     

02 Apr, 2016

1 commit

  • Replace the single helper for adding and removing cpufreq utilization
    update hooks, cpufreq_set_update_util_data(), with a pair of helpers,
    cpufreq_add_update_util_hook() and cpufreq_remove_update_util_hook(),
    and modify the users of cpufreq_set_update_util_data() accordingly.

    With the new helpers, the code using them doesn't need to worry
    about the internals of struct update_util_data and in particular
    it doesn't need to worry about populating the func field in it
    properly upfront.

    Signed-off-by: Rafael J. Wysocki
    Acked-by: Viresh Kumar
    Acked-by: Peter Zijlstra (Intel)

    Rafael J. Wysocki
     

11 Mar, 2016

1 commit

  • Create cpufreq.c under kernel/sched/ and move the cpufreq code
    related to the scheduler to that file and to sched.h.

    Redefine cpufreq_update_util() as a static inline function to avoid
    function calls at its call sites in the scheduler code (as suggested
    by Peter Zijlstra).

    Also move the definition of struct update_util_data and declaration
    of cpufreq_set_update_util_data() from include/linux/cpufreq.h to
    include/linux/sched.h.

    Signed-off-by: Rafael J. Wysocki
    Acked-by: Peter Zijlstra (Intel)

    Rafael J. Wysocki