diff options
author | Ingo Molnar <mingo@kernel.org> | 2018-03-03 08:01:12 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2018-03-03 09:50:21 -0500 |
commit | 97fb7a0a8944bd6d2c5634e1e0fa689a5c40bc22 (patch) | |
tree | 4993de40ba9dc0cf76d2233b8292a771d8c41941 /kernel/sched/cputime.c | |
parent | c2e513821d5df5e772287f6d0c23fd17b7c2bb1a (diff) |
sched: Clean up and harmonize the coding style of the scheduler code base
A good number of small style inconsistencies have accumulated
in the scheduler core, so do a pass over them to harmonize
all these details:
- fix speling in comments,
- use curly braces for multi-line statements,
- remove unnecessary parentheses from integer literals,
- capitalize consistently,
- remove stray newlines,
- add comments where necessary,
- remove invalid/unnecessary comments,
- align structure definitions and other data types vertically,
- add missing newlines for increased readability,
- fix vertical tabulation where it's misaligned,
- harmonize preprocessor conditional block labeling
and vertical alignment,
- remove line-breaks where they uglify the code,
- add newline after local variable definitions,
No change in functionality:
md5:
1191fa0a890cfa8132156d2959d7e9e2 built-in.o.before.asm
1191fa0a890cfa8132156d2959d7e9e2 built-in.o.after.asm
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/sched/cputime.c')
-rw-r--r-- | kernel/sched/cputime.c | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/kernel/sched/cputime.c b/kernel/sched/cputime.c index bac6ac9a4ec7..d3b450b57ade 100644 --- a/kernel/sched/cputime.c +++ b/kernel/sched/cputime.c | |||
@@ -113,9 +113,9 @@ static inline void task_group_account_field(struct task_struct *p, int index, | |||
113 | } | 113 | } |
114 | 114 | ||
115 | /* | 115 | /* |
116 | * Account user cpu time to a process. | 116 | * Account user CPU time to a process. |
117 | * @p: the process that the cpu time gets accounted to | 117 | * @p: the process that the CPU time gets accounted to |
118 | * @cputime: the cpu time spent in user space since the last update | 118 | * @cputime: the CPU time spent in user space since the last update |
119 | */ | 119 | */ |
120 | void account_user_time(struct task_struct *p, u64 cputime) | 120 | void account_user_time(struct task_struct *p, u64 cputime) |
121 | { | 121 | { |
@@ -135,9 +135,9 @@ void account_user_time(struct task_struct *p, u64 cputime) | |||
135 | } | 135 | } |
136 | 136 | ||
137 | /* | 137 | /* |
138 | * Account guest cpu time to a process. | 138 | * Account guest CPU time to a process. |
139 | * @p: the process that the cpu time gets accounted to | 139 | * @p: the process that the CPU time gets accounted to |
140 | * @cputime: the cpu time spent in virtual machine since the last update | 140 | * @cputime: the CPU time spent in virtual machine since the last update |
141 | */ | 141 | */ |
142 | void account_guest_time(struct task_struct *p, u64 cputime) | 142 | void account_guest_time(struct task_struct *p, u64 cputime) |
143 | { | 143 | { |
@@ -159,9 +159,9 @@ void account_guest_time(struct task_struct *p, u64 cputime) | |||
159 | } | 159 | } |
160 | 160 | ||
161 | /* | 161 | /* |
162 | * Account system cpu time to a process and desired cpustat field | 162 | * Account system CPU time to a process and desired cpustat field |
163 | * @p: the process that the cpu time gets accounted to | 163 | * @p: the process that the CPU time gets accounted to |
164 | * @cputime: the cpu time spent in kernel space since the last update | 164 | * @cputime: the CPU time spent in kernel space since the last update |
165 | * @index: pointer to cpustat field that has to be updated | 165 | * @index: pointer to cpustat field that has to be updated |
166 | */ | 166 | */ |
167 | void account_system_index_time(struct task_struct *p, | 167 | void account_system_index_time(struct task_struct *p, |
@@ -179,10 +179,10 @@ void account_system_index_time(struct task_struct *p, | |||
179 | } | 179 | } |
180 | 180 | ||
181 | /* | 181 | /* |
182 | * Account system cpu time to a process. | 182 | * Account system CPU time to a process. |
183 | * @p: the process that the cpu time gets accounted to | 183 | * @p: the process that the CPU time gets accounted to |
184 | * @hardirq_offset: the offset to subtract from hardirq_count() | 184 | * @hardirq_offset: the offset to subtract from hardirq_count() |
185 | * @cputime: the cpu time spent in kernel space since the last update | 185 | * @cputime: the CPU time spent in kernel space since the last update |
186 | */ | 186 | */ |
187 | void account_system_time(struct task_struct *p, int hardirq_offset, u64 cputime) | 187 | void account_system_time(struct task_struct *p, int hardirq_offset, u64 cputime) |
188 | { | 188 | { |
@@ -205,7 +205,7 @@ void account_system_time(struct task_struct *p, int hardirq_offset, u64 cputime) | |||
205 | 205 | ||
206 | /* | 206 | /* |
207 | * Account for involuntary wait time. | 207 | * Account for involuntary wait time. |
208 | * @cputime: the cpu time spent in involuntary wait | 208 | * @cputime: the CPU time spent in involuntary wait |
209 | */ | 209 | */ |
210 | void account_steal_time(u64 cputime) | 210 | void account_steal_time(u64 cputime) |
211 | { | 211 | { |
@@ -216,7 +216,7 @@ void account_steal_time(u64 cputime) | |||
216 | 216 | ||
217 | /* | 217 | /* |
218 | * Account for idle time. | 218 | * Account for idle time. |
219 | * @cputime: the cpu time spent in idle wait | 219 | * @cputime: the CPU time spent in idle wait |
220 | */ | 220 | */ |
221 | void account_idle_time(u64 cputime) | 221 | void account_idle_time(u64 cputime) |
222 | { | 222 | { |
@@ -338,7 +338,7 @@ void thread_group_cputime(struct task_struct *tsk, struct task_cputime *times) | |||
338 | #ifdef CONFIG_IRQ_TIME_ACCOUNTING | 338 | #ifdef CONFIG_IRQ_TIME_ACCOUNTING |
339 | /* | 339 | /* |
340 | * Account a tick to a process and cpustat | 340 | * Account a tick to a process and cpustat |
341 | * @p: the process that the cpu time gets accounted to | 341 | * @p: the process that the CPU time gets accounted to |
342 | * @user_tick: is the tick from userspace | 342 | * @user_tick: is the tick from userspace |
343 | * @rq: the pointer to rq | 343 | * @rq: the pointer to rq |
344 | * | 344 | * |
@@ -400,17 +400,16 @@ static void irqtime_account_idle_ticks(int ticks) | |||
400 | irqtime_account_process_tick(current, 0, rq, ticks); | 400 | irqtime_account_process_tick(current, 0, rq, ticks); |
401 | } | 401 | } |
402 | #else /* CONFIG_IRQ_TIME_ACCOUNTING */ | 402 | #else /* CONFIG_IRQ_TIME_ACCOUNTING */ |
403 | static inline void irqtime_account_idle_ticks(int ticks) {} | 403 | static inline void irqtime_account_idle_ticks(int ticks) { } |
404 | static inline void irqtime_account_process_tick(struct task_struct *p, int user_tick, | 404 | static inline void irqtime_account_process_tick(struct task_struct *p, int user_tick, |
405 | struct rq *rq, int nr_ticks) {} | 405 | struct rq *rq, int nr_ticks) { } |
406 | #endif /* CONFIG_IRQ_TIME_ACCOUNTING */ | 406 | #endif /* CONFIG_IRQ_TIME_ACCOUNTING */ |
407 | 407 | ||
408 | /* | 408 | /* |
409 | * Use precise platform statistics if available: | 409 | * Use precise platform statistics if available: |
410 | */ | 410 | */ |
411 | #ifdef CONFIG_VIRT_CPU_ACCOUNTING | 411 | #ifdef CONFIG_VIRT_CPU_ACCOUNTING |
412 | 412 | # ifndef __ARCH_HAS_VTIME_TASK_SWITCH | |
413 | #ifndef __ARCH_HAS_VTIME_TASK_SWITCH | ||
414 | void vtime_common_task_switch(struct task_struct *prev) | 413 | void vtime_common_task_switch(struct task_struct *prev) |
415 | { | 414 | { |
416 | if (is_idle_task(prev)) | 415 | if (is_idle_task(prev)) |
@@ -421,8 +420,7 @@ void vtime_common_task_switch(struct task_struct *prev) | |||
421 | vtime_flush(prev); | 420 | vtime_flush(prev); |
422 | arch_vtime_task_switch(prev); | 421 | arch_vtime_task_switch(prev); |
423 | } | 422 | } |
424 | #endif | 423 | # endif |
425 | |||
426 | #endif /* CONFIG_VIRT_CPU_ACCOUNTING */ | 424 | #endif /* CONFIG_VIRT_CPU_ACCOUNTING */ |
427 | 425 | ||
428 | 426 | ||
@@ -469,10 +467,12 @@ void thread_group_cputime_adjusted(struct task_struct *p, u64 *ut, u64 *st) | |||
469 | *ut = cputime.utime; | 467 | *ut = cputime.utime; |
470 | *st = cputime.stime; | 468 | *st = cputime.stime; |
471 | } | 469 | } |
472 | #else /* !CONFIG_VIRT_CPU_ACCOUNTING_NATIVE */ | 470 | |
471 | #else /* !CONFIG_VIRT_CPU_ACCOUNTING_NATIVE: */ | ||
472 | |||
473 | /* | 473 | /* |
474 | * Account a single tick of cpu time. | 474 | * Account a single tick of CPU time. |
475 | * @p: the process that the cpu time gets accounted to | 475 | * @p: the process that the CPU time gets accounted to |
476 | * @user_tick: indicates if the tick is a user or a system tick | 476 | * @user_tick: indicates if the tick is a user or a system tick |
477 | */ | 477 | */ |
478 | void account_process_tick(struct task_struct *p, int user_tick) | 478 | void account_process_tick(struct task_struct *p, int user_tick) |