sched: async unthrottling for cfs bandwidth
Subsystems (2)
PATCH v3 1/1 sched: async unthrottling for cfs bandwidth
CFS bandwidth currently distributes new runtime and unthrottles cfs_rq's inline in an hrtimer callback. Runtime distribution is a per-cpu operation, and unthrottling is a per-cgroup operation, since a tg walk is required. On machines with a large number of cpus and large cgroup hierarchies, this cpus*cgroups work can be too much to do in a single hrtimer callback: since IRQ are disabled, hard lockups may easily occur. Specifically, we've found this scalability issue on configurations with 256 cpus, O(1000) cgroups in the hierarchy being throttled, and high memory bandwidth usage.
To fix this, we can instead unthrottle cfs_rq's asynchronously via a CSD. Each cpu is responsible for unthrottling itself, thus sharding the total work more fairly across the system, and avoiding hard lockups.
---
v2: Fixed !CONFIG_SMP build errors
v3: Removed the throttled_csd_count atomic
kernel/sched/fair.c | 127 ++++++++++++++++++++++++++++++++++++++++--- kernel/sched/sched.h | 8 +++ 2 files changed, 126 insertions(+), 9 deletions(-)
kernel/sched/fair.c +118 -9
@@ -5449,10 +5449,77 @@ void unthrottle_cfs_rq(struct cfs_rq *cfs_rq)resched_curr (rq); } -static void distribute_cfs_runtime (struct cfs_bandwidth *cfs_b) +#ifdef CONFIG_SMP +static void __cfsb_csd_unthrottle (void *arg) +{ +struct rq *rq = arg; +struct rq_flags rf; +struct cfs_rq *cursor, *tmp; + +rq_lock (rq, &rf); + +/* +* Since we hold rq lock we're safe from concurrent manipulation of +* the CSD list. However, this RCU critical section annotates the +* fact that we pair with sched_free_group_rcu(), so that we cannot +* race with group being freed in the window between removing it +* from the list and advancing to the next entry in the list. +*/ +rcu_read_lock (); + +list_for_each_entry_safe (cursor, tmp, &rq->cfsb_csd_list, + throttled_csd_list) { +list_del_init (&cursor->throttled_csd_list); + +if (cfs_rq_throttled (cursor)) +unthrottle_cfs_rq (cursor); + } + +rcu_read_unlock (); + +rq_unlock (rq, &rf); +} + +static inline void __unthrottle_cfs_rq_async (struct cfs_rq *cfs_rq) +{ +struct rq *rq =rq_of (cfs_rq); + +if (rq ==this_rq ()) { +unthrottle_cfs_rq (cfs_rq); +return ; + } + +/* Already enqueued */ +if (SCHED_WARN_ON (!list_empty (&cfs_rq->throttled_csd_list))) +return ; + +list_add_tail (&cfs_rq->throttled_csd_list, &rq->cfsb_csd_list); + +smp_call_function_single_async (cpu_of (rq), &rq->cfsb_csd); +} +#else +static inline void __unthrottle_cfs_rq_async (struct cfs_rq *cfs_rq) +{ +unthrottle_cfs_rq (cfs_rq); +} +#endif + +static void unthrottle_cfs_rq_async (struct cfs_rq *cfs_rq) +{ +lockdep_assert_rq_held (rq_of (cfs_rq)); + +if (SCHED_WARN_ON (!cfs_rq_throttled (cfs_rq) || + cfs_rq->runtime_remaining <=0 )) +return ; + +__unthrottle_cfs_rq_async (cfs_rq); +} + +static bool distribute_cfs_runtime (struct cfs_bandwidth *cfs_b) {struct cfs_rq *cfs_rq;u64 runtime, remaining =1 ; +bool throttled = false;rcu_read_lock (); list_for_each_entry_rcu(cfs_rq, &cfs_b->throttled_cfs_rq,
@@ -5460,11 +5527,22 @@ static void distribute_cfs_runtime(struct cfs_bandwidth *cfs_b)struct rq *rq =rq_of (cfs_rq);struct rq_flags rf; +if (!remaining) { + throttled = true; +break ; + } +rq_lock_irqsave (rq, &rf);if (!cfs_rq_throttled (cfs_rq)) goto next; -/* By the above check, this should never be true */ +#ifdef CONFIG_SMP +/* Already queued for async unthrottle */ +if (!list_empty (&cfs_rq->throttled_csd_list)) + goto next; +#endif + +/* By the above checks, this should never be true */ SCHED_WARN_ON (cfs_rq->runtime_remaining >0 );raw_spin_lock (&cfs_b->lock);
@@ -5479,15 +5557,14 @@ static void distribute_cfs_runtime(struct cfs_bandwidth *cfs_b)/* we check whether we're throttled above */ if (cfs_rq->runtime_remaining >0 ) -unthrottle_cfs_rq (cfs_rq); +unthrottle_cfs_rq_async (cfs_rq); next:rq_unlock_irqrestore (rq, &rf); - -if (!remaining) -break ; }rcu_read_unlock (); + +return throttled; }/*
@@ -5532,10 +5609,8 @@ static int do_sched_cfs_period_timer(struct cfs_bandwidth *cfs_b, int overrun, uwhile (throttled && cfs_b->runtime >0 ) {raw_spin_unlock_irqrestore (&cfs_b->lock, flags);/* we can't nest cfs_b->lock while distributing bandwidth */ -distribute_cfs_runtime (cfs_b); + throttled =distribute_cfs_runtime (cfs_b);raw_spin_lock_irqsave (&cfs_b->lock, flags); - - throttled = !list_empty (&cfs_b->throttled_cfs_rq); }/*
@@ -5812,6 +5887,9 @@ static void init_cfs_rq_runtime(struct cfs_rq *cfs_rq) { cfs_rq->runtime_enabled =0 ;INIT_LIST_HEAD (&cfs_rq->throttled_list); +#ifdef CONFIG_SMP +INIT_LIST_HEAD (&cfs_rq->throttled_csd_list); +#endif }void start_cfs_bandwidth (struct cfs_bandwidth *cfs_b)
@@ -5828,12 +5906,38 @@ void start_cfs_bandwidth(struct cfs_bandwidth *cfs_b)static void destroy_cfs_bandwidth (struct cfs_bandwidth *cfs_b) { +int __maybe_unused i; +/* init_cfs_bandwidth() was not called */ if (!cfs_b->throttled_cfs_rq.next)return ;hrtimer_cancel (&cfs_b->period_timer);hrtimer_cancel (&cfs_b->slack_timer); + +/* +* It is possible that we still have some cfs_rq's pending on a CSD +* list, though this race is very rare. In order for this to occur, we +* must have raced with the last task leaving the group while there +* exist throttled cfs_rq(s), and the period_timer must have queued the +* CSD item but the remote cpu has not yet processed it. To handle this, +* we can simply flush all pending CSD work inline here. We're +* guaranteed at this point that no additional cfs_rq of this group can +* join a CSD list. +*/ +#ifdef CONFIG_SMP +for_each_possible_cpu (i) { +struct rq *rq =cpu_rq (i); +unsigned long flags; + +if (list_empty (&rq->cfsb_csd_list)) +continue ; + +local_irq_save (flags); +__cfsb_csd_unthrottle (rq); +local_irq_restore (flags); + } +#endif }/*
@@ -12462,6 +12566,11 @@ __init void init_sched_fair_class(void)for_each_possible_cpu (i) {zalloc_cpumask_var_node (&per_cpu (load_balance_mask, i),GFP_KERNEL ,cpu_to_node (i));zalloc_cpumask_var_node (&per_cpu (select_rq_mask, i),GFP_KERNEL ,cpu_to_node (i)); + +#ifdef CONFIG_CFS_BANDWIDTH +INIT_CSD (&cpu_rq (i)->cfsb_csd, __cfsb_csd_unthrottle,cpu_rq (i)); +INIT_LIST_HEAD (&cpu_rq (i)->cfsb_csd_list); +#endif }open_softirq (SCHED_SOFTIRQ , run_rebalance_domains);
kernel/sched/sched.h +8 -0
@@ -645,6 +645,9 @@ struct cfs_rq {int throttled;int throttle_count;struct list_head throttled_list; +#ifdef CONFIG_SMP +struct list_head throttled_csd_list; +#endif #endif /* CONFIG_CFS_BANDWIDTH */ #endif /* CONFIG_FAIR_GROUP_SCHED */ };
@@ -1154,6 +1157,11 @@ struct rq {/* Scratch cpumask to be temporarily used under rq_lock */ cpumask_var_t scratch_mask; + +#if defined(CONFIG_CFS_BANDWIDTH ) && defined(CONFIG_SMP ) +call_single_data_t cfsb_csd; +struct list_head cfsb_csd_list; +#endif };#ifdef CONFIG_FAIR_GROUP_SCHED
Signature · 1 line
2.38.1.431.g37b22c650d-goog
Peter Zijlstra
maintainerQuoted 7 lines · Josh Don
kernel/sched/fair.c +7
-0+#ifdef CONFIG_SMP +static void __cfsb_csd_unthrottle (void *arg) +{ +struct rq *rq = arg; +struct rq_flags rf; +struct cfs_rq *cursor, *tmp; +
kernel/sched/fair.c void unthrottle_cfs_rq(struct cfs_rq *cfs_rq) · line 5468
Quoted 10 lines
kernel/sched/fair.c +10
-0+rq_lock (rq, &rf); + +/* +* Since we hold rq lock we're safe from concurrent manipulation of +* the CSD list. However, this RCU critical section annotates the +* fact that we pair with sched_free_group_rcu(), so that we cannot +* race with group being freed in the window between removing it +* from the list and advancing to the next entry in the list. +*/ +rcu_read_lock ();
preempt_disable() -- through rq->lock -- also holds off rcu. Strictly speaking this here is superfluous. But if you want it as an annotation, that's fine I suppose.
Quoted 12 lines
kernel/sched/fair.c +12
-0+ +list_for_each_entry_safe (cursor, tmp, &rq->cfsb_csd_list, + throttled_csd_list) { +list_del_init (&cursor->throttled_csd_list); + +if (cfs_rq_throttled (cursor)) +unthrottle_cfs_rq (cursor); + } + +rcu_read_unlock (); + +rq_unlock (rq, &rf);
kernel/sched/fair.c void unthrottle_cfs_rq(struct cfs_rq *cfs_rq) · line 5490
Quoted 10 lines
kernel/sched/fair.c +10
-0+} + +static inline void __unthrottle_cfs_rq_async (struct cfs_rq *cfs_rq) +{ +struct rq *rq =rq_of (cfs_rq); + +if (rq ==this_rq ()) { +unthrottle_cfs_rq (cfs_rq); +return ; + }
Ideally we'd first queue all the remotes and then process local, but given how all this is organized that doesn't seem trivial to arrange.
Maybe have this function return false when local and save that cfs_rq in a local var to process again later, dunno, that might turn messy.
kernel/sched/fair.c void unthrottle_cfs_rq(struct cfs_rq *cfs_rq) · line 5498
Quoted 8 lines
kernel/sched/fair.c +8
-0+ +/* Already enqueued */ +if (SCHED_WARN_ON (!list_empty (&cfs_rq->throttled_csd_list))) +return ; + +list_add_tail (&cfs_rq->throttled_csd_list, &rq->cfsb_csd_list); + +smp_call_function_single_async (cpu_of (rq), &rq->cfsb_csd);
Hurmph.. so I was expecting something like:
first = list_empty(&rq->cfsb_csd_list); list_add_tail(&cfs_rq->throttled_csd_list, &rq->cfsb_csd_list); if (first) smp_call_function_single_async(cpu_of(rq), &rq->cfsb_csd);
But I suppose I'm remembering the 'old' version. I don't think it is broken as written. There's a very narrow window where you'll end up sending a second IPI for naught, but meh.
Quoted 1 line
+}
Let me go queue this thing, we can always improve upon matters later.
Quoted 4 lines · Peter Zijlstra
preempt_disable()-- throughrq->lock-- also holds off rcu. Strictly speaking this here is superfluous. But if you want it as an annotation, that's fine I suppose.
Yep, I purely added this as extra annotation for future readers.
Quoted 5 lines
Ideally we'd first queue all the remotes and then process local, but given how all this is organized that doesn't seem trivial to arrange.
Maybe have this function return false when local and save that
cfs_rqin a local var to process again later, dunno, that might turn messy.
Maybe something like this? Apologies for inline diff formatting.
kernel/sched/fair.c +0 -0
@@ -5520,12 +5520,15 @@ static bool distribute_cfs_runtime(struct
cfs_bandwidth *cfs_b)
struct cfs_rq *cfs_rq;
u64 runtime, remaining = 1;
bool throttled = false;
+ int this_cpu = smp_processor_id();
+ struct cfs_rq *local_unthrottle = NULL;
+ struct rq *rq;
+ struct rq_flags rf; rcu_read_lock();
list_for_each_entry_rcu(cfs_rq, &cfs_b->throttled_cfs_rq,
throttled_list) {
- struct rq *rq = rq_of(cfs_rq);
- struct rq_flags rf;
+ rq = rq_of(cfs_rq); if (!remaining) {
throttled = true;
@@ -5556,14 +5559,36 @@ static bool distribute_cfs_runtime(struct
cfs_bandwidth *cfs_b)
cfs_rq->runtime_remaining += runtime;
/* we check whether we're throttled above */- if (cfs_rq->runtime_remaining > 0)
- unthrottle_cfs_rq_async(cfs_rq);
+ if (cfs_rq->runtime_remaining > 0) {
+ if (cpu_of(rq) != this_cpu ||
+ SCHED_WARN_ON(local_unthrottle)) {
+ unthrottle_cfs_rq_async(cfs_rq);
+ } else {
+ local_unthrottle = cfs_rq;
+ }
+ } else {
+ throttled = true;
+ }
next:
rq_unlock_irqrestore(rq, &rf);
}
rcu_read_unlock();+ /*
+ * We prefer to stage the async unthrottles of all the remote cpus
+ * before we do the inline unthrottle locally. Note that
+ * unthrottle_cfs_rq_async() on the local cpu is actually synchronous,
+ * but it includes extra WARNs to make sure the cfs_rq really is
+ * still throttled.
+ */
+ if (local_unthrottle) {
+ rq = cpu_rq(this_cpu);
+ rq_lock_irqsave(rq, &rf);
+ unthrottle_cfs_rq_async(local_unthrottle);
+ rq_unlock_irqrestore(rq, &rf);
+ }
+
return throttled;}
Note that one change we definitely want is the extra setting of throttled = true in the case that cfs_rq->runtime_remaining <= 0, to catch the case where we run out of runtime to distribute on the last entity in the list.
Quoted 11 lines
Review
Quoted 8 lines
(quoted diff) +8
-0+ + /* Already enqueued */ + if (SCHED_WARN_ON(!list_empty(&cfs_rq->throttled_csd_list))) + return; + + list_add_tail(&cfs_rq->throttled_csd_list, &rq->cfsb_csd_list); + + smp_call_function_single_async(cpu_of(rq), &rq->cfsb_csd);Hurmph.. so I was expecting something like:
Quoted 8 lines
first = list_empty(&rq->cfsb_csd_list); list_add_tail(&cfs_rq->throttled_csd_list, &rq->cfsb_csd_list); if (first) smp_call_function_single_async(cpu_of(rq), &rq->cfsb_csd);But I suppose I'm remembering the 'old' version. I don't think it is broken as written. There's a very narrow window where you'll end up sending a second IPI for naught, but meh.
The CSD doesn't get unlocked until right before we call the func(). But you're right that that's a (very) narrow window for an extra IPI. Please feel free to modify the patch with that diff if you like.
Quoted 4 lines
Quoted 2 lines
+}
Let me go queue this thing, we can always improve upon matters later.
Thanks! Please add at least the extra assignment of 'throttled = true' from the diff above, but feel free to squash both the diffs if it makes sense to you.
Quoted 46 lines · Josh Don
Quoted 4 lines · Peter Zijlstra
preempt_disable()-- throughrq->lock-- also holds off rcu. Strictly speaking this here is superfluous. But if you want it as an annotation, that's fine I suppose.Yep, I purely added this as extra annotation for future readers.
Quoted 5 lines
Ideally we'd first queue all the remotes and then process local, but given how all this is organized that doesn't seem trivial to arrange.
Maybe have this function return false when local and save that
cfs_rqin a local var to process again later, dunno, that might turn messy.Maybe something like this? Apologies for inline diff formatting.
kernel/sched/fair.c +5
-2@@ -5520,12 +5520,15 @@ static bool distribute_cfs_runtime(struct cfs_bandwidth *cfs_b)struct cfs_rq *cfs_rq;u64 runtime, remaining =1 ;bool throttled = false; +int this_cpu =smp_processor_id (); +struct cfs_rq *local_unthrottle =NULL ; +struct rq *rq; +struct rq_flags rf;rcu_read_lock ();list_for_each_entry_rcu (cfs_rq, &cfs_b->throttled_cfs_rq, throttled_list) { -struct rq *rq =rq_of (cfs_rq); -struct rq_flags rf; + rq =rq_of (cfs_rq);if (!remaining) {throttled = true;kernel/sched/fair.c +0
-2@@ -5556,14 +5559,36 @@ static bool distribute_cfs_runtime(struct cfs_bandwidth *cfs_b) cfs_rq->runtime_remaining += runtime;/* we check whether we're throttled above */ -if (cfs_rq->runtime_remaining >0 ) -unthrottle_cfs_rq_async (cfs_rq);
kernel/sched/fair.c static bool distribute_cfs_runtime(struct · line 5572
Quoted 10 lines
kernel/sched/fair.c +10
-0+if (cfs_rq->runtime_remaining >0 ) { +if (cpu_of (rq) != this_cpu || +SCHED_WARN_ON (local_unthrottle)) { +unthrottle_cfs_rq_async (cfs_rq); + }else { + local_unthrottle = cfs_rq; + } + }else { + throttled = true; + }
Hello,
I don't get the point why local unthrottle is put after all the remote cpus, since this list is FIFO? (earliest throttled cfs_rq is at the head)
Should we distribute runtime in the FIFO order?
Thanks.
Quoted 60 lines
kernel/sched/fair.c +14
-0next:rq_unlock_irqrestore (rq, &rf); }rcu_read_unlock (); +/* +* We prefer to stage the async unthrottles of all the remote cpus +* before we do the inline unthrottle locally. Note that +* unthrottle_cfs_rq_async() on the local cpu is actually synchronous, +* but it includes extra WARNs to make sure the cfs_rq really is +* still throttled. +*/ +if (local_unthrottle) { + rq =cpu_rq (this_cpu); +rq_lock_irqsave (rq, &rf); +unthrottle_cfs_rq_async (local_unthrottle); +rq_unlock_irqrestore (rq, &rf); + } +return throttled; }Note that one change we definitely want is the extra setting of throttled = true in the case that
cfs_rq->runtime_remaining<= 0, to catch the case where we run out of runtime to distribute on the last entity in the list.Quoted 11 lines
Review
Quoted 8 lines
(quoted diff) +8
-0+ + /* Already enqueued */ + if (SCHED_WARN_ON(!list_empty(&cfs_rq->throttled_csd_list))) + return; + + list_add_tail(&cfs_rq->throttled_csd_list, &rq->cfsb_csd_list); + + smp_call_function_single_async(cpu_of(rq), &rq->cfsb_csd);Hurmph.. so I was expecting something like:
Quoted 8 lines
first = list_empty(&rq->cfsb_csd_list); list_add_tail(&cfs_rq->throttled_csd_list, &rq->cfsb_csd_list); if (first) smp_call_function_single_async(cpu_of(rq), &rq->cfsb_csd);But I suppose I'm remembering the 'old' version. I don't think it is broken as written. There's a very narrow window where you'll end up sending a second IPI for naught, but meh.
The CSD doesn't get unlocked until right before we call the
func(). But you're right that that's a (very) narrow window for an extra IPI. Please feel free to modify the patch with that diff if you like.Quoted 4 lines
Quoted 2 lines
+}
Let me go queue this thing, we can always improve upon matters later.
Thanks! Please add at least the extra assignment of 'throttled = true' from the diff above, but feel free to squash both the diffs if it makes sense to you.
Peter Zijlstra
maintainerQuoted 11 lines · Chengming Zhou
Review
Quoted 10 lines
(quoted diff) +10
-0+ if (cfs_rq->runtime_remaining > 0) { + if (cpu_of(rq) != this_cpu || + SCHED_WARN_ON(local_unthrottle)) { + unthrottle_cfs_rq_async(cfs_rq); + } else { + local_unthrottle = cfs_rq; + } + } else { + throttled = true; + }
Quoted 4 lines
Hello,
I don't get the point why local unthrottle is put after all the remote cpus, since this list is FIFO? (earliest throttled
cfs_rqis at the head)
Let the local completion time for a CPU be W. Then if we queue a remote work after the local synchronous work, the lower bound for total completion is at least 2W.
OTOH, if we first queue all remote work and then process the local synchronous work, the lower bound for total completion is W.
The practical difference is that all relevant CPUs get unthrottled rougly at the same point in time, unlike with the original case, where some CPUs have the opportunity to consume W runtime while another is still throttled.
Quoted 22 lines · Peter Zijlstra
Quoted 11 lines · Chengming Zhou
Review
Quoted 10 lines
(quoted diff) +10
-0+ if (cfs_rq->runtime_remaining > 0) { + if (cpu_of(rq) != this_cpu || + SCHED_WARN_ON(local_unthrottle)) { + unthrottle_cfs_rq_async(cfs_rq); + } else { + local_unthrottle = cfs_rq; + } + } else { + throttled = true; + }Quoted 4 lines
Hello,
I don't get the point why local unthrottle is put after all the remote cpus, since this list is FIFO? (earliest throttled
cfs_rqis at the head)Let the local completion time for a CPU be W. Then if we queue a remote work after the local synchronous work, the lower bound for total completion is at least 2W.
Quoted 7 lines
OTOH, if we first queue all remote work and then process the local synchronous work, the lower bound for total completion is W.
The practical difference is that all relevant CPUs get unthrottled rougly at the same point in time, unlike with the original case, where some CPUs have the opportunity to consume W runtime while another is still throttled.
Yep, this tradeoff feels "best", but there are some edge cases where this could potentially disrupt fairness. For example, if we have non-trivial W, a lot of cpus to iterate through for dispatching remote unthrottle, and quota is small. Doesn't help that the timer is pinned so that this will continually hit the same cpu. But as I alluded to, I think the net benefit here is greater with the local unthrottling ordered last.
Peter Zijlstra
maintainerQuoted 5 lines · Josh Don
Yep, this tradeoff feels "best", but there are some edge cases where this could potentially disrupt fairness. For example, if we have non-trivial W, a lot of cpus to iterate through for dispatching remote unthrottle, and quota is small. Doesn't help that the timer is pinned so that this will continually hit the same cpu.
We could -- if we wanted to -- manually rotate the timer around the relevant CPUs. Doing that sanely would require a bit of hrtimer surgery though I'm afraid.
Peter Zijlstra
maintainerQuoted 10 lines · Peter Zijlstra
Quoted 5 lines · Josh Don
Yep, this tradeoff feels "best", but there are some edge cases where this could potentially disrupt fairness. For example, if we have non-trivial W, a lot of cpus to iterate through for dispatching remote unthrottle, and quota is small. Doesn't help that the timer is pinned so that this will continually hit the same cpu.
We could -- if we wanted to -- manually rotate the timer around the relevant CPUs. Doing that sanely would require a bit of hrtimer surgery though I'm afraid.
Here; something like so should enable us to cycle the bandwidth timer. Just need to figure out a way to find another CPU or something.
---
include/linux/hrtimer.h +4 -2
@@ -63,8 +63,10 @@ enum hrtimer_mode {* Return values for the callback function */ enum hrtimer_restart { -HRTIMER_NORESTART ,/* Timer is not restarted */ -HRTIMER_RESTART ,/* Timer must be restarted */ +HRTIMER_RESTART =-1 ,/* Timer must be restarted */ +HRTIMER_NORESTART =0 ,/* Timer is not restarted */ +HRTIMER_RESTART_MIGRATE =1 , +HRTIMER_RESTART_MIGRATE_MAX =HRTIMER_RESTART_MIGRATE +NR_CPUS , };/*
kernel/time/hrtimer.c +35 -9
74 lines not on this page · raw message
Peter Zijlstra
maintainerQuoted 8 lines · Peter Zijlstra
Quoted 7 lines · Peter Zijlstra
Quoted 5 lines · Josh Don
Yep, this tradeoff feels "best", but there are some edge cases where this could potentially disrupt fairness. For example, if we have non-trivial W, a lot of cpus to iterate through for dispatching remote unthrottle, and quota is small. Doesn't help that the timer is pinned so that this will continually hit the same cpu.
Quoted 6 lines
Quoted 3 lines
We could -- if we wanted to -- manually rotate the timer around the relevant CPUs. Doing that sanely would require a bit of hrtimer surgery though I'm afraid.
Here; something like so should enable us to cycle the bandwidth timer. Just need to figure out a way to find another CPU or something.
Some more preparation...
kernel/sched/fair.c +7 -7
@@ -5617,7 +5617,7 @@ static int do_sched_cfs_period_timer(strif (!throttled) {/* mark as potentially idle for the upcoming period */ cfs_b->idle =1 ; -return 0 ; +return HRTIMER_RESTART ; }/* account preceding periods in which throttling occurred */
@@ -5641,10 +5641,10 @@ static int do_sched_cfs_period_timer(str*/ cfs_b->idle =0 ; -return 0 ; +return HRTIMER_RESTART ; out_deactivate: -return 1 ; +return HRTIMER_NORESTART ; }/* a cfs_rq won't donate quota below this amount */
@@ -5836,9 +5836,9 @@ static enum hrtimer_restart sched_cfs_pe {struct cfs_bandwidth *cfs_b = container_of(timer, struct cfs_bandwidth, period_timer); +int restart =HRTIMER_RESTART ;unsigned long flags;int overrun; -int idle =0 ;int count =0 ;raw_spin_lock_irqsave (&cfs_b->lock, flags);
@@ -5847,7 +5847,7 @@ static enum hrtimer_restart sched_cfs_peif (!overrun)break ; - idle =do_sched_cfs_period_timer (cfs_b, overrun, flags); + restart =do_sched_cfs_period_timer (cfs_b, overrun, flags);if (++count >3 ) {u64 new, old =ktime_to_ns (cfs_b->period);
@@ -5880,11 +5880,11 @@ static enum hrtimer_restart sched_cfs_pe count =0 ; } } -if (idle) +if (restart ==HRTIMER_NORESTART ) cfs_b->period_active =0 ;raw_spin_unlock_irqrestore (&cfs_b->lock, flags); -return idle ?HRTIMER_NORESTART :HRTIMER_RESTART ; +return restart; }void init_cfs_bandwidth (struct cfs_bandwidth *cfs_b)
Peter Zijlstra
maintainerQuoted 9 lines · Peter Zijlstra
Quoted 8 lines · Peter Zijlstra
Quoted 7 lines · Peter Zijlstra
Quoted 5 lines · Josh Don
Yep, this tradeoff feels "best", but there are some edge cases where this could potentially disrupt fairness. For example, if we have non-trivial W, a lot of cpus to iterate through for dispatching remote unthrottle, and quota is small. Doesn't help that the timer is pinned so that this will continually hit the same cpu.
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
We could -- if we wanted to -- manually rotate the timer around the relevant CPUs. Doing that sanely would require a bit of hrtimer surgery though I'm afraid.
Here; something like so should enable us to cycle the bandwidth timer. Just need to figure out a way to find another CPU or something.
Some more preparation...
And then I think something like so.. That migrates the timer to the CPU of the first throttled entry -- possibly not the best heuristic, but its the simplest.
NOTE: none of this has seen a compiler up close.
---
kernel/sched/fair.c +11 -3
@@ -5595,13 +5595,21 @@ static bool distribute_cfs_runtime(struc*/ static int do_sched_cfs_period_timer (struct cfs_bandwidth *cfs_b,int overrun,unsigned long flags) { -int throttled; +struct cfs_rq *first_cfs_rq; +int throttled =0 ; +int cpu;/* no need to continue the timer with no bandwidth constraint */ if (cfs_b->quota ==RUNTIME_INF ) goto out_deactivate; - throttled = !list_empty (&cfs_b->throttled_cfs_rq); + first_cfs_rq =list_first_entry_or_null (&cfs_b->throttled_cfs_rq, + struct cfs_rq, throttled_list); +if (first_cfs_rq) { + throttled =1 ; + cpu =cpu_of (rq_of (first_cfs_rq)); + } + cfs_b->nr_periods += overrun;/* Refill extra burst quota even if cfs_b->idle */
@@ -5641,7 +5649,7 @@ static int do_sched_cfs_period_timer(str*/ cfs_b->idle =0 ; -return HRTIMER_RESTART ; +return HRTIMER_RESTART_MIGRATE + cpu; out_deactivate:return HRTIMER_NORESTART ;
Quoted 18 lines · Peter Zijlstra
Quoted 16 lines · Peter Zijlstra
Quoted 14 lines · Peter Zijlstra
Quoted 10 lines · Peter Zijlstra
Quoted 5 lines · Josh Don
Yep, this tradeoff feels "best", but there are some edge cases where this could potentially disrupt fairness. For example, if we have non-trivial W, a lot of cpus to iterate through for dispatching remote unthrottle, and quota is small. Doesn't help that the timer is pinned so that this will continually hit the same cpu.
We could -- if we wanted to -- manually rotate the timer around the relevant CPUs. Doing that sanely would require a bit of hrtimer surgery though I'm afraid.
Here; something like so should enable us to cycle the bandwidth timer. Just need to figure out a way to find another CPU or something.
Quoted 7 lines
Quoted 1 line
Some more preparation...
And then I think something like so.. That migrates the timer to the CPU of the first throttled entry -- possibly not the best heuristic, but its the simplest.
NOTE: none of this has seen a compiler up close.
Thanks Peter, this overall looks good to me. One question though: I was expecting to see that when we migrate the timer, we adjust expiry to account for clock shift between cpus. Was this just not part of the initial draft here, or is this somehow already accounted for?
kernel/time/hrtimer.c static void __run_hrtimer(struct hrtimer_cpu_base *cpu_base, · line 1705
Quoted 10 lines
kernel/time/hrtimer.c +5
-1@@ -1686,7 +1698,17 @@ static void __run_hrtimer(struct hrtimer_cpu_base *cpu_base,lockdep_hrtimer_exit (expires_in_hardirq);trace_hrtimer_expire_exit (timer); -raw_spin_lock_irq (&cpu_base->lock); + +local_irq_disable (); + +if (restart >=HRTIMER_RESTART_MIGRATE ) { +int cpu = restart -HRTIMER_RESTART_MIGRATE ;
I know this is just a rough draft, but just noting that this wants a check against MIGRATE_MAX :)
kernel/time/hrtimer.c static void __run_hrtimer(struct hrtimer_cpu_base *cpu_base, · line 1728
Quoted 4 lines
kernel/time/hrtimer.c +4
-0+if (new_cpu_base != cpu_base) { + timer->base = new_base; +enqueue_hrtimer (timer, new_base,HRTIMER_MODE_ABS ); +raw_spin_unlock (&new_cpu_base->lock);
unlock the old base->lock right?
Peter Zijlstra
maintainerQuoted 4 lines · Josh Don
Quoted 2 lines
Maybe have this function return false when local and save that
cfs_rqin a local var to process again later, dunno, that might turn messy.Maybe something like this? Apologies for inline diff formatting.
That looks entirely reasonable, not nearly as horrible as I feared. Let me go make that happen.
Quoted 4 lines
Note that one change we definitely want is the extra setting of throttled = true in the case that
cfs_rq->runtime_remaining<= 0, to catch the case where we run out of runtime to distribute on the last entity in the list.
Done.
Quoted 16 lines
Quoted 16 lines
Review
Quoted 8 lines
(quoted diff) +8
-0+ + /* Already enqueued */ + if (SCHED_WARN_ON(!list_empty(&cfs_rq->throttled_csd_list))) + return; + + list_add_tail(&cfs_rq->throttled_csd_list, &rq->cfsb_csd_list); + + smp_call_function_single_async(cpu_of(rq), &rq->cfsb_csd);Hurmph.. so I was expecting something like:
first = list_empty(&rq->cfsb_csd_list); list_add_tail(&cfs_rq->throttled_csd_list, &rq->cfsb_csd_list); if (first) smp_call_function_single_async(cpu_of(rq), &rq->cfsb_csd);
Quoted 7 lines
Quoted 3 lines
But I suppose I'm remembering the 'old' version. I don't think it is broken as written. There's a very narrow window where you'll end up sending a second IPI for naught, but meh.
The CSD doesn't get unlocked until right before we call the
func(). But you're right that that's a (very) narrow window for an extra IPI. Please feel free to modify the patch with that diff if you like.
Since I was manually editing things, I did that too.
Please test the final version as found here:
Michal Koutný
Reviewed-byQuoted 3 lines · Peter Zijlstra
Please test the final version as found here:
I went through the patch and I claim it's
(not tested though. And thanks Josh for the notice about the not-double queueing check.)
Quoted 3 lines
Please test the final version as found here:
Thanks Peter, the patch looks good to me and continues to work correctly. Note that I needed to make two edits to get it to build though on sched/core:
- local_cfq_rq doesn't match variable name used in function (local_unthrottle)
- rq_lock_irqrestore -> rq_unlock_irqrestore
Best,
Josh
Quoted 10 lines · Josh Don
Quoted 3 lines
Please test the final version as found here:
Thanks Peter, the patch looks good to me and continues to work correctly. Note that I needed to make two edits to get it to build though on sched/core:
-
local_cfq_rqdoesn't match variable name used in function (local_unthrottle)
-rq_lock_irqrestore->rq_unlock_irqrestore
I also tested it on a desktop bare metal with 800 cgroups under 2 cgroups that have quota set. Before this patch, the majority of durations for sched_cfs_period_timer() are in the range of 512us-1ms, with outliers in the range of 1ms-4ms; after this patch, the majority are in the range of 128us-512us with no outliers above 512us.
Peter Zijlstra
maintainerQuoted 10 lines · Josh Don
Quoted 3 lines
Please test the final version as found here:
Thanks Peter, the patch looks good to me and continues to work correctly. Note that I needed to make two edits to get it to build though on sched/core:
-
local_cfq_rqdoesn't match variable name used in function (local_unthrottle)
-rq_lock_irqrestore->rq_unlock_irqrestore
Bah; and here I throught the .config I build actually had this crud enabled. Oh well.. fixed that, will push out shortly.
Quoted 58 lines · Josh Don
Quoted 4 lines · Peter Zijlstra
preempt_disable()-- throughrq->lock-- also holds off rcu. Strictly speaking this here is superfluous. But if you want it as an annotation, that's fine I suppose.Yep, I purely added this as extra annotation for future readers.
Quoted 5 lines
Ideally we'd first queue all the remotes and then process local, but given how all this is organized that doesn't seem trivial to arrange.
Maybe have this function return false when local and save that
cfs_rqin a local var to process again later, dunno, that might turn messy.Maybe something like this? Apologies for inline diff formatting.
kernel/sched/fair.c +5
-2@@ -5520,12 +5520,15 @@ static bool distribute_cfs_runtime(struct cfs_bandwidth *cfs_b)struct cfs_rq *cfs_rq;u64 runtime, remaining =1 ;bool throttled = false; +int this_cpu =smp_processor_id (); +struct cfs_rq *local_unthrottle =NULL ; +struct rq *rq; +struct rq_flags rf;rcu_read_lock ();list_for_each_entry_rcu (cfs_rq, &cfs_b->throttled_cfs_rq, throttled_list) { -struct rq *rq =rq_of (cfs_rq); -struct rq_flags rf; + rq =rq_of (cfs_rq);if (!remaining) {throttled = true;kernel/sched/fair.c +10
-2@@ -5556,14 +5559,36 @@ static bool distribute_cfs_runtime(struct cfs_bandwidth *cfs_b) cfs_rq->runtime_remaining += runtime;/* we check whether we're throttled above */ -if (cfs_rq->runtime_remaining >0 ) -unthrottle_cfs_rq_async (cfs_rq); +if (cfs_rq->runtime_remaining >0 ) { +if (cpu_of (rq) != this_cpu || +SCHED_WARN_ON (local_unthrottle)) { +unthrottle_cfs_rq_async (cfs_rq); + }else { + local_unthrottle = cfs_rq; + } + }else { + throttled = true; + } next:
kernel/sched/fair.c static bool distribute_cfs_runtime(struct · line 5584
Quoted 10 lines
kernel/sched/fair.c +6
-0rq_unlock_irqrestore (rq, &rf); }rcu_read_unlock (); +/* +* We prefer to stage the async unthrottles of all the remote cpus +* before we do the inline unthrottle locally. Note that +* unthrottle_cfs_rq_async() on the local cpu is actually synchronous, +* but it includes extra WARNs to make sure the cfs_rq really is +* still throttled.
With this said ->
kernel/sched/fair.c static bool distribute_cfs_runtime(struct · line 5588
Quoted 4 lines
kernel/sched/fair.c +4
-0+*/ +if (local_unthrottle) { + rq =cpu_rq (this_cpu); +rq_lock_irqsave (rq, &rf);
Should we add:
if (cfs_rq_throttled(local_unthrottle))
before calling into unthrottle_cfs_rq_async(local_unthrottle) to avoid a potential WARN?
As for whether the local cfs_rq can be unthrottled now after rq lock is re-acquired, I suppose it can be. e.g. another user sets a new quota to this task group during the window of rq lock gets dropped in the above loop and re-acquired here IIUC.
Quoted 7 lines
kernel/sched/fair.c +4
-0+unthrottle_cfs_rq_async (local_unthrottle); +rq_unlock_irqrestore (rq, &rf); + } +return throttled; }
Quoted 8 lines
Review
Quoted 4 lines
(quoted diff) +4
-0+ */ + if (local_unthrottle) { + rq = cpu_rq(this_cpu); + rq_lock_irqsave(rq, &rf);Should we add:
if (cfs_rq_throttled(local_unthrottle))
Quoted 14 lines
before calling into
unthrottle_cfs_rq_async(local_unthrottle)to avoid a potential WARN?As for whether the local
cfs_rqcan be unthrottled now after rq lock is re-acquired, I suppose it can be. e.g. another user sets a new quota to this task group during the window of rq lock gets dropped in the above loop and re-acquired here IIUC.Quoted 6 lines
(quoted diff) +4
-0+ unthrottle_cfs_rq_async(local_unthrottle); + rq_unlock_irqrestore(rq, &rf); + } + return throttled; }
Yes, we should add that check due to the case you described with a user concurrently configuring bandwidth. And as long as we're doing that, we might as well make this unthrottle_cfs_rq() instead and snip the comment. Peter, would you mind adding that delta?
Peter Zijlstra
maintainerQuoted 23 lines · Josh Don
Quoted 8 lines
Review
Quoted 4 lines
(quoted diff) +4
-0+ */ + if (local_unthrottle) { + rq = cpu_rq(this_cpu); + rq_lock_irqsave(rq, &rf);Should we add:
if (cfs_rq_throttled(local_unthrottle))Quoted 14 lines
before calling into
unthrottle_cfs_rq_async(local_unthrottle)to avoid a potential WARN?As for whether the local
cfs_rqcan be unthrottled now after rq lock is re-acquired, I suppose it can be. e.g. another user sets a new quota to this task group during the window of rq lock gets dropped in the above loop and re-acquired here IIUC.Quoted 6 lines
(quoted diff) +4
-0+ unthrottle_cfs_rq_async(local_unthrottle); + rq_unlock_irqrestore(rq, &rf); + } + return throttled; }
Quoted 4 lines
Yes, we should add that check due to the case you described with a user concurrently configuring bandwidth. And as long as we're doing that, we might as well make this
unthrottle_cfs_rq()instead and snip the comment. Peter, would you mind adding that delta?
Done, should be pushed into the queue.git thing momentarily.
[tip: sched/core] sched: Async unthrottling for cfs bandwidth
In reply to Josh DonThe following commit has been merged into the sched/core branch of tip:
The following commit has been merged into the sched/core branch of tip:
Commit-ID: 8ad075c2eb1f6b4b33436144ea1ef2619f3b6398 Gitweb: https://git.kernel.org/tip/8ad075c2eb1f6b4b33436144ea1ef2619f3b6398 Author: Josh Don <[email protected]> AuthorDate: Wed, 16 Nov 2022 16:54:18 -08:00 Committer: Peter Zijlstra <[email protected]> CommitterDate: Tue, 27 Dec 2022 12:52:09 +01:00
sched: Async unthrottling for cfs bandwidth
CFS bandwidth currently distributes new runtime and unthrottles cfs_rq's inline in an hrtimer callback. Runtime distribution is a per-cpu operation, and unthrottling is a per-cgroup operation, since a tg walk is required. On machines with a large number of cpus and large cgroup hierarchies, this cpus*cgroups work can be too much to do in a single hrtimer callback: since IRQ are disabled, hard lockups may easily occur. Specifically, we've found this scalability issue on configurations with 256 cpus, O(1000) cgroups in the hierarchy being throttled, and high memory bandwidth usage.
To fix this, we can instead unthrottle cfs_rq's asynchronously via a CSD. Each cpu is responsible for unthrottling itself, thus sharding the total work more fairly across the system, and avoiding hard lockups.
--- kernel/sched/fair.c | 155 ++++++++++++++++++++++++++++++++++++++---- kernel/sched/sched.h | 8 ++- 2 files changed, 150 insertions(+), 13 deletions(-)
kernel/sched/fair.c +142 -13
@@ -5461,22 +5461,105 @@ unthrottle_throttle:resched_curr (rq); } -static void distribute_cfs_runtime (struct cfs_bandwidth *cfs_b) +#ifdef CONFIG_SMP +static void __cfsb_csd_unthrottle (void *arg) { -struct cfs_rq *cfs_rq; +struct cfs_rq *cursor, *tmp; +struct rq *rq = arg; +struct rq_flags rf; + +rq_lock (rq, &rf); + +/* +* Since we hold rq lock we're safe from concurrent manipulation of +* the CSD list. However, this RCU critical section annotates the +* fact that we pair with sched_free_group_rcu(), so that we cannot +* race with group being freed in the window between removing it +* from the list and advancing to the next entry in the list. +*/ +rcu_read_lock (); + +list_for_each_entry_safe (cursor, tmp, &rq->cfsb_csd_list, + throttled_csd_list) { +list_del_init (&cursor->throttled_csd_list); + +if (cfs_rq_throttled (cursor)) +unthrottle_cfs_rq (cursor); + } + +rcu_read_unlock (); + +rq_unlock (rq, &rf); +} + +static inline void __unthrottle_cfs_rq_async (struct cfs_rq *cfs_rq) +{ +struct rq *rq =rq_of (cfs_rq); +bool first; + +if (rq ==this_rq ()) { +unthrottle_cfs_rq (cfs_rq); +return ; + } + +/* Already enqueued */ +if (SCHED_WARN_ON (!list_empty (&cfs_rq->throttled_csd_list))) +return ; + + first =list_empty (&rq->cfsb_csd_list); +list_add_tail (&cfs_rq->throttled_csd_list, &rq->cfsb_csd_list); +if (first) +smp_call_function_single_async (cpu_of (rq), &rq->cfsb_csd); +} +#else +static inline void __unthrottle_cfs_rq_async (struct cfs_rq *cfs_rq) +{ +unthrottle_cfs_rq (cfs_rq); +} +#endif + +static void unthrottle_cfs_rq_async (struct cfs_rq *cfs_rq) +{ +lockdep_assert_rq_held (rq_of (cfs_rq)); + +if (SCHED_WARN_ON (!cfs_rq_throttled (cfs_rq) || + cfs_rq->runtime_remaining <=0 )) +return ; + +__unthrottle_cfs_rq_async (cfs_rq); +} + +static bool distribute_cfs_runtime (struct cfs_bandwidth *cfs_b) +{ +struct cfs_rq *local_unthrottle =NULL ; +int this_cpu =smp_processor_id ();u64 runtime, remaining =1 ; +bool throttled = false; +struct cfs_rq *cfs_rq; +struct rq_flags rf; +struct rq *rq;rcu_read_lock ();list_for_each_entry_rcu (cfs_rq, &cfs_b->throttled_cfs_rq, throttled_list) { -struct rq *rq =rq_of (cfs_rq); -struct rq_flags rf; + rq =rq_of (cfs_rq); + +if (!remaining) { + throttled = true; +break ; + }rq_lock_irqsave (rq, &rf);if (!cfs_rq_throttled (cfs_rq)) goto next; -/* By the above check, this should never be true */ +#ifdef CONFIG_SMP +/* Already queued for async unthrottle */ +if (!list_empty (&cfs_rq->throttled_csd_list)) + goto next; +#endif + +/* By the above checks, this should never be true */ SCHED_WARN_ON (cfs_rq->runtime_remaining >0 );raw_spin_lock (&cfs_b->lock);
@@ -5490,16 +5573,30 @@ static void distribute_cfs_runtime(struct cfs_bandwidth *cfs_b) cfs_rq->runtime_remaining += runtime;/* we check whether we're throttled above */ -if (cfs_rq->runtime_remaining >0 ) -unthrottle_cfs_rq (cfs_rq); +if (cfs_rq->runtime_remaining >0 ) { +if (cpu_of (rq) != this_cpu || +SCHED_WARN_ON (local_unthrottle)) +unthrottle_cfs_rq_async (cfs_rq); +else + local_unthrottle = cfs_rq; + }else { + throttled = true; + } next:rq_unlock_irqrestore (rq, &rf); - -if (!remaining) -break ; }rcu_read_unlock (); + +if (local_unthrottle) { + rq =cpu_rq (this_cpu); +rq_lock_irqsave (rq, &rf); +if (cfs_rq_throttled (local_unthrottle)) +unthrottle_cfs_rq (local_unthrottle); +rq_unlock_irqrestore (rq, &rf); + } + +return throttled; }/*
@@ -5544,10 +5641,8 @@ static int do_sched_cfs_period_timer(struct cfs_bandwidth *cfs_b, int overrun, uwhile (throttled && cfs_b->runtime >0 ) {raw_spin_unlock_irqrestore (&cfs_b->lock, flags);/* we can't nest cfs_b->lock while distributing bandwidth */ -distribute_cfs_runtime (cfs_b); + throttled =distribute_cfs_runtime (cfs_b);raw_spin_lock_irqsave (&cfs_b->lock, flags); - - throttled = !list_empty (&cfs_b->throttled_cfs_rq); }/*
@@ -5824,6 +5919,9 @@ static void init_cfs_rq_runtime(struct cfs_rq *cfs_rq) { cfs_rq->runtime_enabled =0 ;INIT_LIST_HEAD (&cfs_rq->throttled_list); +#ifdef CONFIG_SMP +INIT_LIST_HEAD (&cfs_rq->throttled_csd_list); +#endif }void start_cfs_bandwidth (struct cfs_bandwidth *cfs_b)
@@ -5840,12 +5938,38 @@ void start_cfs_bandwidth(struct cfs_bandwidth *cfs_b)static void destroy_cfs_bandwidth (struct cfs_bandwidth *cfs_b) { +int __maybe_unused i; +/* init_cfs_bandwidth() was not called */ if (!cfs_b->throttled_cfs_rq.next)return ;hrtimer_cancel (&cfs_b->period_timer);hrtimer_cancel (&cfs_b->slack_timer); + +/* +* It is possible that we still have some cfs_rq's pending on a CSD +* list, though this race is very rare. In order for this to occur, we +* must have raced with the last task leaving the group while there +* exist throttled cfs_rq(s), and the period_timer must have queued the +* CSD item but the remote cpu has not yet processed it. To handle this, +* we can simply flush all pending CSD work inline here. We're +* guaranteed at this point that no additional cfs_rq of this group can +* join a CSD list. +*/ +#ifdef CONFIG_SMP +for_each_possible_cpu (i) { +struct rq *rq =cpu_rq (i); +unsigned long flags; + +if (list_empty (&rq->cfsb_csd_list)) +continue ; + +local_irq_save (flags); +__cfsb_csd_unthrottle (rq); +local_irq_restore (flags); + } +#endif }/*
@@ -12474,6 +12598,11 @@ __init void init_sched_fair_class(void)for_each_possible_cpu (i) {zalloc_cpumask_var_node (&per_cpu (load_balance_mask, i),GFP_KERNEL ,cpu_to_node (i));zalloc_cpumask_var_node (&per_cpu (select_rq_mask, i),GFP_KERNEL ,cpu_to_node (i)); + +#ifdef CONFIG_CFS_BANDWIDTH +INIT_CSD (&cpu_rq (i)->cfsb_csd, __cfsb_csd_unthrottle,cpu_rq (i)); +INIT_LIST_HEAD (&cpu_rq (i)->cfsb_csd_list); +#endif }open_softirq (SCHED_SOFTIRQ , run_rebalance_domains);
kernel/sched/sched.h +8 -0
@@ -645,6 +645,9 @@ struct cfs_rq {int throttled;int throttle_count;struct list_head throttled_list; +#ifdef CONFIG_SMP +struct list_head throttled_csd_list; +#endif #endif /* CONFIG_CFS_BANDWIDTH */ #endif /* CONFIG_FAIR_GROUP_SCHED */ };
@@ -1154,6 +1157,11 @@ struct rq {/* Scratch cpumask to be temporarily used under rq_lock */ cpumask_var_t scratch_mask; + +#if defined(CONFIG_CFS_BANDWIDTH ) && defined(CONFIG_SMP ) +call_single_data_t cfsb_csd; +struct list_head cfsb_csd_list; +#endif };#ifdef CONFIG_FAIR_GROUP_SCHED