Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp297165pxa; Fri, 14 Aug 2020 04:42:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyphlLwQMQ2DIhYB0Tc3eJKqCpMB0VsdXOhtanr0O4AkuMv9acGf+gEKhIT0XGta55136aO X-Received: by 2002:a17:906:a182:: with SMTP id s2mr1913142ejy.526.1597405341006; Fri, 14 Aug 2020 04:42:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597405341; cv=none; d=google.com; s=arc-20160816; b=xOzhgktAQ/hsuxE6JqVwUn751eyKxm7omTeBPKd/Scfx1hsPkfA3llqNeD9LmFZDay 4s/3R7eH8Fnqg60dZxDb6RKoWmzwSflRsRZ8PCQLrxOV/EGZ8VTorSkfy0/ZWunsp3ay 0sAv1I5Iqx2u86ufuj4FQ2VtxF68RbdJX2t9cKQa7lmxneswiQio/E2ZGEwwHihK2fEJ gwq3vLKEYYb+CUBRwcSusokcOLTRUGEz1ThE3/dgEfMzjxsU7KPrEQ/Si2aLAKX6735Y N/Yk6bfCDSGTEO8rIw3paSgSr5C/mnjwLXTp7GOsMC0aViSd6kpbp6H9vi+EfLgh6Pul 2KTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=AE33/Ti87KuS4SH/o4H6Zg/kd/KbT3E7Avp7JAiI1ag=; b=0cHtiCEmNDepoLMQG8MYNYFzG53p4QMEUdZ1wCxitZlw+chBvJF7iNyOQVu4rPTY4R ZvEcghSN//FMEfzwnepFTDujQd1zgfQCcn77qbrSf3minSCfAVKde7bmw758HH/n7SN6 t9dUagvf9hHjX6+mSauJgouqPheI6e9q5yoy41ToJgs7Hq24LsHYSU7mIfW9JEcgDQWw GGZT6aCKA6evFPtr21/1vST41gvfTLWFCDGZ44q/+EyTtmpULMjYDVbzoP9KmIFgpHQQ 9/2zVI3/TFj8b4KojvHecMYCC8jDsP6wz+Z2m9p6c20kHLweeSV9kD9ZI0LMOAryvd97 bsgg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id di7si5338562edb.220.2020.08.14.04.41.58; Fri, 14 Aug 2020 04:42:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727790AbgHNLTr (ORCPT + 99 others); Fri, 14 Aug 2020 07:19:47 -0400 Received: from smtp.h3c.com ([60.191.123.50]:40535 "EHLO h3cspam02-ex.h3c.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726578AbgHNLTq (ORCPT ); Fri, 14 Aug 2020 07:19:46 -0400 Received: from DAG2EX03-BASE.srv.huawei-3com.com ([10.8.0.66]) by h3cspam02-ex.h3c.com with ESMTPS id 07EBJUuL071856 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 14 Aug 2020 19:19:30 +0800 (GMT-8) (envelope-from tian.xianting@h3c.com) Received: from localhost.localdomain (10.99.212.201) by DAG2EX03-BASE.srv.huawei-3com.com (10.8.0.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Fri, 14 Aug 2020 19:19:33 +0800 From: Xianting Tian To: , , , , , , , CC: , Xianting Tian Subject: [PATCH] sched: Remove useless settings when 'tg == d->tg' Date: Fri, 14 Aug 2020 19:12:52 +0800 Message-ID: <20200814111252.36379-1-tian.xianting@h3c.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.99.212.201] X-ClientProxiedBy: BJSMTP01-EX.srv.huawei-3com.com (10.63.20.132) To DAG2EX03-BASE.srv.huawei-3com.com (10.8.0.66) X-DNSRBL: X-MAIL: h3cspam02-ex.h3c.com 07EBJUuL071856 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org if 'tg == d->tg' is true, the previous settings for period,runtime are unnecessary. So move the settings to the 'else' branch. Signed-off-by: Xianting Tian --- kernel/sched/rt.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c index f395ddb75..8b5505735 100644 --- a/kernel/sched/rt.c +++ b/kernel/sched/rt.c @@ -2504,12 +2504,12 @@ static int tg_rt_schedulable(struct task_group *tg, void *data) unsigned long total, sum = 0; u64 period, runtime; - period = ktime_to_ns(tg->rt_bandwidth.rt_period); - runtime = tg->rt_bandwidth.rt_runtime; - if (tg == d->tg) { period = d->rt_period; runtime = d->rt_runtime; + } else { + period = ktime_to_ns(tg->rt_bandwidth.rt_period); + runtime = tg->rt_bandwidth.rt_runtime; } /* -- 2.17.1