Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 Jan 2020 03:35:57 +0000 (UTC)
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r356749 - head/sys/netgraph
Message-ID:  <202001150335.00F3ZvHn021825@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: glebius
Date: Wed Jan 15 03:35:57 2020
New Revision: 356749
URL: https://svnweb.freebsd.org/changeset/base/356749

Log:
  Netgraph queue processing thread must process all its items
  in the network epoch.
  
  Reported by:	Michael Zhilin <mizhka@ >

Modified:
  head/sys/netgraph/ng_base.c

Modified: head/sys/netgraph/ng_base.c
==============================================================================
--- head/sys/netgraph/ng_base.c	Wed Jan 15 03:34:21 2020	(r356748)
+++ head/sys/netgraph/ng_base.c	Wed Jan 15 03:35:57 2020	(r356749)
@@ -55,6 +55,7 @@
 #include <sys/malloc.h>
 #include <sys/mbuf.h>
 #include <sys/proc.h>
+#include <sys/epoch.h>
 #include <sys/queue.h>
 #include <sys/refcount.h>
 #include <sys/rwlock.h>
@@ -3398,6 +3399,7 @@ static void
 ngthread(void *arg)
 {
 	for (;;) {
+		struct epoch_tracker et;
 		node_p  node;
 
 		/* Get node from the worklist. */
@@ -3418,6 +3420,7 @@ ngthread(void *arg)
 		 * that lets us be sure that the node still exists.
 		 * Let the reference go at the last minute.
 		 */
+		NET_EPOCH_ENTER(et);
 		for (;;) {
 			item_p item;
 			int rw;
@@ -3435,6 +3438,7 @@ ngthread(void *arg)
 				NG_NODE_UNREF(node);
 			}
 		}
+		NET_EPOCH_EXIT(et);
 		NG_NODE_UNREF(node);
 		CURVNET_RESTORE();
 	}



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