From: Thomas Gleixner <tglx@linutronix.de>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Anna-Maria Behnsen <anna-maria@linutronix.de>,
Frederic Weisbecker <frederic@kernel.org>,
Benjamin Segall <bsegall@google.com>,
Eric Dumazet <edumazet@google.com>,
Andrey Vagin <avagin@openvz.org>,
Pavel Tikhomirov <ptikhomirov@virtuozzo.com>,
Peter Zijlstra <peterz@infradead.org>
Subject: [patch 04/11] posix-timers: Remove pointless unlock_timer() wrapper
Date: Mon, 24 Feb 2025 11:15:28 +0100 (CET) [thread overview]
Message-ID: <20250224101343.211872476@linutronix.de> (raw)
In-Reply-To: 20250224095736.145530367@linutronix.de
It's just a wrapper around spin_unlock_irqrestore() with zero value.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
kernel/time/posix-timers.c | 15 +++++----------
1 file changed, 5 insertions(+), 10 deletions(-)
--- a/kernel/time/posix-timers.c
+++ b/kernel/time/posix-timers.c
@@ -144,11 +144,6 @@ static int posix_timer_add(struct k_itim
return -EAGAIN;
}
-static inline void unlock_timer(struct k_itimer *timr, unsigned long flags)
-{
- spin_unlock_irqrestore(&timr->it_lock, flags);
-}
-
static int posix_get_realtime_timespec(clockid_t which_clock, struct timespec64 *tp)
{
ktime_get_real_ts64(tp);
@@ -691,7 +686,7 @@ static int do_timer_gettime(timer_t time
else
kc->timer_get(timr, setting);
- unlock_timer(timr, flags);
+ spin_unlock_irqrestore(&timr->it_lock, flags);
return ret;
}
@@ -755,7 +750,7 @@ SYSCALL_DEFINE1(timer_getoverrun, timer_
return -EINVAL;
overrun = timer_overrun_to_int(timr);
- unlock_timer(timr, flags);
+ spin_unlock_irqrestore(&timr->it_lock, flags);
return overrun;
}
@@ -822,7 +817,7 @@ static struct k_itimer *timer_wait_runni
/* Prevent kfree(timer) after dropping the lock */
rcu_read_lock();
- unlock_timer(timer, *flags);
+ spin_unlock_irqrestore(&timer->it_lock, *flags);
/*
* kc->timer_wait_running() might drop RCU lock. So @timer
@@ -928,7 +923,7 @@ static int do_timer_settime(timer_t time
timr = timer_wait_running(timr, &flags);
goto retry;
}
- unlock_timer(timr, flags);
+ spin_unlock_irqrestore(&timr->it_lock, flags);
return error;
}
@@ -1046,7 +1041,7 @@ SYSCALL_DEFINE1(timer_delete, timer_t, t
WRITE_ONCE(timer->it_signal, NULL);
spin_unlock(¤t->sighand->siglock);
- unlock_timer(timer, flags);
+ spin_unlock_irqrestore(&timer->it_lock, flags);
posix_timer_unhash_and_free(timer);
return 0;
}
next prev parent reply other threads:[~2025-02-24 10:15 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-24 10:15 [patch 00/11] posix-timers: Rework the global hash table and provide a sane mechanism for CRIU Thomas Gleixner
2025-02-24 10:15 ` [patch 01/11] posix-timers: Initialise timer before adding it to the hash table Thomas Gleixner
2025-02-24 10:15 ` [patch 02/11] posix-timers: Add cond_resched() to posix_timer_add() search loop Thomas Gleixner
2025-02-24 10:15 ` [patch 03/11] posix-timers: Cleanup includes Thomas Gleixner
2025-02-24 10:15 ` Thomas Gleixner [this message]
2025-02-24 16:21 ` [patch 04/11] posix-timers: Remove pointless unlock_timer() wrapper Peter Zijlstra
2025-02-24 18:43 ` Thomas Gleixner
2025-02-24 21:55 ` Peter Zijlstra
2025-02-24 10:15 ` [patch 05/11] posix-timers: Rework timer removal Thomas Gleixner
2025-02-24 10:15 ` [patch 06/11] posix-timers: Make signal_struct::next_posix_timer_id an atomic_t Thomas Gleixner
2025-02-24 13:20 ` Peter Zijlstra
2025-02-24 13:34 ` Eric Dumazet
2025-02-24 19:38 ` Thomas Gleixner
2025-02-24 10:15 ` [patch 07/11] posix-timers: Improve hash table performance Thomas Gleixner
2025-02-24 19:45 ` Thomas Gleixner
2025-02-24 10:15 ` [patch 08/11] posix-timers: Make per process list RCU safe Thomas Gleixner
2025-02-24 10:15 ` [patch 09/11] posix-timers: Dont iterate /proc/$PID/timers with sighand::siglock held Thomas Gleixner
2025-02-24 10:15 ` [patch 10/11] posix-timers: Provide a mechanism to allocate a given timer ID Thomas Gleixner
2025-02-24 10:15 ` [patch 11/11] selftests/timers/posix-timers: Add a test for exact allocation mode Thomas Gleixner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250224101343.211872476@linutronix.de \
--to=tglx@linutronix.de \
--cc=anna-maria@linutronix.de \
--cc=avagin@openvz.org \
--cc=bsegall@google.com \
--cc=edumazet@google.com \
--cc=frederic@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=ptikhomirov@virtuozzo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox