函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:ry_to_grab_pending - steal work item from worklist and disable irq*@work: work item to steal*@is_dwork: @work is a delayed_work*@flags: place to store irq state* Try to grab PENDING bit of @work. This function can handle @work in any

函数原型:static int try_to_grab_pending(struct work_struct *work, bool is_dwork, unsigned long *flags)

返回类型:int

参数:

类型参数名称
struct work_struct *work
boolis_dwork
unsigned long *flags
1235  local_irq_save( * flags)
1238  如果is_dwork
1239  dwork等于to_delayed_work(work)
1246  如果此条件成立可能性大(为编译器优化)(del_timer( & timer))则返回:1
1251  如果非st_and_set_bit - Set a bit and return its old value*@nr: Bit to set*@addr: Address to count from* This is an atomic fully-ordered operation (implied full memory barrier).则返回:0
1254  _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
1259  pool等于get_work_pool - return the worker_pool a given work was associated with*@work: the work item of interest* Pools are created and destroyed under wq_pool_mutex, and allows read* access under RCU read lock. As such, this function should be
1260  如果非pool则转到:fail
1263  加自旋锁
1272  pwq等于get_work_pwq(work)
1273  如果pwqI: the associated pool 恒等于pool
1274  debug_work_deactivate(work)
1283  如果The first word is the work queue pointer and the flags rolled into* one(work)按位与WORK_STRUCT_DELAYEDpwq_activate_delayed_work(work)
1286  删除链表项并重新初始化
1287  pwq_dec_nr_in_flight - decrement pwq's nr_in_flight*@pwq: pwq of interest*@color: color of work which left the queue* A work either has completed or is removed from pending queue,* decrement nr_in_flight of its pwq and handle workqueue flushing.* CONTEXT:
1290  set_work_pool_and_keep_pending(work, I: pool ID )
1292  自旋锁解锁
1293  _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()
1294  返回:1
1296  自旋锁解锁
1297  fail :
1298  _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()
1299  local_irq_restore( * flags)
1300  如果work_is_canceling(work)则返回:负ENOENT
1302  cpu_relax()
1303  返回:负EAGAIN
调用者
名称描述
mod_delayed_work_onmod_delayed_work_on - modify delay of or queue a delayed work on specific CPU*@cpu: CPU number to execute work on*@wq: workqueue to use*@dwork: work to queue*@delay: number of jiffies to wait before queueing* If @dwork is idle, equivalent to
__cancel_work_timer
__cancel_work