Received: by 2002:ab2:1347:0:b0:1f4:ac9d:b246 with SMTP id g7csp64891lqg; Wed, 10 Apr 2024 15:48:01 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWqFb7oHohx301LqDZrWR19nqVBZ8SL+Z9Tael0sqnz2Xy3hfinznhE91zcF+tIAqVMP3OT1+i5XgITbkUWLOJ3oKVtcIgcZFNUE3cQxA== X-Google-Smtp-Source: AGHT+IHSzkOMU7XT6yVxsFsbWYTLL0UaPajUKr3nYUwFr63ptk4xClIL4M//b1UDroSxoRnfBoVa X-Received: by 2002:a05:6e02:1806:b0:36a:36d3:7e15 with SMTP id a6-20020a056e02180600b0036a36d37e15mr4912214ilv.22.1712789281623; Wed, 10 Apr 2024 15:48:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712789281; cv=pass; d=google.com; s=arc-20160816; b=NhRyyeT2gQ2HDOysONuBOhRnRpZeq6Y+KaQotkHe6eVT1FOZi8lLboKuHyqvDdEwnA tUUkohUw4pJgX0S14DBy9BPo8r5leMo/CK4GOZUkZyogfxUFzHLU5ocHLWGRQC0YQXK/ OEoVjUpDVTb4HaujUDYKgkVxQzDR3ReCbc8k3ZFS6vZgXK9AqjwQ3FLUAMERtA+lKVqe SJg6XS3tm9e1X/LEYn86sXtYohHrS1Gs/knZb7hzVgpid3+OAnbTLSVxFVB1Zy5urfpN 0POh9b3/LICjqT1iwSKU4hgG0L/qb36ElnjAXvrfySmidirn7NhReLTzR7bOI7HV+rnc LYNg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=date:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:references:subject:cc:to:from:dkim-signature :dkim-signature:message-id; bh=AfHYSU/HugM7h61r392aP8dR7dmyLHuDBcUa2xZEhTQ=; fh=joBs/8L+orz77ylyCy6wqNwwi35f7sYhLR+/TQjQjhI=; b=swPhsyOvRAHCykMTBYcGjzNbsJl3nx/SKKJRe7NQsizgf5E50BPmXY45+q0oj7ycQV v1RgYdTkcG4Ki1fixC7nAKpxJsgKgxXSqwt5c05jhssftd3aSnK7pd2Z7OsFOWMKn0U1 wFQJwuoagEwmYA8+J5XjjW9QAGlP1hu8rrORQLBIUMIc5hzEmdPPgomAaEBWt47c+yg0 m0Gyj+V4nrM1DqX/LNyi4s7GKNAbh+VAW8qUN3IdWj5o1gQdNfQCdFX7aNim2yzyhHPX kG3jILZ8v2AKKfXcaiFin7sJNGaIhL9aT6ml+GQ3BwyuGWjqQOpyiykKo1oI2U4Of2Pv dJdw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=k3J8Iis4; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-139461-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-139461-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 18-20020a631952000000b005f05c95f71dsi89700pgz.358.2024.04.10.15.48.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Apr 2024 15:48:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-139461-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=k3J8Iis4; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-139461-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-139461-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 20893283EED for ; Wed, 10 Apr 2024 22:48:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8BB9C42045; Wed, 10 Apr 2024 22:46:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="k3J8Iis4"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="lsgHz7XW" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 59F6E41C61 for ; Wed, 10 Apr 2024 22:46:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712789189; cv=none; b=eID62gg3cEHfVt2ea1pl76okz4H1xi/uqRrDQmENkz6sRJvrhNeyVpgqq4Qs1adIpiP+9S4PzmwM0+j8/WvTGHcFx7dytLAbZrNlCtEgzZSGMNuDSSfBJ5m5M+ldXsFgBXPPUOTYWSAQ++wGxJZCpso7VtkXS2DNSXUwiFXxPP4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712789189; c=relaxed/simple; bh=gUItmgDH5rsS1e6yVmaYPpvSzF4y549YIibjLNxq98E=; h=Message-ID:From:To:Cc:Subject:References:MIME-Version: Content-Type:Date; b=NFCYRdIlaQheqmcHfz7Z/obO1G5MVP3zDChsdL9vzkShf1ijMYJR8+5jtVAQigKP7pz9xEfLipmvQWGlaoeaGtfvHqMHRpzPb77G9w3OQiHoR9vTF4qwR6c+Q/QuM0RJOEPINy7P9pWChlXInM0RBKzVM7Ufak0es7/RLKeLWJc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=k3J8Iis4; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=lsgHz7XW; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Message-ID: <20240410165551.442678509@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1712789186; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: references:references; bh=AfHYSU/HugM7h61r392aP8dR7dmyLHuDBcUa2xZEhTQ=; b=k3J8Iis4UlCEz7ouQzMEVjnMpqbka+RyNovjeI8aMklnVdHDeXDeuJOAsK8CKGSiUaYXRu p319ipNtFrkW8B4FkNSODjp9yWBC18lHf5Etwd6DcKrJfwHNo8k0WjZXYK/kNHoO6x06Jq znwaNA51jlKRQXRtDWLg1hcBBAZ6y/AnVg3i70ZBrn0vsqBXIDAIS7Wc/drUIsTt7RwOPI DdtiRfeiMMBU801yoaLMb1n6NFZGqKYOAsobsy50Jzux3g66vK32R1rUuMpKi37o6PAn+N aYN7lcE/Rt8T+RibDHnavHbTTSN1c83/EOkJwWkAEWOtqRTma9aUbhJTo8pONQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1712789186; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: references:references; bh=AfHYSU/HugM7h61r392aP8dR7dmyLHuDBcUa2xZEhTQ=; b=lsgHz7XWUuyEN3c9+lGzFckBDC+HrPIbvO/LBtiP8ihJet9FKA4TQGmyR23O7VM9XWD0LY GrevTs8eMP3acTBw== From: Thomas Gleixner To: LKML Cc: Anna-Maria Behnsen , Frederic Weisbecker , John Stultz , Peter Zijlstra , Ingo Molnar , Stephen Boyd , Eric Biederman , Oleg Nesterov Subject: [patch V2 08/50] posix-cpu-timers: Save interval only for armed timers References: <20240410164558.316665885@linutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Date: Thu, 11 Apr 2024 00:46:26 +0200 (CEST) There is no point to return the interval for timers which have been disarmed. Signed-off-by: Thomas Gleixner --- V2: Split out into new patch to make review simpler - Frederic --- kernel/time/posix-cpu-timers.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) --- a/kernel/time/posix-cpu-timers.c +++ b/kernel/time/posix-cpu-timers.c @@ -809,17 +809,15 @@ static void posix_cpu_timer_get(struct k rcu_read_lock(); p = cpu_timer_task_rcu(timer); - if (p) { + if (p && cpu_timer_getexpires(&timer->it.cpu)) { itp->it_interval = ktime_to_timespec64(timer->it_interval); - if (cpu_timer_getexpires(&timer->it.cpu)) { - if (CPUCLOCK_PERTHREAD(timer->it_clock)) - now = cpu_clock_sample(clkid, p); - else - now = cpu_clock_sample_group(clkid, p, false); + if (CPUCLOCK_PERTHREAD(timer->it_clock)) + now = cpu_clock_sample(clkid, p); + else + now = cpu_clock_sample_group(clkid, p, false); - __posix_cpu_timer_get(timer, itp, now); - } + __posix_cpu_timer_get(timer, itp, now); } rcu_read_unlock(); }