svn commit: r255729 - in stable/9/sys: kern sys

Konstantin Belousov kib at FreeBSD.org
Fri Sep 20 07:45:38 UTC 2013


Author: kib
Date: Fri Sep 20 07:45:37 2013
New Revision: 255729
URL: http://svnweb.freebsd.org/changeset/base/255729

Log:
  MFC r255527:
  Use TAILQ instead of STAILQ for kqeueue filedescriptors to ensure constant
  time removal on kqueue close.

Modified:
  stable/9/sys/kern/kern_event.c
  stable/9/sys/sys/event.h
  stable/9/sys/sys/eventvar.h
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/sys/   (props changed)

Modified: stable/9/sys/kern/kern_event.c
==============================================================================
--- stable/9/sys/kern/kern_event.c	Fri Sep 20 07:35:08 2013	(r255728)
+++ stable/9/sys/kern/kern_event.c	Fri Sep 20 07:45:37 2013	(r255729)
@@ -707,7 +707,7 @@ sys_kqueue(struct thread *td, struct kqu
 	TASK_INIT(&kq->kq_task, 0, kqueue_task, kq);
 
 	FILEDESC_XLOCK(fdp);
-	SLIST_INSERT_HEAD(&fdp->fd_kqlist, kq, kq_list);
+	TAILQ_INSERT_HEAD(&fdp->fd_kqlist, kq, kq_list);
 	FILEDESC_XUNLOCK(fdp);
 
 	finit(fp, FREAD | FWRITE, DTYPE_KQUEUE, kq, &kqueueops);
@@ -1708,7 +1708,7 @@ kqueue_close(struct file *fp, struct thr
 	KQ_UNLOCK(kq);
 
 	FILEDESC_XLOCK(fdp);
-	SLIST_REMOVE(&fdp->fd_kqlist, kq, kqueue, kq_list);
+	TAILQ_REMOVE(&fdp->fd_kqlist, kq, kq_list);
 	FILEDESC_XUNLOCK(fdp);
 
 	seldrain(&kq->kq_sel);
@@ -2044,7 +2044,7 @@ knote_fdclose(struct thread *td, int fd)
 	 * We shouldn't have to worry about new kevents appearing on fd
 	 * since filedesc is locked.
 	 */
-	SLIST_FOREACH(kq, &fdp->fd_kqlist, kq_list) {
+	TAILQ_FOREACH(kq, &fdp->fd_kqlist, kq_list) {
 		KQ_LOCK(kq);
 
 again:

Modified: stable/9/sys/sys/event.h
==============================================================================
--- stable/9/sys/sys/event.h	Fri Sep 20 07:35:08 2013	(r255728)
+++ stable/9/sys/sys/event.h	Fri Sep 20 07:45:37 2013	(r255729)
@@ -134,7 +134,7 @@ struct kevent {
 struct knote;
 SLIST_HEAD(klist, knote);
 struct kqueue;
-SLIST_HEAD(kqlist, kqueue);
+TAILQ_HEAD(kqlist, kqueue);
 struct knlist {
 	struct	klist	kl_list;
 	void    (*kl_lock)(void *);	/* lock function */

Modified: stable/9/sys/sys/eventvar.h
==============================================================================
--- stable/9/sys/sys/eventvar.h	Fri Sep 20 07:35:08 2013	(r255728)
+++ stable/9/sys/sys/eventvar.h	Fri Sep 20 07:45:37 2013	(r255729)
@@ -41,7 +41,7 @@
 struct kqueue {
 	struct		mtx kq_lock;
 	int		kq_refcnt;
-	SLIST_ENTRY(kqueue)	kq_list;
+	TAILQ_ENTRY(kqueue)	kq_list;
 	TAILQ_HEAD(, knote)	kq_head;	/* list of pending event */
 	int		kq_count;		/* number of pending events */
 	struct		selinfo kq_sel;


More information about the svn-src-stable-9 mailing list