History

sched: Rename sched_info_{queued,dequeued}

For consistency, rename {queued,dequeued} to {enqueue,dequeue}.

Peter Zijlstra committed 5 years ago

Commit 4e29fb71 parent 4b7a08a2 files · +12 −12Browse files

Unified · Split

2 files
  1. kernel/sched/core.c +2 −2
  2. kernel/sched/stats.h +10 −10
kernel/sched/core.c+2−2
@@ -1595,7 +1595,7 @@ static inline void enqueue_task(struct rq *rq, struct task_struct *p, int flags) · 1594 unmodified lines
1595 update_rq_clock(rq);1595 update_rq_clock(rq);
1596 1596
1597 if (!(flags & ENQUEUE_RESTORE)) {1597 if (!(flags & ENQUEUE_RESTORE)) {
1598 sched_info_queued(rq, p);1598 sched_info_enqueue(rq, p);
1599 psi_enqueue(p, flags & ENQUEUE_WAKEUP);1599 psi_enqueue(p, flags & ENQUEUE_WAKEUP);
1600 }1600 }
1601 1601
@@ -1609,7 +1609,7 @@ static inline void dequeue_task(struct rq *rq, struct task_struct *p, int flags) · 7 unmodified lines
1609 update_rq_clock(rq);1609 update_rq_clock(rq);
1610 1610
1611 if (!(flags & DEQUEUE_SAVE)) {1611 if (!(flags & DEQUEUE_SAVE)) {
1612 sched_info_dequeued(rq, p);1612 sched_info_dequeue(rq, p);
1613 psi_dequeue(p, flags & DEQUEUE_SLEEP);1613 psi_dequeue(p, flags & DEQUEUE_SLEEP);
1614 }1614 }
1615 1615
kernel/sched/stats.h+10−10
@@ -25,7 +25,7 @@ rq_sched_info_depart(struct rq *rq, unsigned long long delta) · 24 unmodified lines
25}25}
26 26
27static inline void27static inline void
28rq_sched_info_dequeued(struct rq *rq, unsigned long long delta)28rq_sched_info_dequeue(struct rq *rq, unsigned long long delta)
29{29{
30 if (rq)30 if (rq)
31 rq->rq_sched_info.run_delay += delta;31 rq->rq_sched_info.run_delay += delta;
@@ -42,7 +42,7 @@ rq_sched_info_dequeued(struct rq *rq, unsigned long long delta) · 10 unmodified lines
42 42
43#else /* !CONFIG_SCHEDSTATS: */43#else /* !CONFIG_SCHEDSTATS: */
44static inline void rq_sched_info_arrive (struct rq *rq, unsigned long long delta) { }44static inline void rq_sched_info_arrive (struct rq *rq, unsigned long long delta) { }
45static inline void rq_sched_info_dequeued(struct rq *rq, unsigned long long delta) { }45static inline void rq_sched_info_dequeue(struct rq *rq, unsigned long long delta) { }
46static inline void rq_sched_info_depart (struct rq *rq, unsigned long long delta) { }46static inline void rq_sched_info_depart (struct rq *rq, unsigned long long delta) { }
47# define schedstat_enabled() 047# define schedstat_enabled() 0
48# define __schedstat_inc(var) do { } while (0)48# define __schedstat_inc(var) do { } while (0)
@@ -161,7 +161,7 @@ static inline void sched_info_reset_dequeued(struct task_struct *t) · 112 unmodified lines
161 * from dequeue_task() to account for possible rq->clock skew across CPUs. The161 * from dequeue_task() to account for possible rq->clock skew across CPUs. The
162 * delta taken on each CPU would annul the skew.162 * delta taken on each CPU would annul the skew.
163 */163 */
164static inline void sched_info_dequeued(struct rq *rq, struct task_struct *t)164static inline void sched_info_dequeue(struct rq *rq, struct task_struct *t)
165{165{
166 unsigned long long now = rq_clock(rq), delta = 0;166 unsigned long long now = rq_clock(rq), delta = 0;
167 167
@@ -172,7 +172,7 @@ static inline void sched_info_dequeued(struct rq *rq, struct task_struct *t) · 4 unmodified lines
172 sched_info_reset_dequeued(t);172 sched_info_reset_dequeued(t);
173 t->sched_info.run_delay += delta;173 t->sched_info.run_delay += delta;
174 174
175 rq_sched_info_dequeued(rq, delta);175 rq_sched_info_dequeue(rq, delta);
176}176}
177 177
178/*178/*
@@ -197,9 +197,9 @@ static void sched_info_arrive(struct rq *rq, struct task_struct *t) · 18 unmodified lines
197/*197/*
198 * This function is only called from enqueue_task(), but also only updates198 * This function is only called from enqueue_task(), but also only updates
199 * the timestamp if it is already not set. It's assumed that199 * the timestamp if it is already not set. It's assumed that
200 * sched_info_dequeued() will clear that stamp when appropriate.200 * sched_info_dequeue() will clear that stamp when appropriate.
201 */201 */
202static inline void sched_info_queued(struct rq *rq, struct task_struct *t)202static inline void sched_info_enqueue(struct rq *rq, struct task_struct *t)
203{203{
204 if (sched_info_on()) {204 if (sched_info_on()) {
205 if (!t->sched_info.last_queued)205 if (!t->sched_info.last_queued)
@@ -212,7 +212,7 @@ static inline void sched_info_queued(struct rq *rq, struct task_struct *t) · 6 unmodified lines
212 * due, typically, to expiring its time slice (this may also be called when212 * due, typically, to expiring its time slice (this may also be called when
213 * switching to the idle task). Now we can calculate how long we ran.213 * switching to the idle task). Now we can calculate how long we ran.
214 * Also, if the process is still in the TASK_RUNNING state, call214 * Also, if the process is still in the TASK_RUNNING state, call
215 * sched_info_queued() to mark that it has now again started waiting on215 * sched_info_enqueue() to mark that it has now again started waiting on
216 * the runqueue.216 * the runqueue.
217 */217 */
218static inline void sched_info_depart(struct rq *rq, struct task_struct *t)218static inline void sched_info_depart(struct rq *rq, struct task_struct *t)
@@ -222,7 +222,7 @@ static inline void sched_info_depart(struct rq *rq, struct task_struct *t) · 3 unmodified lines
222 rq_sched_info_depart(rq, delta);222 rq_sched_info_depart(rq, delta);
223 223
224 if (t->state == TASK_RUNNING)224 if (t->state == TASK_RUNNING)
225 sched_info_queued(rq, t);225 sched_info_enqueue(rq, t);
226}226}
227 227
228/*228/*
@@ -253,9 +253,9 @@ sched_info_switch(struct rq *rq, struct task_struct *prev, struct task_struct *n · 24 unmodified lines
253}253}
254 254
255#else /* !CONFIG_SCHED_INFO: */255#else /* !CONFIG_SCHED_INFO: */
256# define sched_info_queued(rq, t) do { } while (0)256# define sched_info_enqueue(rq, t) do { } while (0)
257# define sched_info_reset_dequeued(t) do { } while (0)257# define sched_info_reset_dequeued(t) do { } while (0)
258# define sched_info_dequeued(rq, t) do { } while (0)258# define sched_info_dequeue(rq, t) do { } while (0)
259# define sched_info_depart(rq, t) do { } while (0)259# define sched_info_depart(rq, t) do { } while (0)
260# define sched_info_arrive(rq, next) do { } while (0)260# define sched_info_arrive(rq, next) do { } while (0)
261# define sched_info_switch(rq, t, next) do { } while (0)261# define sched_info_switch(rq, t, next) do { } while (0)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t