Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 1 Apr 2014 21:47:22 +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: r264023 - in head/sys: cam/ctl dev/iscsi
Message-ID:  <201404012147.s31LlMsO099477@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: trasz
Date: Tue Apr  1 21:47:22 2014
New Revision: 264023
URL: http://svnweb.freebsd.org/changeset/base/264023

Log:
  Instead of "icltx" and "iclrx", use thread names with prefix from upper
  layer, so that one can see which side of the stack the threads are for.
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/sys/cam/ctl/ctl_frontend_iscsi.c
  head/sys/dev/iscsi/icl.c
  head/sys/dev/iscsi/icl.h
  head/sys/dev/iscsi/iscsi.c

Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c
==============================================================================
--- head/sys/cam/ctl/ctl_frontend_iscsi.c	Tue Apr  1 21:40:46 2014	(r264022)
+++ head/sys/cam/ctl/ctl_frontend_iscsi.c	Tue Apr  1 21:47:22 2014	(r264023)
@@ -1215,7 +1215,7 @@ cfiscsi_session_new(struct cfiscsi_softc
 	cv_init(&cs->cs_login_cv, "cfiscsi_login");
 #endif
 
-	cs->cs_conn = icl_conn_new(&cs->cs_lock);
+	cs->cs_conn = icl_conn_new("cfiscsi", &cs->cs_lock);
 	cs->cs_conn->ic_receive = cfiscsi_receive_callback;
 	cs->cs_conn->ic_error = cfiscsi_error_callback;
 	cs->cs_conn->ic_prv0 = cs;

Modified: head/sys/dev/iscsi/icl.c
==============================================================================
--- head/sys/dev/iscsi/icl.c	Tue Apr  1 21:40:46 2014	(r264022)
+++ head/sys/dev/iscsi/icl.c	Tue Apr  1 21:47:22 2014	(r264023)
@@ -974,7 +974,7 @@ icl_pdu_queue(struct icl_pdu *ip)
 }
 
 struct icl_conn *
-icl_conn_new(struct mtx *lock)
+icl_conn_new(const char *name, struct mtx *lock)
 {
 	struct icl_conn *ic;
 
@@ -990,6 +990,7 @@ icl_conn_new(struct mtx *lock)
 	refcount_init(&ic->ic_outstanding_pdus, 0);
 #endif
 	ic->ic_max_data_segment_length = ICL_MAX_DATA_SEGMENT_LENGTH;
+	ic->ic_name = name;
 
 	return (ic);
 }
@@ -1065,14 +1066,16 @@ icl_conn_start(struct icl_conn *ic)
 	/*
 	 * Start threads.
 	 */
-	error = kthread_add(icl_send_thread, ic, NULL, NULL, 0, 0, "icltx");
+	error = kthread_add(icl_send_thread, ic, NULL, NULL, 0, 0, "%stx",
+	    ic->ic_name);
 	if (error != 0) {
 		ICL_WARN("kthread_add(9) failed with error %d", error);
 		icl_conn_close(ic);
 		return (error);
 	}
 
-	error = kthread_add(icl_receive_thread, ic, NULL, NULL, 0, 0, "iclrx");
+	error = kthread_add(icl_receive_thread, ic, NULL, NULL, 0, 0, "%srx",
+	    ic->ic_name);
 	if (error != 0) {
 		ICL_WARN("kthread_add(9) failed with error %d", error);
 		icl_conn_close(ic);

Modified: head/sys/dev/iscsi/icl.h
==============================================================================
--- head/sys/dev/iscsi/icl.h	Tue Apr  1 21:40:46 2014	(r264022)
+++ head/sys/dev/iscsi/icl.h	Tue Apr  1 21:47:22 2014	(r264023)
@@ -92,6 +92,7 @@ struct icl_conn {
 	size_t			ic_max_data_segment_length;
 	bool			ic_disconnecting;
 	bool			ic_iser;
+	const char		*ic_name;
 
 	void			(*ic_receive)(struct icl_pdu *);
 	void			(*ic_error)(struct icl_conn *);
@@ -102,7 +103,7 @@ struct icl_conn {
 	void			*ic_prv0;
 };
 
-struct icl_conn		*icl_conn_new(struct mtx *lock);
+struct icl_conn		*icl_conn_new(const char *name, struct mtx *lock);
 void			icl_conn_free(struct icl_conn *ic);
 int			icl_conn_handoff(struct icl_conn *ic, int fd);
 void			icl_conn_shutdown(struct icl_conn *ic);

Modified: head/sys/dev/iscsi/iscsi.c
==============================================================================
--- head/sys/dev/iscsi/iscsi.c	Tue Apr  1 21:40:46 2014	(r264022)
+++ head/sys/dev/iscsi/iscsi.c	Tue Apr  1 21:47:22 2014	(r264023)
@@ -1641,7 +1641,7 @@ iscsi_ioctl_session_add(struct iscsi_sof
 		return (EBUSY);
 	}
 
-	is->is_conn = icl_conn_new(&is->is_lock);
+	is->is_conn = icl_conn_new("iscsi", &is->is_lock);
 	is->is_conn->ic_receive = iscsi_receive_callback;
 	is->is_conn->ic_error = iscsi_error_callback;
 	is->is_conn->ic_prv0 = is;



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