Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 4 Dec 2012 00:57:12 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r243851 - stable/9/sys/kern
Message-ID:  <201212040057.qB40vCHQ002593@svn.freebsd.org>

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



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