From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932234AbcHSN0f (ORCPT ); Fri, 19 Aug 2016 09:26:35 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:33079 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754171AbcHSN0c (ORCPT ); Fri, 19 Aug 2016 09:26:32 -0400 Date: Fri, 19 Aug 2016 15:25:49 +0200 From: Peter Zijlstra To: Wanpeng Li Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Wanpeng Li , Ingo Molnar , Juri Lelli , Luca Abeni , Frederic Weisbecker Subject: Re: [PATCH v3] sched/deadline: Fix the intention to re-evalute tick dependency for offline cpu Message-ID: <20160819132549.GG10121@twins.programming.kicks-ass.net> References: <1470993843-6818-1-git-send-email-wanpeng.li@hotmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1470993843-6818-1-git-send-email-wanpeng.li@hotmail.com> User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 12, 2016 at 05:24:03PM +0800, Wanpeng Li wrote: > diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c > index d091f4a..ce0fb00 100644 > --- a/kernel/sched/deadline.c > +++ b/kernel/sched/deadline.c > @@ -641,6 +641,11 @@ static enum hrtimer_restart dl_task_timer(struct hrtimer *timer) > goto unlock; > } > > +#ifdef CONFIG_SMP > + if (unlikely(!rq->online)) > + goto offline; > +#endif > + > enqueue_task_dl(rq, p, ENQUEUE_REPLENISH); > if (dl_task(rq->curr)) > check_preempt_curr_dl(rq, p, 0); > @@ -648,6 +653,7 @@ static enum hrtimer_restart dl_task_timer(struct hrtimer *timer) > resched_curr(rq); > > #ifdef CONFIG_SMP > +offline: > /* > * Perform balancing operations here; after the replenishments. We > * cannot drop rq->lock before this, otherwise the assertion in > @@ -659,6 +665,7 @@ static enum hrtimer_restart dl_task_timer(struct hrtimer *timer) > * XXX figure out if select_task_rq_dl() deals with offline cpus. > */ > if (unlikely(!rq->online)) { > + replenish_dl_entity(dl_se, dl_se); > lockdep_unpin_lock(&rq->lock, rf.cookie); > rq = dl_task_offline_migration(rq, p); So I don't like this, even if it magically works. With this we end up calling dl_task_offline_migration() -> deactivate_task() while the task isn't on the runqueue at all. > rf.cookie = lockdep_pin_lock(&rq->lock); > -- > 1.9.1 >