lkml.org 
[lkml]   [2011]   [Nov]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRe: [patch 1/3] sched: use jump labels to reduce overhead when bandwidth control is inactive
    Date
    On 11/08/2011 01:29 AM, Peter Zijlstra wrote:
    > On Mon, 2011-11-07 at 20:26 -0800, Paul Turner wrote:
    >> @@ -1788,6 +1791,9 @@ static void do_sched_cfs_slack_timer(str
    >> */
    >> static void check_enqueue_throttle(struct cfs_rq *cfs_rq)
    >> {
    >> + if (!cfs_bandwidth_used())
    >> + return;
    >> +
    >> /* an active group must be handled by the update_curr()->put() path */
    >> if (!cfs_rq->runtime_enabled || cfs_rq->curr)
    >> return;
    >> @@ -1805,6 +1811,9 @@ static void check_enqueue_throttle(struc
    >> /* conditionally throttle active cfs_rq's from put_prev_entity() */
    >> static void check_cfs_rq_runtime(struct cfs_rq *cfs_rq)
    >> {
    >> + if (!cfs_bandwidth_used())
    >> + return;
    >> +
    >> if (likely(!cfs_rq->runtime_enabled || cfs_rq->runtime_remaining> 0))
    >> return;
    >>
    >
    > does it matter if you pull this out into an inline function like:
    >
    > static __always_inline void check_enqueue_throttle(struct cfs_rq *cfs_rq)
    > {
    > if (cfs_bandwidth_used())
    > __check_enqueue_throttle(cfs_rq);
    > }
    >
    > That would avoid the superfluous function call as well.

    This this is the only call-site it's being inlined already so there's no
    difference atm. That said, check_enqueue_throttle is sufficiently small we
    could just add __always_inline to force this to be the default behavior and
    avoid any surprises from this in the future.

    Let me know if you'd like me to re-post with this added.

    - Paul



    \
     
     \ /
      Last update: 2011-11-11 05:27    [W:0.028 / U:119.156 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site