函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\sched\cpufreq_schedutil.c Create Date:2022-07-27 10:45:36
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:sugov_kthread_create

函数原型:static int sugov_kthread_create(struct sugov_policy *sg_policy)

返回类型:int

参数:

类型参数名称
struct sugov_policy *sg_policy
657  struct sched_attr attr = {size = sizeof(structsched_attr), sched_policy = SCHED_DEADLINE, sched_flags = !! For sched_setattr_nocheck() (kernel) only !!* This is actually gross. :(* It is used to make schedutil kworker(s) higher priority than SCHED_DEADLINE* tasks, but still be able to sleep. We need this on platforms that cannot, SCHED_NORMAL, SCHED_BATCH = 0, SCHED_FIFO, SCHED_RR = 0, SCHED_DEADLINE = 1000000, sched_deadline = 10000000, sched_period = 10000000, }
671  policy等于policy
675  如果fast_switch_enabled则返回:0
678  kthread_init_work( & work, sugov_work)
679  kthread_init_worker( & worker)
680  thread等于kthread_create - create a kthread on the current node*@threadfn: the function to run in the thread*@data: data pointer for @threadfn()*@namefmt: printf-style format string for the thread name*@arg(kthread_worker_fn - kthread function to process kthread_worker*@worker_ptr: pointer to initialized kthread_worker* This function implements the main cycle of kthread worker. It processes* work_list until it is stopped with kthread_stop(), & worker, "sugov:%d", Uniprocessor. Assume all masks are "1". )
683  如果是错误
684  打印错误信息("failed to create sugov thread: %ld\n", 错误)
685  返回:错误
688  ret等于sched_setattr_nocheck(thread, & attr)
689  如果ret
690  结束线程的运行
691  打印警告信息("%s: failed to set SCHED_DEADLINE\n", __func__)
692  返回:ret
695  thread等于thread
696  kthread_bind_mask(thread, Online + Offline CPUs )
697  init_irq_work( & The next fields are only needed if fast switch cannot be used: , sugov_irq_work)
698  mutex_init - initialize the mutex*@mutex: the mutex to be initialized* Initialize the mutex to unlocked state.* It is not allowed to initialize an already locked mutex.( & work_lock)
700  唤醒中断线程
702  返回:0
调用者
名称描述
sugov_init