From patchwork Sat Apr 29 00:28:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li zeming X-Patchwork-Id: 88148 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp109399vqo; Thu, 27 Apr 2023 01:09:58 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5h3PMxKBjbaXYrYMAp6Y4Z2DRkSIitHXalBhP0BWFPSun3d2rZ3qF/A1ft9sWcdaAhD94q X-Received: by 2002:a05:6a00:2d02:b0:63b:8a91:e641 with SMTP id fa2-20020a056a002d0200b0063b8a91e641mr1260905pfb.11.1682582998543; Thu, 27 Apr 2023 01:09:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682582998; cv=none; d=google.com; s=arc-20160816; b=ITdVMjh/DCjtyaIAadU4xRYelvPMFZDp+34mkADBRqH4eOgXictk6D6uz8r0x0GBwi ARucyLC5JU2cBzN1zYMsRXdB9UlRj3ZfzqeUGaFbF1D/4gNDwP203ED9c0obOK3h6mNT tz1xnnZb4kiXjWxzQ2M+VN+Z/bFrKe2nc91i6mP6lgK1W/M1+TCcf4QCx7j6v3l0x3TZ YYAqexoP2Yxu+GnX6zSBMu11Fahn/NeYxNseA/Tis3rIqn+fH6G3bwpDo9uBOmgP7u6Q 0HCj+YS9lU4VBiIOofNmjyAPj7y8GUhtVqisfnUQcxZ9yW8E1kq3Uwvb8E52hL9g9C7g B+oA== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h14-20020aa79f4e000000b006281ec442absi18523351pfr.309.2023.04.27.01.09.45; Thu, 27 Apr 2023 01:09:58 -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 S243168AbjD0H5T (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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764316150084257707?= X-GMAIL-MSGID: =?utf-8?q?1764316150084257707?= 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; /*