From: "tip-bot2 for Anna-Maria Behnsen" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: "Anna-Maria Behnsen" <anna-maria@linutronix.de>,
Thomas Gleixner <tglx@linutronix.de>,
x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: timers/core] timers: Add struct member description for timer_base
Date: Mon, 19 Feb 2024 08:45:32 -0000 [thread overview]
Message-ID: <170833233296.398.7236151301975481128.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20240123164702.55612-5-anna-maria@linutronix.de>
The following commit has been merged into the timers/core branch of tip:
Commit-ID: 892abd357183bc663d6984d10c62f94b40bfc375
Gitweb: https://git.kernel.org/tip/892abd357183bc663d6984d10c62f94b40bfc375
Author: Anna-Maria Behnsen <anna-maria@linutronix.de>
AuthorDate: Tue, 23 Jan 2024 17:46:58 +01:00
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitterDate: Mon, 19 Feb 2024 09:38:00 +01:00
timers: Add struct member description for timer_base
timer_base struct lacks description of struct members. Important struct
member information is sprinkled in comments or in code all over the place.
Collect information and write struct description to keep track of most
important information in a single place.
Signed-off-by: Anna-Maria Behnsen <anna-maria@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20240123164702.55612-5-anna-maria@linutronix.de
---
kernel/time/timer.c | 45 ++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 45 insertions(+)
diff --git a/kernel/time/timer.c b/kernel/time/timer.c
index 352b161..d44dba1 100644
--- a/kernel/time/timer.c
+++ b/kernel/time/timer.c
@@ -196,6 +196,51 @@ EXPORT_SYMBOL(jiffies_64);
# define BASE_DEF 0
#endif
+/**
+ * struct timer_base - Per CPU timer base (number of base depends on config)
+ * @lock: Lock protecting the timer_base
+ * @running_timer: When expiring timers, the lock is dropped. To make
+ * sure not to race agains deleting/modifying a
+ * currently running timer, the pointer is set to the
+ * timer, which expires at the moment. If no timer is
+ * running, the pointer is NULL.
+ * @expiry_lock: PREEMPT_RT only: Lock is taken in softirq around
+ * timer expiry callback execution and when trying to
+ * delete a running timer and it wasn't successful in
+ * the first glance. It prevents priority inversion
+ * when callback was preempted on a remote CPU and a
+ * caller tries to delete the running timer. It also
+ * prevents a life lock, when the task which tries to
+ * delete a timer preempted the softirq thread which
+ * is running the timer callback function.
+ * @timer_waiters: PREEMPT_RT only: Tells, if there is a waiter
+ * waiting for the end of the timer callback function
+ * execution.
+ * @clk: clock of the timer base; is updated before enqueue
+ * of a timer; during expiry, it is 1 offset ahead of
+ * jiffies to avoid endless requeuing to current
+ * jiffies
+ * @next_expiry: expiry value of the first timer; it is updated when
+ * finding the next timer and during enqueue; the
+ * value is not valid, when next_expiry_recalc is set
+ * @cpu: Number of CPU the timer base belongs to
+ * @next_expiry_recalc: States, whether a recalculation of next_expiry is
+ * required. Value is set true, when a timer was
+ * deleted.
+ * @is_idle: Is set, when timer_base is idle. It is triggered by NOHZ
+ * code. This state is only used in standard
+ * base. Deferrable timers, which are enqueued remotely
+ * never wake up an idle CPU. So no matter of supporting it
+ * for this base.
+ * @timers_pending: Is set, when a timer is pending in the base. It is only
+ * reliable when next_expiry_recalc is not set.
+ * @pending_map: bitmap of the timer wheel; each bit reflects a
+ * bucket of the wheel. When a bit is set, at least a
+ * single timer is enqueued in the related bucket.
+ * @vectors: Array of lists; Each array member reflects a bucket
+ * of the timer wheel. The list contains all timers
+ * which are enqueued into a specific bucket.
+ */
struct timer_base {
raw_spinlock_t lock;
struct timer_list *running_timer;
next prev parent reply other threads:[~2024-02-19 8:45 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-23 16:46 [PATCH 0/8] timers and Documentation: Cleanup Anna-Maria Behnsen
2024-01-23 16:46 ` [PATCH 1/8] include/hrtimers: Move hrtimer base related definitions into hrtimer_defs Anna-Maria Behnsen
2024-01-25 8:17 ` Thomas Gleixner
2024-01-25 12:20 ` Anna-Maria Behnsen
2024-01-25 13:34 ` Thomas Gleixner
2024-02-19 8:45 ` [tip: timers/core] hrtimers: Move hrtimer base related definitions into hrtimer_defs.h tip-bot2 for Anna-Maria Behnsen
2024-01-23 16:46 ` [PATCH 2/8] hrtimers: Update formatting of documentation Anna-Maria Behnsen
2024-02-19 8:45 ` [tip: timers/core] " tip-bot2 for Anna-Maria Behnsen
2024-01-23 16:46 ` [PATCH 3/8] tick/sched: Add function description for tick_nohz_next_event() Anna-Maria Behnsen
2024-02-19 8:45 ` [tip: timers/core] " tip-bot2 for Anna-Maria Behnsen
2024-01-23 16:46 ` [PATCH 4/8] timers: Add struct member description for timer_base Anna-Maria Behnsen
2024-02-19 8:45 ` tip-bot2 for Anna-Maria Behnsen [this message]
2024-01-23 16:46 ` [PATCH 5/8] jiffies: Transform comment about time_* functions into DOC block Anna-Maria Behnsen
2024-02-19 8:45 ` [tip: timers/core] " tip-bot2 for Anna-Maria Behnsen
2024-01-23 16:47 ` [PATCH 6/8] Documentation: Create a new folder for all timer internals Anna-Maria Behnsen
2024-01-24 1:26 ` Randy Dunlap
2024-01-25 10:39 ` Anna-Maria Behnsen
2024-01-25 15:00 ` Jonathan Corbet
2024-01-25 15:27 ` Jani Nikula
2024-01-25 16:55 ` Anna-Maria Behnsen
2024-01-25 16:52 ` Anna-Maria Behnsen
2024-01-25 19:50 ` Jonathan Corbet
2024-01-29 13:21 ` Anna-Maria Behnsen
2024-01-23 16:47 ` [PATCH 7/8] Documentation: Move "core core" api into a separate file Anna-Maria Behnsen
2024-01-24 0:57 ` Randy Dunlap
2024-01-25 10:40 ` Anna-Maria Behnsen
2024-01-23 16:47 ` [PATCH 8/8] timers: Add timer wheel documentation Anna-Maria Behnsen
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=170833233296.398.7236151301975481128.tip-bot2@tip-bot2 \
--to=tip-bot2@linutronix.de \
--cc=anna-maria@linutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/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
all inboxes | Powered by JetHome®