Received: by 2002:ab2:1347:0:b0:1f4:ac9d:b246 with SMTP id g7csp73404lqg; Wed, 10 Apr 2024 16:09:51 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVSoPYxXxXLZXXVFn0X46qU/CU/ZCUfHgMVqlr7OssBKsn6p9v+P1pdnBG6FNF7mSV2Q4WgNBTobL+LOq/iJ9Aiwz7F+aKsoUPmnI7i/Q== X-Google-Smtp-Source: AGHT+IH0mEEumdTO1zRl4ZO23PZcEtvs0iDm0YA9ZNnn6X22XEYk0HCOXmDrG4ScnnJV1wsDDdtA X-Received: by 2002:a50:951b:0:b0:56b:9f7c:3c32 with SMTP id u27-20020a50951b000000b0056b9f7c3c32mr2174261eda.12.1712790591246; Wed, 10 Apr 2024 16:09:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712790591; cv=pass; d=google.com; s=arc-20160816; b=mrUed9FwNtfGGDA0598aQiWMOBcY75MN8TUKOXhOUXDx04C9/iBh5hbPiO7lHxRWUh 9lD+w3vCOSs7kmF9haMNhDa4vErEoZ9RBMDgGt5PpsstaDyXulx92NiO9N2Ito2PMMKR 8J9PEL8winICjWaLtjLIl4y5QTEc90OrvIDrQu8qQf7Jc6yMD6AdfNA/VZyw2YkKMBny lJXi5+RksbIHzboqQjjGZhB6j2sr1zP8aqC3LfFDSr6hvVN6UxlP/8djKDHcLkKk0vvm 6UpUyKSemVRBKVD260IwUSR7flUQbPPlhKJKXPdWhcsVsTSqki5dgJv03kuIr7ww+tlf Ux3w== 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=4ZXhSygM4HMfUyJQFe7w4Q0s7qUUsNDQCaN6Cvt7YM4=; fh=joBs/8L+orz77ylyCy6wqNwwi35f7sYhLR+/TQjQjhI=; b=XsNKEWnSgwhXv7RxUrbjsqNiQQ+UZzbQWyTyxLuO5FaPnOs4NwwiqPnEfElYQ0Kr5/ qJQ4BQsx0s70GAv7vmMSKFp/2nYOcY9W4JeVir7Zj7p50qzkrccTifKEFRoMBKr0lrvy hZ44lwCPhPjdrOXHyqI6Ps+SKUlps51UbXzJK9JCf9hO82j0+b4/bvhb+r3dBPEsBzT+ lb5NwOhIG0u/JRhaPuCHNcJ+iHZU89nVAImhLFWys463fdj3IgTBr/fzbkzRDcDrxTuZ 2t20Yik2ZZoEkSC+CiL+CVMQJX24Iq2SHjFgpRHtZxNBZhdE+VoQEwzbiGwrAyr36mSK el3w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=BTAWkgCF; 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-139483-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-139483-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 l2-20020a50d6c2000000b0056e33366ec1si111820edj.399.2024.04.10.16.09.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Apr 2024 16:09:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-139483-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=BTAWkgCF; 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-139483-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-139483-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 70E431F287A8 for ; Wed, 10 Apr 2024 22:52:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D5D527604D; Wed, 10 Apr 2024 22:47:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="BTAWkgCF"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="aTtKDutb" 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 2F14558AC8 for ; Wed, 10 Apr 2024 22:47:06 +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=1712789228; cv=none; b=daR3GCfmxzb8aV5gYdqgwwMrtGkBIm/ZBWBINy7cFKiwpZWH8/bMNnIQsZxfTQDXy4MOUYnzSbSbr244+hUCPpcu9xVobGLeBNgLfizjS8V3kov8MFPgCjD96zDXY7SWNJkubI+2swYOmwRFeUqpaPV8vimsbrdJ0P3q8PCaqfA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712789228; c=relaxed/simple; bh=QRAMzsqKtG3Z4cwj9EcqM7O3sI1tPeIJIx+RIdoHDh8=; h=Message-ID:From:To:Cc:Subject:References:MIME-Version: Content-Type:Date; b=rIJmemYv+7pLTbq/OkxLWXwpeoVY1VPHJ+TPY6m0njVR0EHcc49IPVhsHF3kf8txsTS0T8tTNhIFhijYvRsgGSjLi9J2TW0BYWKvuRvZ/ORzkhUwyfw1dHMuQZip7cksQWs7nZP57MzHUaqYAcuS9X0lEbLtKybGGSEqHWZLpJU= 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=BTAWkgCF; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=aTtKDutb; 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: <20240410165552.833418453@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1712789225; 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=4ZXhSygM4HMfUyJQFe7w4Q0s7qUUsNDQCaN6Cvt7YM4=; b=BTAWkgCFj9d/ovgcd4dXuneCf6Ow9rdolX3dRYjuix16CWMvnq841yxqMEb8OfNCBx3u/L k3n4fWFzCUqiwAl7Pg1uTjiD3Ea1DovSsxRR58H2zuFNfePNcxS/fDUfZzL03hLjfs9jy+ ZUz4Bciain+7+VZvJWdB7es9cMrHUxZ6u8eapMNk1/cq99g0D2Uw/1ytwI/wvfCd4/8VVL zHwgtxGOmZmMhNxBhVV7z4DJQBpepqnBgTtATKvOEyFsBIAnw0EY01GNw+GlNikLraUkgp gGfAc9bml1C0n7VbXkVyfTm8T9A4sluFDAJl/h/RIqG/lW2+1O7PWDYMaUeXWA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1712789225; 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=4ZXhSygM4HMfUyJQFe7w4Q0s7qUUsNDQCaN6Cvt7YM4=; b=aTtKDutbuGIxyE6hfQiTfKUzgDog/q/KWcVArYbSA9knIlhAxXA+5h9E4+e01g1A52mh/6 8VTdWc4k1+QJW4DA== 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 30/50] posix-timers: Rename k_itimer::it_requeue_pending 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:47:04 +0200 (CEST) Prepare for using this struct member to do a proper reprogramming and deletion accounting so that stale signals can be dropped. No functional change. Signed-off-by: Thomas Gleixner --- include/linux/posix-timers.h | 5 ++--- kernel/time/alarmtimer.c | 2 +- kernel/time/posix-cpu-timers.c | 4 ++-- kernel/time/posix-timers.c | 12 ++++++------ 4 files changed, 11 insertions(+), 12 deletions(-) --- a/include/linux/posix-timers.h +++ b/include/linux/posix-timers.h @@ -150,8 +150,7 @@ static inline void posix_cputimers_init_ * @it_active: Marker that timer is active * @it_overrun: The overrun counter for pending signals * @it_overrun_last: The overrun at the time of the last delivered signal - * @it_requeue_pending: Indicator that timer waits for being requeued on - * signal delivery + * @it_signal_seq: Sequence count to control signal delivery * @it_sigev_notify: The notify word of sigevent struct for signal delivery * @it_interval: The interval for periodic timers * @it_signal: Pointer to the creators signal struct @@ -172,7 +171,7 @@ struct k_itimer { int it_active; s64 it_overrun; s64 it_overrun_last; - int it_requeue_pending; + unsigned int it_signal_seq; int it_sigev_notify; ktime_t it_interval; struct signal_struct *it_signal; --- a/kernel/time/alarmtimer.c +++ b/kernel/time/alarmtimer.c @@ -584,7 +584,7 @@ static enum alarmtimer_restart alarm_han * small intervals cannot starve the system. */ ptr->it_overrun += __alarm_forward_now(alarm, ptr->it_interval, true); - ++ptr->it_requeue_pending; + ++ptr->it_signal_seq; ptr->it_active = 1; result = ALARMTIMER_RESTART; } --- a/kernel/time/posix-cpu-timers.c +++ b/kernel/time/posix-cpu-timers.c @@ -608,7 +608,7 @@ static void cpu_timer_fire(struct k_itim * ticking in case the signal is deliverable next time. */ posix_cpu_timer_rearm(timer); - ++timer->it_requeue_pending; + ++timer->it_signal_seq; } } @@ -745,7 +745,7 @@ static void __posix_cpu_timer_get(struct * - Timers which expired, but the signal has not yet been * delivered */ - if (iv && ((timer->it_requeue_pending & REQUEUE_PENDING) || sigev_none)) + if (iv && ((timer->it_signal_seq & REQUEUE_PENDING) || sigev_none)) expires = bump_cpu_timer(timer, now); else expires = cpu_timer_getexpires(&timer->it.cpu); --- a/kernel/time/posix-timers.c +++ b/kernel/time/posix-timers.c @@ -269,13 +269,13 @@ bool posixtimer_deliver_signal(struct ke if (!timr) goto out; - if (timr->it_interval && timr->it_requeue_pending == info->si_sys_private) { + if (timr->it_interval && timr->it_signal_seq == info->si_sys_private) { timr->kclock->timer_rearm(timr); timr->it_active = 1; timr->it_overrun_last = timr->it_overrun; timr->it_overrun = -1LL; - ++timr->it_requeue_pending; + ++timr->it_signal_seq; info->si_overrun = timer_overrun_to_int(timr, info->si_overrun); } @@ -299,7 +299,7 @@ int posix_timer_queue_signal(struct k_it timr->it_active = 0; if (timr->it_interval) - si_private = ++timr->it_requeue_pending; + si_private = ++timr->it_signal_seq; type = !(timr->it_sigev_notify & SIGEV_THREAD_ID) ? PIDTYPE_TGID : PIDTYPE_PID; ret = send_sigqueue(timr->sigq, timr->it_pid, type, si_private); @@ -366,7 +366,7 @@ static enum hrtimer_restart posix_timer_ timr->it_overrun += hrtimer_forward(timer, now, timr->it_interval); ret = HRTIMER_RESTART; - ++timr->it_requeue_pending; + ++timr->it_signal_seq; timr->it_active = 1; } } @@ -667,7 +667,7 @@ void common_timer_get(struct k_itimer *t * is a SIGEV_NONE timer move the expiry time forward by intervals, * so expiry is > now. */ - if (iv && (timr->it_requeue_pending & REQUEUE_PENDING || sig_none)) + if (iv && (timr->it_signal_seq & REQUEUE_PENDING || sig_none)) timr->it_overrun += kc->timer_forward(timr, now); remaining = kc->timer_remaining(timr, now); @@ -868,7 +868,7 @@ void posix_timer_set_common(struct k_iti timer->it_interval = 0; /* Prevent reloading in case there is a signal pending */ - timer->it_requeue_pending = (timer->it_requeue_pending + 2) & ~REQUEUE_PENDING; + timer->it_signal_seq = (timer->it_signal_seq + 2) & ~REQUEUE_PENDING; /* Reset overrun accounting */ timer->it_overrun_last = 0; timer->it_overrun = -1LL;