Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:sugov_kthread_create

Proto:static int sugov_kthread_create(struct sugov_policy *sg_policy)

Type:int

Parameter:

TypeParameterName
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  If fast_switch_enabled Then Return 0
678  kthread_init_work( & work, sugov_work)
679  kthread_init_worker( & worker)
680  thread = Create kernel thread(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  If IS_ERR(thread) Then
684  pr_err("failed to create sugov thread: %ld\n", PTR_ERR(thread))
685  Return PTR_ERR(thread)
688  ret = sched_setattr_nocheck(thread, & attr)
689  If ret Then
690  stop a thread
691  pr_warn("%s: failed to set SCHED_DEADLINE\n", __func__)
692  Return 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  wake_up_process - Wake up a specific process*@p: The process to be woken up.* Attempt to wake up the nominated process and move it to the set of runnable* processes.* Return: 1 if the process was woken up, 0 if it was already running.
702  Return 0
Caller
NameDescribe
sugov_init