函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\sched\core.c Create Date:2022-07-27 10:37:23
Last Modify:2022-05-22 13:40:38 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:sched_setaffinity

函数原型:long sched_setaffinity(pid_t pid, const struct cpumask *in_mask)

返回类型:long

参数:

类型参数名称
pid_tpid
const struct cpumask *in_mask
5406  _read_lock() - mark the beginning of an RCU read-side critical section* When synchronize_rcu() is invoked on one CPU while other CPUs* are within RCU read-side critical sections, then the* synchronize_rcu() is guaranteed to block until after all the other
5408  p等于d_process_by_pid - find a process with a matching PID value.*@pid: the pid in question.* The task of @pid, if found. %NULL otherwise.
5409  如果非p
5410  _read_unlock() - marks the end of an RCU read-side critical section.* In most situations, rcu_read_unlock() is immune from deadlock.* However, in kernels built with CONFIG_RCU_BOOST, rcu_read_unlock()
5411  返回:负ESRCH
5415  get_task_struct(p)
5416  _read_unlock() - marks the end of an RCU read-side critical section.* In most situations, rcu_read_unlock() is immune from deadlock.* However, in kernels built with CONFIG_RCU_BOOST, rcu_read_unlock()
5418  如果任务标志按位与Userland is not allowed to meddle with cpus_mask
5419  retval等于负EINVAL
5420  转到:out_put_task
5422  如果非分配CPU掩码
5423  retval等于负ENOMEM
5424  转到:out_put_task
5426  如果非分配CPU掩码
5427  retval等于负ENOMEM
5428  转到:out_free_cpus_allowed
5430  retval等于负EPERM
5431  如果非Check the target process has a UID that matches the current process's:
5432  _read_lock() - mark the beginning of an RCU read-side critical section* When synchronize_rcu() is invoked on one CPU while other CPUs* are within RCU read-side critical sections, then the* synchronize_rcu() is guaranteed to block until after all the other
5435  转到:out_free_new_mask
5437  _read_unlock() - marks the end of an RCU read-side critical section.* In most situations, rcu_read_unlock() is immune from deadlock.* However, in kernels built with CONFIG_RCU_BOOST, rcu_read_unlock()
5440  retval等于security_task_setscheduler(p)
5441  如果retval则转到:out_free_new_mask
5445  cpuset_cpus_allowed(p, cpus_allowed)
5446  pumask_and - *dstp = *src1p & *src2p*@dstp: the cpumask result*@src1p: the first input*@src2p: the second input* If *@dstp is empty, returns 0, else returns 1
5465  again :
5466  retval等于__set_cpus_allowed_ptr(p, new_mask, true)
5468  如果非retval
5469  cpuset_cpus_allowed(p, cpus_allowed)
5477  转到:again
5480  out_free_new_mask :
5481  释放CPU掩码
5482  out_free_cpus_allowed :
5483  释放CPU掩码
5484  out_put_task :
5485  put_task_struct(p)
5486  返回:retval
调用者
名称描述
SYSCALL_DEFINE3sys_sched_setaffinity - set the CPU affinity of a process*@pid: pid of the process*@len: length in bytes of the bitmask pointed to by user_mask_ptr*@user_mask_ptr: user-space pointer to the new CPU mask* Return: 0 on success. An error code otherwise.
rcutorture_sched_setaffinityGet rcutorture access to sched_setaffinity().
COMPAT_SYSCALL_DEFINE3
move_to_next_cpu
start_kthreadstart_kthread - Kick off the hardware latency sampling/detector kthread* This starts the kernel thread that will sit and sample the CPU timestamp* counter (TSC or similar) and look for potential hardware latencies.