From nobody Mon Nov 25 03:00:42 2024 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 E8D221CB534 for ; Thu, 31 Oct 2024 15:46:48 +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=1730389610; cv=none; b=ZOEy7Y/b48qQepAmOQ0wGCTzPzGeFEI0hPBi/9TnvBo7toKWC0o3E/TJutXCiUxH2aKzu1Pw3UPEFlUFCLxE6z95HIKoAyDE+5e2KTZxNx1LT03AjOKX78A+X9U6zxHsuh24W8/RGFb7VpMybIEvdFjPWWQmfPv+Sc0YAGu4pKQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730389610; c=relaxed/simple; bh=cd4sXhXakwb+fzXsqRjrgrAranc1Xfhju2HSn7PWquc=; h=Message-ID:From:To:Cc:Subject:References:MIME-Version: Content-Type:Date; b=d5vZeujRl0eX8JeJY46g4GsEG+ytTY5vLcA5ZefXs3too3QVhkSQyaOD5cWEyPzDH7pDpz6O/ju5SUna+g7tcH5pdRGCxpM3X9EYI+H9Hp7AZz6Riu5JtnrClb0s5bDIXY7GTk3KMTE4WNhkJfXpm7rqhyaXOHHbcdB8+XxvJfo= 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=dzKxxRHZ; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=xI2FfpDy; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="dzKxxRHZ"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="xI2FfpDy" Message-ID: <20241031154425.752089279@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1730389606; 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=/G9tthwBjRfRyuW6tk1m7S8dPbACqU7gfIOOQy6uXgM=; b=dzKxxRHZdVFEQ3CSWJm9hyznvf0E6q8T0OElhgho1SkLxvYZziUCyPvahANAOMUOflc9vN e6wcq84UigMgEa25oNSI1rXGxy4YSE78LrqTSh8znsW0UiISgQHBOOlv56SrbUUdZh1DaW cIiYHUuXb4DIlxkRoiqkgWbtr9kGFrMKvIw8XnmoO9/mjyfYv2yEpIZbBcJAq2CSa72RT8 nAUGAWTfn9+NQJYDHLg0Qk3WWDCXnew9dh6OfptZD7BfzJMU31+jBJuDNgAfVY0vqgwO5n 0bdHV8qOmYDWTUPLzQ6lzOo/x0vQHNH12671T6ijQ6EAozdIxi1rf4j/u7hdsw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1730389606; 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=/G9tthwBjRfRyuW6tk1m7S8dPbACqU7gfIOOQy6uXgM=; b=xI2FfpDyOzkWeffV0yk+/ocILtMWvki3BViDwmThxYcBf2/Dy3Om7JsLtxpXFPXXweTCNt 3YHavJjXHqGpOICg== 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 v6 19/20] alarmtimers: Remove the throttle mechanism from alarm_forward_now() References: <20241031151625.361697424@linutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Date: Thu, 31 Oct 2024 16:46:46 +0100 (CET) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Thomas Gleixner Now that ignored posix timer signals are requeued and the timers are rearmed on signal delivery the workaround to keep such timers alive and self rearm them is not longer required. Remove the unused alarm timer parts. Signed-off-by: Thomas Gleixner Acked-by: Peter Zijlstra (Intel) --- kernel/time/alarmtimer.c | 28 ++-------------------------- 1 file changed, 2 insertions(+), 26 deletions(-) --- --- a/kernel/time/alarmtimer.c +++ b/kernel/time/alarmtimer.c @@ -467,35 +467,11 @@ u64 alarm_forward(struct alarm *alarm, k } EXPORT_SYMBOL_GPL(alarm_forward); =20 -static u64 __alarm_forward_now(struct alarm *alarm, ktime_t interval, bool= throttle) +u64 alarm_forward_now(struct alarm *alarm, ktime_t interval) { struct alarm_base *base =3D &alarm_bases[alarm->type]; - ktime_t now =3D base->get_ktime(); - - if (IS_ENABLED(CONFIG_HIGH_RES_TIMERS) && throttle) { - /* - * Same issue as with posix_timer_fn(). Timers which are - * periodic but the signal is ignored can starve the system - * with a very small interval. The real fix which was - * promised in the context of posix_timer_fn() never - * materialized, but someone should really work on it. - * - * To prevent DOS fake @now to be 1 jiffy out which keeps - * the overrun accounting correct but creates an - * inconsistency vs. timer_gettime(2). - */ - ktime_t kj =3D NSEC_PER_SEC / HZ; =20 - if (interval < kj) - now =3D ktime_add(now, kj); - } - - return alarm_forward(alarm, now, interval); -} - -u64 alarm_forward_now(struct alarm *alarm, ktime_t interval) -{ - return __alarm_forward_now(alarm, interval, false); + return alarm_forward(alarm, base->get_ktime(), interval); } EXPORT_SYMBOL_GPL(alarm_forward_now);