Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Lock torture writer kthread. Repeatedly acquires and releases* the lock, checking for duplicate acquisitions.

Proto:static int lock_torture_writer(void *arg)

Type:int

Parameter:

TypeParameterName
void *arg
620  lwsp = arg
621  static
623  VERBOSE_TOROUT_STRING("lock_torture_writer task started")
624  set_user_nice(current process, MAX_NICE)
626  Do
627  If (torture_random( & rand) & 0xfffff) == 0 Then schedule_timeout_uninterruptible(1)
630  task_boost( & rand)
631  writelock()
632  If WARN_ON_ONCE(lock_is_write_held) Then n_lock_fail++
634  lock_is_write_held = 1
635  If WARN_ON_ONCE(lock_is_read_held) Then n_lock_fail++
638  n_lock_acquired++
639  write_delay( & rand)
640  lock_is_write_held = 0
641  writeunlock()
643  Task stuttering, which forces load/no-load transitions.
644  When Not Is it time for the current torture test to stop? cycle
646  task_boost(NULL)
647  Each kthread must wait for kthread_should_stop() before returning from* its top-level function, otherwise segfaults ensue
648  Return 0