From patchwork Wed Oct 4 12:34:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anna-Maria Behnsen X-Patchwork-Id: 148254 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp98398vqb; Wed, 4 Oct 2023 05:36:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFpBFvIuMgnBCYhGBOctr8+wXehk9C8ZdPs1JdcgGJyrJIhjE0XDsJUh8tDjPMuJD4vFLjv X-Received: by 2002:a05:6e02:b4c:b0:34c:b992:58b1 with SMTP id f12-20020a056e020b4c00b0034cb99258b1mr2767719ilu.2.1696422987408; Wed, 04 Oct 2023 05:36:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696422987; cv=none; d=google.com; s=arc-20160816; b=pbSO+uhWADYDmTbGQkruz8w5f1GTVNSZaIGTbyy3VXgmdoyWSkGK/hJ8i0SJthLwYd 2KTPgou+tWquQh/IZdYU7mSZMYjPtIIpSJWfAqRZR7nliIY7br95UFM55wwnPW2/ujvk 1BPUO6Dgj83m8b2UlN32x9UE5/1KJZeshqrkMsijJsY5sbLRsU7eaxxKEIl1o2p3XSTD adcMHRcbP8Nli9Qa78Rgq3bIKLco81kllYS6n3xxkhAAmjSvEsdeMRA/b5RYCMh7t+8u EtgDaIJbxxfxFKz/J0XoyvIT7RVZVc9VsWr6iTGY6b388Kke3Mxm8l2enEk2MnkXaJ/T 1rmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:dkim-signature :dkim-signature:from; bh=2ZHSfoxNVfe828MrfNDKWiKa0rU0JZbDLb7SUO4brts=; fh=PG6uS4TiiUSDyl8D/joYkWbwCgDm4ug0ir2h7tHBJXQ=; b=0l24kQw0+/GugYlvlbHk+yUVe8hn4Y2QVPuBJ/m9lb+Y/3K8C5PuzMK8NZ3gHlolaq 8wssI2yrN0uJjkSrh6E3qYkt33mCzcOPKXDuMFVBb7/qU0tXULS2GAPZ0qSkCBj/auOA KDcpCpczha/ZNS+OLA6aKYB5KMZ/CEqI4IJSi8NUFitfb5vLxbWUs96u6OB2QQ6r6VCt ne8nBriMISrqeWkY+2h/PoJtWFYeEgzYToL+VcRoMu1eYlJ+3x9U9DAAk7tGLHmU7Uq6 HZNbQt6fPP0GfqBtf19CbHYPhUvPWQ95O7T51jWkutC4FxVMV3NTaQmRtgywlGiFazEo KsSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="XKS1DMu/"; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id g25-20020a633759000000b005859de837c9si3760662pgn.105.2023.10.04.05.36.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 05:36:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="XKS1DMu/"; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 65563807214D; Wed, 4 Oct 2023 05:35:35 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233247AbjJDMfc (ORCPT + 18 others); Wed, 4 Oct 2023 08:35:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39406 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233099AbjJDMfa (ORCPT ); Wed, 4 Oct 2023 08:35:30 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D3C1ABF for ; Wed, 4 Oct 2023 05:35:27 -0700 (PDT) From: Anna-Maria Behnsen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1696422926; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2ZHSfoxNVfe828MrfNDKWiKa0rU0JZbDLb7SUO4brts=; b=XKS1DMu/waoOHui1J6PmDLbV3W5XSSy+sqIC/BixILtS8JJQAtNGc7wFqsXwk4os7DeJBI gIvdpDDtQYAy5CDTO1uuvPwtJYkyGGxkDj/B7B+/M3yIxdCiDvoouIEa/d2BFQELmjo+8C E9MNouWmy42JTVdrwvvoSZEFHvU0iMj7+H8DOwrz8/BO6WboqMR/el3Qr9jk0Esn9D5RcR SlKq93yYc2Ib6Uq/O2yw9RUWMGN3wxS8Yx3HCU05bGXsnG7rk0aipwsxT266Y4xl/sjiqA aNtkeuCN6lLuKQmB91ySFoLNfjzI9W3cCNkV5plz/KnFFmFsHKhL6pMEHZjzAg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1696422926; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2ZHSfoxNVfe828MrfNDKWiKa0rU0JZbDLb7SUO4brts=; b=tbs8E8IzWgWCFdOYwM8uWCeZ8Q6ekfq3O5YC6QDuLtnXEf0o2yjyED6kp87FJBA1RoAHpm Y8aaEpV1MmJ6OvBg== To: linux-kernel@vger.kernel.org Cc: Peter Zijlstra , John Stultz , Thomas Gleixner , Eric Dumazet , "Rafael J . Wysocki" , Arjan van de Ven , "Paul E . McKenney" , Frederic Weisbecker , Rik van Riel , Steven Rostedt , Sebastian Siewior , Giovanni Gherdovich , Lukasz Luba , "Gautham R . Shenoy" , Srinivas Pandruvada , K Prateek Nayak , Anna-Maria Behnsen Subject: [PATCH v8 01/25] tick/sched: Cleanup confusing variables Date: Wed, 4 Oct 2023 14:34:30 +0200 Message-Id: <20231004123454.15691-2-anna-maria@linutronix.de> In-Reply-To: <20231004123454.15691-1-anna-maria@linutronix.de> References: <20231004123454.15691-1-anna-maria@linutronix.de> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 04 Oct 2023 05:35:35 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778828430414174409 X-GMAIL-MSGID: 1778828430414174409 tick_nohz_stop_tick() contains the expires (u64 variable) and tick (ktime_t) variable. In the beginning the value of expires is written to tick. Afterwards non of the variables is changed. They are only used for checks. Drop the not required variable tick and use always expires instead. Signed-off-by: Anna-Maria Behnsen Reviewed-by: Frederic Weisbecker --- kernel/time/tick-sched.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c index 8e9a9dcf60d5..bdad2abdc0c7 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c @@ -886,7 +886,6 @@ static void tick_nohz_stop_tick(struct tick_sched *ts, int cpu) struct clock_event_device *dev = __this_cpu_read(tick_cpu_device.evtdev); u64 basemono = ts->timer_expires_base; u64 expires = ts->timer_expires; - ktime_t tick = expires; /* Make sure we won't be trying to stop it twice in a row. */ ts->timer_expires_base = 0; @@ -909,7 +908,7 @@ static void tick_nohz_stop_tick(struct tick_sched *ts, int cpu) /* Skip reprogram of event if its not changed */ if (ts->tick_stopped && (expires == ts->next_tick)) { /* Sanity check: make sure clockevent is actually programmed */ - if (tick == KTIME_MAX || ts->next_tick == hrtimer_get_expires(&ts->sched_timer)) + if (expires == KTIME_MAX || ts->next_tick == hrtimer_get_expires(&ts->sched_timer)) return; WARN_ON_ONCE(1); @@ -934,7 +933,7 @@ static void tick_nohz_stop_tick(struct tick_sched *ts, int cpu) trace_tick_stop(1, TICK_DEP_MASK_NONE); } - ts->next_tick = tick; + ts->next_tick = expires; /* * If the expiration time == KTIME_MAX, then we simply stop @@ -949,11 +948,11 @@ static void tick_nohz_stop_tick(struct tick_sched *ts, int cpu) } if (ts->nohz_mode == NOHZ_MODE_HIGHRES) { - hrtimer_start(&ts->sched_timer, tick, + hrtimer_start(&ts->sched_timer, expires, HRTIMER_MODE_ABS_PINNED_HARD); } else { - hrtimer_set_expires(&ts->sched_timer, tick); - tick_program_event(tick, 1); + hrtimer_set_expires(&ts->sched_timer, expires); + tick_program_event(expires, 1); } }