Author: trasz
Date: Mon Sep 14 10:17:07 2020
New Revision: 365712
URL: https://svnweb.freebsd.org/changeset/base/365712

Log:
  Move td_softdep_cleanup() from userret() to ast(); it's infrequent
  at best.  The schedule_cleanup() function already sets TDF_ASTPENDING.
  
  Reviewed by:  kib, mckusick
  Tested by:    pho
  MFC after:    2 weeks
  Sponsored by: DARPA
  Differential Revision:        https://reviews.freebsd.org/D26375

Modified:
  head/sys/kern/subr_trap.c

Modified: head/sys/kern/subr_trap.c
==============================================================================
--- head/sys/kern/subr_trap.c   Mon Sep 14 10:14:03 2020        (r365711)
+++ head/sys/kern/subr_trap.c   Mon Sep 14 10:17:07 2020        (r365712)
@@ -134,9 +134,6 @@ userret(struct thread *td, struct trapframe *frame)
        KTRUSERRET(td);
 #endif
 
-       td_softdep_cleanup(td);
-       MPASS(td->td_su == NULL);
-
        /*
         * Charge system time if profiling.
         */
@@ -188,8 +185,6 @@ userret(struct thread *td, struct trapframe *frame)
            ("userret: Returning with preallocated vnode"));
        KASSERT((td->td_flags & (TDF_SBDRY | TDF_SEINTR | TDF_SERESTART)) == 0,
            ("userret: Returning with stop signals deferred"));
-       KASSERT(td->td_su == NULL,
-           ("userret: Returning with SU cleanup request not handled"));
        KASSERT(td->td_vslock_sz == 0,
            ("userret: Returning with vslock-wired space"));
 #ifdef VIMAGE
@@ -278,6 +273,9 @@ ast(struct trapframe *framep)
                        ktrcsw(0, 1, __func__);
 #endif
        }
+
+       td_softdep_cleanup(td);
+       MPASS(td->td_su == NULL);
 
        /*
         * If this thread tickled GEOM, we need to wait for the giggling to
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to