Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933950AbbEMRZP (ORCPT ); Wed, 13 May 2015 13:25:15 -0400 Received: from mail-ig0-f178.google.com ([209.85.213.178]:35858 "EHLO mail-ig0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753208AbbEMRZL (ORCPT ); Wed, 13 May 2015 13:25:11 -0400 From: bsegall@google.com To: Peter Zijlstra Cc: Sasha Levin , linux-kernel@vger.kernel.org, pjt@google.com, tglx@linutronix.de, klamm@yandex-team.ru, mingo@kernel.org, hpa@zytor.com Subject: Re: [tip:timers/core] hrtimer: Allow concurrent hrtimer_start() for self restarting timers References: <20150415113105.GT5029@twins.programming.kicks-ass.net> <55520589.9080401@oracle.com> <20150513134311.GW21418@twins.programming.kicks-ass.net> Date: Wed, 13 May 2015 10:25:08 -0700 In-Reply-To: <20150513134311.GW21418@twins.programming.kicks-ass.net> (Peter Zijlstra's message of "Wed, 13 May 2015 15:43:11 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1464 Lines: 35 Peter Zijlstra 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. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/