Messages in this thread | | | From | bsegall@google ... | Subject | Re: [tip:timers/core] hrtimer: Allow concurrent hrtimer_start() for self restarting timers | Date | Wed, 13 May 2015 10:25:08 -0700 |
| |
Peter Zijlstra <peterz@infradead.org> writes:
> @@ -4038,7 +4041,7 @@ void init_cfs_bandwidth(struct cfs_bandwidth *cfs_b) > cfs_b->period = ns_to_ktime(default_cfs_period()); > > INIT_LIST_HEAD(&cfs_b->throttled_cfs_rq); > - hrtimer_init(&cfs_b->period_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); > + hrtimer_init(&cfs_b->period_timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS_PINNED); > cfs_b->period_timer.function = sched_cfs_period_timer; > hrtimer_init(&cfs_b->slack_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); > cfs_b->slack_timer.function = sched_cfs_slack_timer; > @@ -4052,7 +4055,13 @@ static void init_cfs_rq_runtime(struct cfs_rq *cfs_rq) > > void start_cfs_bandwidth(struct cfs_bandwidth *cfs_b) > { > - start_bandwidth_timer(&cfs_b->period_timer, cfs_b->period); > + lockdep_assert_held(&cfs_b->lock); > + > + if (!cfs_b->period_active) { > + cfs_b->period_active = 1; > + hrtimer_forward_now(&cfs_b->period_timer, cfs_b->period); > + hrtimer_start_expires(&cfs_b->period_timer, HRTIMER_MODE_ABS_PINNED); > + } > } >
I don't think the cfsb period timer actually needs to be pinned, even though it has generally run as such due to start_bandwidth_timer.
The period_active code looks fine.
| |