Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\sched\cputime.c Create Date:2022-07-28 09:37:35
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Account a single tick of CPU time.*@p: the process that the CPU time gets accounted to*@user_tick: indicates if the tick is a user or a system tick

Proto:void account_process_tick(struct task_struct *p, int user_tick)

Type:void

Parameter:

TypeParameterName
struct task_struct *p
intuser_tick
476  rq = this_rq()
478  If vtime_accounting_enabled_this_cpu() Then Return
481  If SPDX-License-Identifier: GPL-2.0-only Then
482  irqtime_account_process_tick(p, user_tick, rq, 1)
483  Return
486  cputime = TICK_NSEC is the time between ticks in nsec assuming SHIFTED_HZ
487  steal = When a guest is interrupted for a longer amount of time, missed clock* ticks are not redelivered later. Due to that, this function may on* occasion account more time than the calling functions think elapsed.
489  If steal >= cputime Then Return
492  cputime -= steal
494  If user_tick Then Account user CPU time to a process.*@p: the process that the CPU time gets accounted to*@cputime: the CPU time spent in user space since the last update
496  Else if p != idle || irq_count() != HARDIRQ_OFFSET Then Account system CPU time to a process.*@p: the process that the CPU time gets accounted to*@hardirq_offset: the offset to subtract from hardirq_count()*@cputime: the CPU time spent in kernel space since the last update
498  Else Account for idle time.*@cputime: the CPU time spent in idle wait
Caller
NameDescribe
update_process_timesCalled from the timer interrupt handler to charge one tick to the current* process. user_tick is 1 if the tick is user time, 0 for system.