mirror of
https://github.com/opnsense/src.git
synced 2026-06-11 01:30:30 -04:00
lockprof: move panic check after inspecting the state
(cherry picked from commit e2ab16b1a6)
This commit is contained in:
parent
4ee784e4d8
commit
66eda48003
1 changed files with 6 additions and 5 deletions
|
|
@ -611,9 +611,6 @@ lock_profile_obtain_lock_success(struct lock_object *lo, bool spin,
|
|||
lo->lo_name, spin, is_spin);
|
||||
#endif
|
||||
|
||||
if (SCHEDULER_STOPPED())
|
||||
return;
|
||||
|
||||
/* don't reset the timer when/if recursing */
|
||||
if (!lock_prof_enable || (lo->lo_flags & LO_NOPROFILE))
|
||||
return;
|
||||
|
|
@ -621,6 +618,10 @@ lock_profile_obtain_lock_success(struct lock_object *lo, bool spin,
|
|||
return;
|
||||
if (spin && lock_prof_skipspin == 1)
|
||||
return;
|
||||
|
||||
if (SCHEDULER_STOPPED())
|
||||
return;
|
||||
|
||||
critical_enter();
|
||||
/* Recheck enabled now that we're in a critical section. */
|
||||
if (lock_prof_enable == 0)
|
||||
|
|
@ -686,13 +687,13 @@ lock_profile_release_lock(struct lock_object *lo, bool spin)
|
|||
lo->lo_name, spin, is_spin);
|
||||
#endif
|
||||
|
||||
if (SCHEDULER_STOPPED())
|
||||
return;
|
||||
if (lo->lo_flags & LO_NOPROFILE)
|
||||
return;
|
||||
head = &curthread->td_lprof[spin];
|
||||
if (LIST_FIRST(head) == NULL)
|
||||
return;
|
||||
if (SCHEDULER_STOPPED())
|
||||
return;
|
||||
critical_enter();
|
||||
/* Recheck enabled now that we're in a critical section. */
|
||||
if (lock_prof_enable == 0 && lock_prof_resetting == 1)
|
||||
|
|
|
|||
Loading…
Reference in a new issue