Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp11903981ybi; Fri, 26 Jul 2019 01:32:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqyOKAH2cua+d2O/9e/OYuhWb9AuoeX/DZ9THFp9/fAGNxb8a18G+F8f6EWz44m7y45xtEhW X-Received: by 2002:a17:90a:cb01:: with SMTP id z1mr96017008pjt.93.1564129940792; Fri, 26 Jul 2019 01:32:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564129940; cv=none; d=google.com; s=arc-20160816; b=0Ql01KNh6k4SZft5bzkfj5nmdDF7RbH8ANphVx7AoDKA5frf4ZT786NYl41Qo/36eq wZKqh8ryMB36OhXK2Inn2FbSXJ2eb4FfrpRwDBGLLTy+VFj5LZjEeDIODWhk9ruwMIxm OBzwo0FB1N6uy998KX9tXAmp58csE2kNQxO+TDkurVANVKEpHWcLXbIb/IUwd/t06IC6 9VgX/clbq1Edg9BlsRHTN1z4jlKfng20GS83p4VWexIidtLD7sikAxKLOJQ7DcnyKilV UNnsWYZ3o71INNwlfN2cK2jd7RlvoVJtVeiPwzQ2uE33bs2r/KoPpeY4+r6KFoV2AF8c jigQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=Z10wDPPMSfSWhMQo2O9RGfRNWBTUM5gf4X98fl3gusM=; b=cyzWhhWHFZyIl4QME5XojLmirJAn9W/D1s0KcW+Znyawrgob6hSqWm4E61sy6QVjfz f99xs9Cgwbx/jOU1EKoeFZRSUbs/KavAlHzcIo/UKFpeDp9IeQOhsreXu5NdnemdPidP Fj6dFRGAven0BORQsky907F0y4g2yKmv1f0hK7MKzHM4w6GBBwXy9RJ/alZdooOzHdDW GTtH9on9j2nYCf7cD/f5Rdsu14WRdeBVV/9nbvXuPScvHLZ/cc69BolaXx7uP3zxDpGW crv9wdr4lF61Q1H6u4/Xt8oOqb6FS7cJVRdzlOy+pCb5ZFT0XcnLvRN1x/ArxdNj/BLJ N8BQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b6si17970379pjz.29.2019.07.26.01.32.06; Fri, 26 Jul 2019 01:32:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726555AbfGZI3m (ORCPT + 99 others); Fri, 26 Jul 2019 04:29:42 -0400 Received: from foss.arm.com ([217.140.110.172]:39518 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725815AbfGZI3k (ORCPT ); Fri, 26 Jul 2019 04:29:40 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id CA256344; Fri, 26 Jul 2019 01:29:39 -0700 (PDT) Received: from e107985-lin.arm.com (e107985-lin.cambridge.arm.com [10.1.194.38]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id AB9F93F71A; Fri, 26 Jul 2019 01:29:38 -0700 (PDT) From: Dietmar Eggemann To: Peter Zijlstra , Ingo Molnar , Juri Lelli Cc: Luca Abeni , Daniel Bristot de Oliveira , Valentin Schneider , Qais Yousef , linux-kernel@vger.kernel.org Subject: [PATCH 4/5] sched/deadline: Cleanup on_dl_rq() handling Date: Fri, 26 Jul 2019 09:27:55 +0100 Message-Id: <20190726082756.5525-5-dietmar.eggemann@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190726082756.5525-1-dietmar.eggemann@arm.com> References: <20190726082756.5525-1-dietmar.eggemann@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Remove BUG_ON() in __enqueue_dl_entity() since there is already one in enqueue_dl_entity(). Move the check that the dl_se is not on the dl_rq from __dequeue_dl_entity() to dequeue_dl_entity() to align with the enqueue side and use the on_dl_rq() helper function. Signed-off-by: Dietmar Eggemann --- kernel/sched/deadline.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c index 1fa005f79307..a9cb52ceb761 100644 --- a/kernel/sched/deadline.c +++ b/kernel/sched/deadline.c @@ -1407,8 +1407,6 @@ static void __enqueue_dl_entity(struct sched_dl_entity *dl_se) struct sched_dl_entity *entry; int leftmost = 1; - BUG_ON(!RB_EMPTY_NODE(&dl_se->rb_node)); - while (*link) { parent = *link; entry = rb_entry(parent, struct sched_dl_entity, rb_node); @@ -1430,9 +1428,6 @@ static void __dequeue_dl_entity(struct sched_dl_entity *dl_se) { struct dl_rq *dl_rq = dl_rq_of_se(dl_se); - if (RB_EMPTY_NODE(&dl_se->rb_node)) - return; - rb_erase_cached(&dl_se->rb_node, &dl_rq->root); RB_CLEAR_NODE(&dl_se->rb_node); @@ -1466,6 +1461,9 @@ enqueue_dl_entity(struct sched_dl_entity *dl_se, static void dequeue_dl_entity(struct sched_dl_entity *dl_se) { + if (!on_dl_rq(dl_se)) + return; + __dequeue_dl_entity(dl_se); } -- 2.17.1