You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
sched: Implement task_nice() as static inline function
As patch "sched: Move the priority specific bits into a new header file" exposes the priority related macros in linux/sched/prio.h, we don't have to implement task_nice() in kernel/sched/core.c any more. This patch implements it in linux/sched/sched.h as static inline function, saving the kernel stack and enhancing performance a bit. Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com> Cc: clark.williams@gmail.com Cc: rostedt@goodmis.org Cc: raistlin@linux.it Cc: juri.lelli@gmail.com Signed-off-by: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/1390878045-7096-1-git-send-email-yangds.fnst@cn.fujitsu.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
This commit is contained in:
committed by
Ingo Molnar
parent
6b6350f155
commit
d0ea026808
@@ -142,7 +142,7 @@ void account_user_time(struct task_struct *p, cputime_t cputime,
|
||||
p->utimescaled += cputime_scaled;
|
||||
account_group_user_time(p, cputime);
|
||||
|
||||
index = (TASK_NICE(p) > 0) ? CPUTIME_NICE : CPUTIME_USER;
|
||||
index = (task_nice(p) > 0) ? CPUTIME_NICE : CPUTIME_USER;
|
||||
|
||||
/* Add user time to cpustat. */
|
||||
task_group_account_field(p, index, (__force u64) cputime);
|
||||
@@ -169,7 +169,7 @@ static void account_guest_time(struct task_struct *p, cputime_t cputime,
|
||||
p->gtime += cputime;
|
||||
|
||||
/* Add guest time to cpustat. */
|
||||
if (TASK_NICE(p) > 0) {
|
||||
if (task_nice(p) > 0) {
|
||||
cpustat[CPUTIME_NICE] += (__force u64) cputime;
|
||||
cpustat[CPUTIME_GUEST_NICE] += (__force u64) cputime;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user