Received: by 2002:ab2:784b:0:b0:1fd:adc2:8405 with SMTP id m11csp488735lqp; Mon, 10 Jun 2024 09:54:10 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVGl7+0mYguS/5TT8H3a97p948JHR+HY9LG8lOadEdOiWiY9/YwvfPuhWHAEJBRChwb+ue+dyW3blx6UsaK1e56P/amUetxTUqK7IPXqg== X-Google-Smtp-Source: AGHT+IHZxWRu3y7k0KorrZ/Q0baUQjbZMsKehYhWgtBpDf3OPWj70XpK5yO961ZQZKKYVmqS1lz6 X-Received: by 2002:a17:906:8888:b0:a6f:279b:37ca with SMTP id a640c23a62f3a-a6f279b38b3mr100069266b.51.1718038449847; Mon, 10 Jun 2024 09:54:09 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718038449; cv=pass; d=google.com; s=arc-20160816; b=Fx5bIYC5KR5T7nBSgaIrdz7rXhyYa1/Za9bai6dCR+1XcVd0dnHzU/gdyA87wYl+XZ uoCLw+WuMwpJjP3OwlC9EwF3EOOpQLtZWE1Dv06nWlkWKM/Uug1sk49MvGhaZh/T3CAR DYcl0tHwftp0x62PHJGqUTSVmjIzpV0q6WfWlOxU4jbF78InA/YqpqO/joFiOSoImt1g 5UfpFmG8NCdrvIvTe8Ob33Gg36nCB3r7oyJwa0kqzONE90mZ89n3gJv0jTULhdCR1g18 q2vSbi2I/Gln7wngQAMwwgynIJNleulzPK3K7AlOZcCtbfqxRpB+ew2hzex92SRXPiCV Gh5A== 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=HdIXDmhsPUZ2RPLujxzrsxlJ5xE23RHzUivxcwc9L5U=; fh=joBs/8L+orz77ylyCy6wqNwwi35f7sYhLR+/TQjQjhI=; b=a3zeAm5l63FjNvEccrnWFL1J9F9AUqM2YfcwM5yzWIZGePIjgZHpswsI/Veh0/f+Tp IUh3FWWwf4Wk5/ilX1YWR4ml0HBq7OulBhulMlYTC4a9aoWNLFkRZg5uhYQ23+73RCpi 4q7u/trokwhjzp9k5dzAdk8c6tUWt8w5XgvXme/u6P/O2+slk9Zib5gTegG0r1mMw1Z7 +/xjRalgX93fIRqFtMavd7melM+nTBXm7Gu0nFANDVH/XikYQ3xJ7JRl2+M7THtal7+H 4MhHg0unEO/I99E14tcfEacp+Vr2JtV14F9oHZPw9+NYh4FM63e+lNscH1YXHHdtb9FI JS/A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=braac+sm; 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-208617-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-208617-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. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a6ef618780esi329350566b.615.2024.06.10.09.54.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jun 2024 09:54:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-208617-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=braac+sm; 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-208617-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-208617-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 693741F214E5 for ; Mon, 10 Jun 2024 16:54:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4DEEA15ADBD; Mon, 10 Jun 2024 16:43:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="braac+sm"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="eklJcDEC" 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 C88C515A49C for ; Mon, 10 Jun 2024 16:43:09 +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=1718037791; cv=none; b=N8EYAj+DLLUyakJ9dloqJbU3H4BF1SDVcyQ0xNitRIwyGVMPIye38nLXlOJ8xENkH7LS9UsUaPt3jZsB2MIx+fCUT2Jw4l0FeaAj7mOSyuSo2DgozDRhgGgH3WLLcxhfulP6/Mu/rQ5qkaXIV+gv3ZyPjLqDFvA5RcZ3Ldod9bg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718037791; c=relaxed/simple; bh=dVOMH7eiDEHVePUyZa4h1ExK1Rjvcqco8G9d9SW/qIU=; h=Message-ID:From:To:Cc:Subject:References:MIME-Version: Content-Type:Date; b=QKzODpsBhzg7NiBWfh6MV/nyMOBUiJj661LihoW2fmEtxHb174+Pod3WirfT3HbavLIV2HZCIU8U8W4FmjLrTeObuVf0NZ0Gpf2UeFqPAeefYgHI7UWr34JziTFDNr0G58qkqhTWMNzoyuyWZvmq5c+uchGQRt8RsZaySOBP4p8= 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=braac+sm; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=eklJcDEC; 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: <20240610164028.602391697@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1718037787; 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=HdIXDmhsPUZ2RPLujxzrsxlJ5xE23RHzUivxcwc9L5U=; b=braac+sm3dy3Sj6PI2wRWC5h2tNpmtL6i1ul4xFtWdXaCn8Se2grLPNaS15m1K2azpftr3 a5AV9MqnpwnViEb3EHB+V57NUSVQcKGCh7vcqye5bGHdXxOJXCtBqFhUJssrFoDlsf+YSl GJhQD3MoEL6s2Lu425H26W7QCnR2oLbns2SPUwQhD1bXIa5oF6CHzG8e3N/5dYe1JQiCgJ qG7khJkbfQXX2ovn7Lb4AF8xlnz6HbtwHk0MFzfPpfculL/uAhaI7u5sZTO8GA/8HSitYx ZfPIIM9qYGBTi4U1XGJ+vcVu3BSsw+ZblWp1ipoSu2V4T/ooa34yH/mco12vfQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1718037787; 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=HdIXDmhsPUZ2RPLujxzrsxlJ5xE23RHzUivxcwc9L5U=; b=eklJcDEC7895pOTsJCssnGpd5ZjyEg5taghQDWJrmLU86tOjVf4k9d0N2sHaLPlXN0Qszo jSE4fPnw95Aa27AQ== 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 50/51] alarmtimers: Remove the throttle mechanism from alarm_forward_now() 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:43:07 +0200 (CEST) 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 --- kernel/time/alarmtimer.c | 28 ++-------------------------- 1 file changed, 2 insertions(+), 26 deletions(-) --- a/kernel/time/alarmtimer.c +++ b/kernel/time/alarmtimer.c @@ -469,35 +469,11 @@ u64 alarm_forward(struct alarm *alarm, k } EXPORT_SYMBOL_GPL(alarm_forward); -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 = &alarm_bases[alarm->type]; - ktime_t now = 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 jiffie out which keeps - * the overrun accounting correct but creates an - * inconsistency vs. timer_gettime(2). - */ - ktime_t kj = NSEC_PER_SEC / HZ; - if (interval < kj) - now = 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);