Received: by 2002:ab2:784b:0:b0:1fd:adc2:8405 with SMTP id m11csp483052lqp; Mon, 10 Jun 2024 09:44:04 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUNmrqNC30K00RwryEjr+R/uAsxQS6EvaCy87a7nLZTtCJD9lGltY+0puFhVkBPVitGMUhu267iLB4cVIPubyGC6Bx+OxlRnjq0kuYU4w== X-Google-Smtp-Source: AGHT+IFCdogL8aIRbo9IRnu0Og6c5vQyX5HH601w/rPANGLw8VpDaBh4k/TqGpK3W0c571wqV4Wf X-Received: by 2002:a19:8c42:0:b0:52c:7fbf:39f6 with SMTP id 2adb3069b0e04-52c7fbf3b15mr4776754e87.26.1718037844110; Mon, 10 Jun 2024 09:44:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718037844; cv=pass; d=google.com; s=arc-20160816; b=L5vCswNfKn/jjH90m9ACkgqA9GtuZI+LLcmQ1PPhvkLP2ROuXnqHzDSCpBCwq8DJwa kTPjZnTF0JXVVd2Ke+KUGtInAh+oQiimu8lqxhqfaYfnrfd8Ik2ZLMPjT8B40un06x+u a4iaYu/pt7C5CLp3BuqJaiXHTfjXlDUQIseNhYVAyzEYp+6xoYH606qO/Y7LqR4ZULZD YiK/YiUG6Aw9GymW8fA2/GPNPEDZBTQpc2Yepkr6MuxaRMKz5ao4eAueIv7g4DpBqi5r Ke0TCfQVAhfjwIGctVQLarlr1DnXgdpG+5byFCq4owuA5cO05JJ2qaselUH4xCb7sm1U 5YZw== 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=MB3Htz6gzXLfdbHK2ZTh52WtYq6vJ3Ye/LEB0TzY8VszqCKDBSeYgeJ2Xdswnaka4e Tgt1820bWirKlRqJggBYEUIjNP2PrbfIydnB8ihqAM1Z2BElvxVZtrCHyGWd/Xn0WhVy 6nLhMRcVKtPoKFtUNtxtuRmnB8QJMPWknkBVLO4r+WFVugCnOwAxyYN+ZB1WVgG86o92 zu3oKxOExccQcDQSogdEEJ/kswoj2Px5PBDUybZCBf9cx2Eq2ro2YeUhvd+Szg7Ypju8 KTbqMV9zdVy2D7d3rCT3oO2iRbkpdgAlhlRUqviBOvSzF2LDoj6lVCXhkV6jw/HyFow0 meSw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=JQZPudCM; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=38II87pf; 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-208571-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-208571-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a6f09af1d40si239495966b.572.2024.06.10.09.44.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jun 2024 09:44:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-208571-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=JQZPudCM; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=38II87pf; 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-208571-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-208571-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 am.mirrors.kernel.org (Postfix) with ESMTPS id E3FCF1F230BC for ; Mon, 10 Jun 2024 16:43:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E11C414F9DD; Mon, 10 Jun 2024 16:42:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="JQZPudCM"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="38II87pf" 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 363981482EE for ; Mon, 10 Jun 2024 16:42:19 +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=1718037741; cv=none; b=RD1tu75idrYH1x6tTGmiYhh1uJbpJeq3AdGmWvxg9T0C8Wk1cg3RdPY/tHtyv1U/Q09FrKV34sQyyThd3xhr8CtgzqYnkVNU5mD6ErStypjGEPZ1ZOk+3FvWc8C3GnN/Aed9RMRKmf0OIVb3PMVigxOcBmLCH4xTrz/Rl/gYD3U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718037741; c=relaxed/simple; bh=gUItmgDH5rsS1e6yVmaYPpvSzF4y549YIibjLNxq98E=; h=Message-ID:From:To:Cc:Subject:References:MIME-Version: Content-Type:Date; b=lEMfoyZDKLfOXbJwPgCfLFMJteUdAGIuR8MiDUgnM3C8EpMfugLMQLq4fFlJ76yaAX1cLcaBdqZnGvE5adyO6yQqPXxrJUlPCav7o8Bn0yYe728P3bMpImGkCPLUnX7G343QjbIdFvx4mQTXZnH/pJkPEIdmbUcPP/QPLWG4XD0= 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=JQZPudCM; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=38II87pf; 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: <20240610164025.971657046@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1718037735; 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=JQZPudCMNolibX4vURulBU39MhGyWu3HXCZHw+FyLSu2rJjt3v0EFcAeQrbMEV6CH5XhPA aQpAtZagWpZ2YLcRWz/jd1EOgNKDhFveJ/IP0B8EBQDLrDf8271t5W2cdwQRN/xePxjLiD Oj/vt9/0QwzS2luBqHZYegq88UrQRXddfcMvSkzxw9II8Hu8q/JCqdO0+EwLetscpr+EcZ NqCVHHQGsnwxGZAf17vThiezgLOehoy4iBqimnFaZed00y2CAotgm0IT5WsaWRBuJBWst7 IecLSjlXGvj2UINgr2Vuc+A+8P+g/z9ybTnlGGQ/CS6H7PdtEDvj4bWVsr6yQQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1718037735; 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=38II87pfUGOm2DJSi/XlcrNEwOiFG35nAjbqtztPqdpqv3MYV3AUF8UiABpvO97g7LZ+4U L2H6rU7kIN6OFaCQ== 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 V3 08/51] posix-cpu-timers: Save interval only for armed timers References: <20240610163452.591699700@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: Mon, 10 Jun 2024 18:42:15 +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(); }