svn commit: r243851 - stable/9/sys/kern

Konstantin Belousov kib at FreeBSD.org
Tue Dec 4 00:57:12 UTC 2012


Author: kib
Date: Tue Dec  4 00:57:11 2012
New Revision: 243851
URL: http://svnweb.freebsd.org/changeset/base/243851

Log:
  MFC r243342:
  Schedule garbage collection run for the in-flight rights passed over
  the unix domain sockets to the next tick, coalescing the serial calls
  until the collection fires.

Modified:
  stable/9/sys/kern/uipc_usrreq.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/kern/uipc_usrreq.c
==============================================================================
--- stable/9/sys/kern/uipc_usrreq.c	Tue Dec  4 00:54:49 2012	(r243850)
+++ stable/9/sys/kern/uipc_usrreq.c	Tue Dec  4 00:57:11 2012	(r243851)
@@ -131,7 +131,7 @@ static const struct sockaddr	sun_noname 
  * reentrance in the UNIX domain socket, file descriptor, and socket layer
  * code.  See unp_gc() for a full description.
  */
-static struct task	unp_gc_task;
+static struct timeout_task unp_gc_task;
 
 /*
  * The close of unix domain sockets attached as SCM_RIGHTS is
@@ -681,7 +681,7 @@ uipc_detach(struct socket *so)
 		VFS_UNLOCK_GIANT(vfslocked);
 	}
 	if (local_unp_rights)
-		taskqueue_enqueue(taskqueue_thread, &unp_gc_task);
+		taskqueue_enqueue_timeout(taskqueue_thread, &unp_gc_task, -1);
 }
 
 static int
@@ -1801,7 +1801,7 @@ unp_init(void)
 	LIST_INIT(&unp_shead);
 	LIST_INIT(&unp_sphead);
 	SLIST_INIT(&unp_defers);
-	TASK_INIT(&unp_gc_task, 0, unp_gc, NULL);
+	TIMEOUT_TASK_INIT(taskqueue_thread, &unp_gc_task, 0, unp_gc, NULL);
 	TASK_INIT(&unp_defer_task, 0, unp_process_defers, NULL);
 	UNP_LINK_LOCK_INIT();
 	UNP_LIST_LOCK_INIT();


More information about the svn-src-all mailing list