Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp294107rwr; Thu, 27 Apr 2023 01:06:28 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5S5mlD/tYQnxDSKpuRBeCqxMIQ7G8XUtTCGMZdQnuMArQlVqY5Plzp8OZI69aDm2E8ycEJ X-Received: by 2002:a05:6a20:440d:b0:f8:ea21:7c4f with SMTP id ce13-20020a056a20440d00b000f8ea217c4fmr643044pzb.5.1682582788582; Thu, 27 Apr 2023 01:06:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682582788; cv=none; d=google.com; s=arc-20160816; b=nbWEQk8jP0uWtBQONEhapYByg5jEnK6dZxn9hgVSrnwX0IBWvj8q4Ob2+tRS0+S8Yl W2uIZHkmdlVScndG4/5yO4jsOQBzP3frCqyNn7EGQ1UuvfZeq5rThXQhIx2lF29Zumpr l++a+O4HjVXt5f7KL/rD9630FQwKSpRmaqCuOKiHjPhJFXgMqU9e+X3mHuM9Wn/HRPvS pRPNiSDQQHpf/P2JmUoznJNT3z8EcaW5fswFhv/3uzWiumY0jDpaLmQz8pJ+8syj4w5z x6IIIIcGq4p8ATjdCW9Na7uSwujN1CcupZa1OUVAuL3VgmUgnC1jI4q1aF9+rrSAF3o8 7xKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=TogS/fY/yB7k/OQqapq9nsBs3nSsXO773fObwg9dMnM=; b=swB+cVz/VsaJhWtokk2sPeRAB1s8/rWgXe8QydzuHXE3LZdeWZGDOLCoVqiscRdILd KfzLD1wVjBeP1R94CcTjvjMEZR3h36ZUbXZqVQ8UFHqtuxXHs3CsVZ77XLXmd2KE1Slh IHjYqXNQYXsmTBsDjspSftA6iGpTAQU3ogAUBB5XxGl+nQB/v5WBBZTEsGx2B9jcLLfu 69bEOfWOe5ii3BnjYCnC50hhV4MA7Nhse/YjqyjvQ1NCJShV7voFVyfX1MWgwRuKuUyF QByB97TFJhasPPrUjiIc+KPHWIOfstflKmDWkNEW7p6PbKFpknEE9jaEl+nrDWPFAtQK eciQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t69-20020a637848000000b0050c0c9d2930si17146537pgc.48.2023.04.27.01.06.17; Thu, 27 Apr 2023 01:06:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243092AbjD0H5T (ORCPT + 99 others); Thu, 27 Apr 2023 03:57:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59648 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242987AbjD0H5R (ORCPT ); Thu, 27 Apr 2023 03:57:17 -0400 Received: from mail.nfschina.com (unknown [42.101.60.195]) by lindbergh.monkeyblade.net (Postfix) with SMTP id 759DFDE for ; Thu, 27 Apr 2023 00:57:16 -0700 (PDT) Received: from localhost.localdomain (unknown [219.141.250.2]) by mail.nfschina.com (Maildata Gateway V2.8.8) with ESMTPA id 3EBBA1801193B1; Thu, 27 Apr 2023 15:57:14 +0800 (CST) X-MD-Sfrom: zeming@nfschina.com X-MD-SrcIP: 219.141.250.2 From: Li zeming To: mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, vschneid@redhat.com Cc: linux-kernel@vger.kernel.org, Li zeming Subject: [PATCH] sched: core: Simplify sched_can_stop_tick() Date: Sat, 29 Apr 2023 08:28:31 +0800 Message-Id: <20230429002831.2875-1-zeming@nfschina.com> X-Mailer: git-send-email 2.18.2 X-Spam-Status: No, score=0.9 required=5.0 tests=BAYES_00,DATE_IN_FUTURE_24_48, RDNS_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Remove useless intermediate variable "fifo_nr_running". Signed-off-by: Li zeming --- kernel/sched/core.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 3249c1272e57..1bab401920e8 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -1176,8 +1176,6 @@ static void nohz_csd_func(void *info) #ifdef CONFIG_NO_HZ_FULL bool sched_can_stop_tick(struct rq *rq) { - int fifo_nr_running; - /* Deadline tasks, even if single, need the tick */ if (rq->dl.dl_nr_running) return false; @@ -1197,8 +1195,7 @@ bool sched_can_stop_tick(struct rq *rq) * If there's no RR tasks, but FIFO tasks, we can skip the tick, no * forced preemption between FIFO tasks. */ - fifo_nr_running = rq->rt.rt_nr_running - rq->rt.rr_nr_running; - if (fifo_nr_running) + if (rq->rt.rt_nr_running - rq->rt.rr_nr_running) return true; /* -- 2.18.2