Lines Matching refs:p
102 static inline void task_group_account_field(struct task_struct *p, int index, in task_group_account_field() argument
113 cgroup_account_cputime_field(p, index, tmp); in task_group_account_field()
121 void account_user_time(struct task_struct *p, u64 cputime) in account_user_time() argument
126 p->utime += cputime; in account_user_time()
127 account_group_user_time(p, cputime); in account_user_time()
129 index = (task_nice(p) > 0) ? CPUTIME_NICE : CPUTIME_USER; in account_user_time()
132 task_group_account_field(p, index, cputime); in account_user_time()
135 acct_account_cputime(p); in account_user_time()
143 void account_guest_time(struct task_struct *p, u64 cputime) in account_guest_time() argument
148 p->utime += cputime; in account_guest_time()
149 account_group_user_time(p, cputime); in account_guest_time()
150 p->gtime += cputime; in account_guest_time()
153 if (task_nice(p) > 0) { in account_guest_time()
154 task_group_account_field(p, CPUTIME_NICE, cputime); in account_guest_time()
157 task_group_account_field(p, CPUTIME_USER, cputime); in account_guest_time()
168 void account_system_index_time(struct task_struct *p, in account_system_index_time() argument
172 p->stime += cputime; in account_system_index_time()
173 account_group_system_time(p, cputime); in account_system_index_time()
176 task_group_account_field(p, index, cputime); in account_system_index_time()
179 acct_account_cputime(p); in account_system_index_time()
188 void account_system_time(struct task_struct *p, int hardirq_offset, u64 cputime) in account_system_time() argument
192 if ((p->flags & PF_VCPU) && (irq_count() - hardirq_offset == 0)) { in account_system_time()
193 account_guest_time(p, cputime); in account_system_time()
204 account_system_index_time(p, cputime, index); in account_system_time()
240 void __account_forceidle_time(struct task_struct *p, u64 delta) in __account_forceidle_time() argument
242 __schedstat_add(p->stats.core_forceidle_sum, delta); in __account_forceidle_time()
244 task_group_account_field(p, CPUTIME_FORCEIDLE, delta); in __account_forceidle_time()
376 static void irqtime_account_process_tick(struct task_struct *p, int user_tick, in irqtime_account_process_tick() argument
394 if (this_cpu_ksoftirqd() == p) { in irqtime_account_process_tick()
400 account_system_index_time(p, cputime, CPUTIME_SOFTIRQ); in irqtime_account_process_tick()
402 account_user_time(p, cputime); in irqtime_account_process_tick()
403 } else if (p == this_rq()->idle) { in irqtime_account_process_tick()
405 } else if (p->flags & PF_VCPU) { /* System time or guest time */ in irqtime_account_process_tick()
406 account_guest_time(p, cputime); in irqtime_account_process_tick()
408 account_system_index_time(p, cputime, CPUTIME_SYSTEM); in irqtime_account_process_tick()
418 static inline void irqtime_account_process_tick(struct task_struct *p, int user_tick, in irqtime_account_process_tick() argument
463 void task_cputime_adjusted(struct task_struct *p, u64 *ut, u64 *st) in task_cputime_adjusted() argument
465 *ut = p->utime; in task_cputime_adjusted()
466 *st = p->stime; in task_cputime_adjusted()
470 void thread_group_cputime_adjusted(struct task_struct *p, u64 *ut, u64 *st) in thread_group_cputime_adjusted() argument
474 thread_group_cputime(p, &cputime); in thread_group_cputime_adjusted()
487 void account_process_tick(struct task_struct *p, int user_tick) in account_process_tick() argument
495 irqtime_account_process_tick(p, user_tick, 1); in account_process_tick()
508 account_user_time(p, cputime); in account_process_tick()
509 else if ((p != this_rq()->idle) || (irq_count() != HARDIRQ_OFFSET)) in account_process_tick()
510 account_system_time(p, HARDIRQ_OFFSET, cputime); in account_process_tick()
636 void task_cputime_adjusted(struct task_struct *p, u64 *ut, u64 *st) in task_cputime_adjusted() argument
639 .sum_exec_runtime = p->se.sum_exec_runtime, in task_cputime_adjusted()
642 if (task_cputime(p, &cputime.utime, &cputime.stime)) in task_cputime_adjusted()
643 cputime.sum_exec_runtime = task_sched_runtime(p); in task_cputime_adjusted()
644 cputime_adjust(&cputime, &p->prev_cputime, ut, st); in task_cputime_adjusted()
648 void thread_group_cputime_adjusted(struct task_struct *p, u64 *ut, u64 *st) in thread_group_cputime_adjusted() argument
652 thread_group_cputime(p, &cputime); in thread_group_cputime_adjusted()
653 cputime_adjust(&cputime, &p->signal->prev_cputime, ut, st); in thread_group_cputime_adjusted()