Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 14 Sep 2020 10:17:07 +0000 (UTC)
From:      Edward Tomasz Napierala <trasz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r365712 - head/sys/kern
Message-ID:  <202009141017.08EAH71R026857@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202009141017.08EAH71R026857>