Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:sole_trylock_spinning - try to get console_lock by busy waiting* This allows to busy wait for the console_lock when the current* owner is running in specially marked sections. It means that* the current owner is running and cannot reschedule until it

Proto:static int console_trylock_spinning(void)

Type:int

Parameter:Nothing

1711  struct task_struct * owner = NULL
1713  bool spin = false
1716  If sole_trylock - try to lock the console system for exclusive use.* Try to acquire a lock which guarantees that the caller has exclusive* access to the console system and the console_drivers list.* returns 1 on success, and 0 on failure to acquire the lock. Then Return 1
1719  printk_safe_enter_irqsave(flags)
1721  raw_spin_lock( & console_owner_lock)
1722  owner = READ_ONCE(console_owner)
1723  waiter = READ_ONCE(console_waiter)
1724  If Not waiter && owner && owner != current process Then
1725  WRITE_ONCE(console_waiter, true)
1726  spin = true
1728  raw_spin_unlock( & console_owner_lock)
1739  If Not spin Then
1740  printk_safe_exit_irqrestore(flags)
1741  Return 0
1745  spin_acquire( & console_owner_dep_map, 0, 0, _THIS_IP_)
1747  When READ_ONCE(console_waiter) cycle
1748  cpu_relax()
1749  spin_release( & console_owner_dep_map, _THIS_IP_)
1751  printk_safe_exit_irqrestore(flags)
1758  mutex_acquire( & console_lock_dep_map, 0, 1, _THIS_IP_)
1760  Return 1
Caller
NameDescribe
vprintk_emit