Loading mm/kmemleak.c +7 −5 Original line number Diff line number Diff line Loading @@ -1670,8 +1670,7 @@ static void start_scan_thread(void) } /* * Stop the automatic memory scanning thread. This function must be called * with the scan_mutex held. * Stop the automatic memory scanning thread. */ static void stop_scan_thread(void) { Loading Loading @@ -1934,12 +1933,15 @@ static void kmemleak_do_cleanup(struct work_struct *work) { stop_scan_thread(); mutex_lock(&scan_mutex); /* * Once the scan thread has stopped, it is safe to no longer track * object freeing. Ordering of the scan thread stopping and the memory * accesses below is guaranteed by the kthread_stop() function. * Once it is made sure that kmemleak_scan has stopped, it is safe to no * longer track object freeing. Ordering of the scan thread stopping and * the memory accesses below is guaranteed by the kthread_stop() * function. */ kmemleak_free_enabled = 0; mutex_unlock(&scan_mutex); if (!kmemleak_found_leaks) __kmemleak_do_cleanup(); Loading Loading
mm/kmemleak.c +7 −5 Original line number Diff line number Diff line Loading @@ -1670,8 +1670,7 @@ static void start_scan_thread(void) } /* * Stop the automatic memory scanning thread. This function must be called * with the scan_mutex held. * Stop the automatic memory scanning thread. */ static void stop_scan_thread(void) { Loading Loading @@ -1934,12 +1933,15 @@ static void kmemleak_do_cleanup(struct work_struct *work) { stop_scan_thread(); mutex_lock(&scan_mutex); /* * Once the scan thread has stopped, it is safe to no longer track * object freeing. Ordering of the scan thread stopping and the memory * accesses below is guaranteed by the kthread_stop() function. * Once it is made sure that kmemleak_scan has stopped, it is safe to no * longer track object freeing. Ordering of the scan thread stopping and * the memory accesses below is guaranteed by the kthread_stop() * function. */ kmemleak_free_enabled = 0; mutex_unlock(&scan_mutex); if (!kmemleak_found_leaks) __kmemleak_do_cleanup(); Loading