Commit ae04f69d authored by Qais Yousef's avatar Qais Yousef Committed by Peter Zijlstra
Browse files

sched/rt: Rename realtime_{prio, task}() to rt_or_dl_{prio, task}()



Some find the name realtime overloaded. Use rt_or_dl() as an
alternative, hopefully better, name.

Suggested-by: default avatarDaniel Bristot de Oliveira <bristot@redhat.com>
Signed-off-by: default avatarQais Yousef <qyousef@layalina.io>
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/20240610192018.1567075-4-qyousef@layalina.io
parent b166af3d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -335,7 +335,7 @@ static inline bool six_owner_running(struct six_lock *lock)
	 */
	rcu_read_lock();
	struct task_struct *owner = READ_ONCE(lock->owner);
	bool ret = owner ? owner_on_cpu(owner) : !realtime_task(current);
	bool ret = owner ? owner_on_cpu(owner) : !rt_or_dl_task(current);
	rcu_read_unlock();

	return ret;
+1 −1
Original line number Diff line number Diff line
@@ -82,7 +82,7 @@ u64 select_estimate_accuracy(struct timespec64 *tv)
	 * Realtime tasks get a slack of 0 for obvious reasons.
	 */

	if (realtime_task(current))
	if (rt_or_dl_task(current))
		return 0;

	ktime_get_ts64(&now);
+1 −1
Original line number Diff line number Diff line
@@ -40,7 +40,7 @@ static inline int task_nice_ioclass(struct task_struct *task)
{
	if (task->policy == SCHED_IDLE)
		return IOPRIO_CLASS_IDLE;
	else if (realtime_task_policy(task))
	else if (rt_or_dl_task_policy(task))
		return IOPRIO_CLASS_RT;
	else
		return IOPRIO_CLASS_BE;
+5 −5
Original line number Diff line number Diff line
@@ -11,7 +11,7 @@ static inline bool rt_prio(int prio)
	return unlikely(prio < MAX_RT_PRIO && prio >= MAX_DL_PRIO);
}

static inline bool realtime_prio(int prio)
static inline bool rt_or_dl_prio(int prio)
{
	return unlikely(prio < MAX_RT_PRIO);
}
@@ -27,19 +27,19 @@ static inline bool rt_task(struct task_struct *p)

/*
 * Returns true if a task has a priority that belongs to RT or DL classes.
 * PI-boosted tasks will return true. Use realtime_task_policy() to ignore
 * PI-boosted tasks will return true. Use rt_or_dl_task_policy() to ignore
 * PI-boosted tasks.
 */
static inline bool realtime_task(struct task_struct *p)
static inline bool rt_or_dl_task(struct task_struct *p)
{
	return realtime_prio(p->prio);
	return rt_or_dl_prio(p->prio);
}

/*
 * Returns true if a task has a policy that belongs to RT or DL classes.
 * PI-boosted tasks will return false.
 */
static inline bool realtime_task_policy(struct task_struct *tsk)
static inline bool rt_or_dl_task_policy(struct task_struct *tsk)
{
	int policy = tsk->policy;

+2 −2
Original line number Diff line number Diff line
@@ -347,7 +347,7 @@ static __always_inline int __waiter_prio(struct task_struct *task)
{
	int prio = task->prio;

	if (!realtime_prio(prio))
	if (!rt_or_dl_prio(prio))
		return DEFAULT_PRIO;

	return prio;
@@ -435,7 +435,7 @@ static inline bool rt_mutex_steal(struct rt_mutex_waiter *waiter,
	 * Note that RT tasks are excluded from same priority (lateral)
	 * steals to prevent the introduction of an unbounded latency.
	 */
	if (realtime_prio(waiter->tree.prio))
	if (rt_or_dl_prio(waiter->tree.prio))
		return false;

	return rt_waiter_node_equal(&waiter->tree, &top_waiter->tree);
Loading