Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name: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

Proto:static int try_to_grab_pending(struct work_struct *work, bool is_dwork, unsigned long *flags)

Type:int

Parameter:

TypeParameterName
struct work_struct *work
boolis_dwork
unsigned long *flags
1235  local_irq_save( * flags)
1238  If is_dwork Then
1239  dwork = to_delayed_work(work)
1246  If Value is more likely to compile time(del_timer( & timer)) Then Return 1
1251  If Not 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). Then Return 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  If Not pool Then Go to fail
1263  spin_lock( & he pool lock )
1272  pwq = get_work_pwq(work)
1273  If pwq && I: the associated pool == pool Then
1274  debug_work_deactivate(work)
1283  If The first word is the work queue pointer and the flags rolled into* one(work) & WORK_STRUCT_DELAYED Then pwq_activate_delayed_work(work)
1286  list_del_init - deletes entry from list and reinitialize it.*@entry: the element to delete from the list.
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  spin_unlock( & he pool lock )
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  Return 1
1296  spin_unlock( & he pool lock )
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  If work_is_canceling(work) Then Return -ENOENT
1302  cpu_relax()
1303  Return -EAGAIN
Caller
NameDescribe
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