Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Thread function performing automatic memory scanning. Unreferenced objects* at the end of a memory scan are reported but only the first time.

Proto:static int kmemleak_scan_thread(void *arg)

Type:int

Parameter:

TypeParameterName
void *arg
1551  first_run = IS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y' or 'm',* 0 otherwise.(CONFIG_DEBUG_KMEMLEAK_AUTO_SCAN)
1553  pr_info("Automatic memory scanning thread started\n")
1554  set_user_nice(current process, 10)
1559  If first_run Then
1560  timeout = msecs_to_jiffies: - convert milliseconds to jiffies*@m: time in milliseconds* conversion is done as follows:* - negative values mean 'infinite timeout' (MAX_JIFFY_OFFSET)* - 'too large' values [that would result in larger than
1561  first_run = 0
1562  When timeout && Not kthread_should_stop - should this kthread return now?* When someone calls kthread_stop() on your kthread, it will be woken* and this will return true. You should then return, and your return* value will be passed through to kthread_stop(). cycle
1563  timeout = We can use __set_current_state() here because schedule_timeout() calls* schedule() unconditionally.
1566  When Not kthread_should_stop - should this kthread return now?* When someone calls kthread_stop() on your kthread, it will be woken* and this will return true. You should then return, and your return* value will be passed through to kthread_stop(). cycle
1567  timeout = delay between automatic memory scannings
1569  mutex_lock( & protects the memory scanning, parameters and debug/kmemleak file access )
1570  Scan data sections and all the referenced memory blocks allocated via the* kernel's standard allocators. This function must be called with the* scan_mutex held.
1571  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
1574  When timeout && Not kthread_should_stop - should this kthread return now?* When someone calls kthread_stop() on your kthread, it will be woken* and this will return true. You should then return, and your return* value will be passed through to kthread_stop(). cycle
1575  timeout = We can use __set_current_state() here because schedule_timeout() calls* schedule() unconditionally.
1578  pr_info("Automatic memory scanning thread ended\n")
1580  Return 0