Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 18 Sep 2012 00:43:15 +0000 (UTC)
From:      Attilio Rao <attilio@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r240624 - head/sys/sys
Message-ID:  <201209180043.q8I0hFHx012210@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: attilio
Date: Tue Sep 18 00:43:15 2012
New Revision: 240624
URL: http://svn.freebsd.org/changeset/base/240624

Log:
  Remove namespace pollution in _rmlock.h by defining rm_queue structure
  directly in _rmlock.h and then including it (and its dependencies)
  in pcpu.h. This leads to few _*.h headers to be included in pcpu.h
  but this is not considered a big deal.
  
  Really pc_rm_queue should be implemented as a dynamic member with
  DPCPU interface, but we really want to keep the read acquisition as
  fast as possible, so even the further pc_dynamic indirection should be
  avoided, and the pollution is dealt like this.
  
  Discussed with:	jhb
  MFC after:	1 week

Modified:
  head/sys/sys/_rmlock.h
  head/sys/sys/pcpu.h

Modified: head/sys/sys/_rmlock.h
==============================================================================
--- head/sys/sys/_rmlock.h	Mon Sep 17 23:24:45 2012	(r240623)
+++ head/sys/sys/_rmlock.h	Tue Sep 18 00:43:15 2012	(r240624)
@@ -32,17 +32,17 @@
 #ifndef _SYS__RMLOCK_H_
 #define	_SYS__RMLOCK_H_
 
-/* 
- * XXXUPS remove as soon as we have per cpu variable
- * linker sets and  can define rm_queue in _rm_lock.h
-*/
-#include <sys/pcpu.h>
 /*
  * Mostly reader/occasional writer lock.
  */
 
 LIST_HEAD(rmpriolist,rm_priotracker);
 
+struct rm_queue {
+	struct rm_queue	*volatile rmq_next;
+	struct rm_queue	*volatile rmq_prev;
+};
+
 struct rmlock {
 	struct lock_object lock_object; 
 	volatile cpuset_t rm_writecpus;

Modified: head/sys/sys/pcpu.h
==============================================================================
--- head/sys/sys/pcpu.h	Mon Sep 17 23:24:45 2012	(r240623)
+++ head/sys/sys/pcpu.h	Tue Sep 18 00:43:15 2012	(r240624)
@@ -38,7 +38,11 @@
 #endif
 
 #include <sys/_cpuset.h>
+#include <sys/_lock.h>
+#include <sys/_mutex.h>
+#include <sys/_sx.h>
 #include <sys/queue.h>
+#include <sys/_rmlock.h>
 #include <sys/vmmeter.h>
 #include <sys/resource.h>
 #include <machine/pcpu.h>
@@ -137,15 +141,6 @@ extern uintptr_t dpcpu_off[];
 
 #endif /* _KERNEL */
 
-/* 
- * XXXUPS remove as soon as we have per cpu variable
- * linker sets and can define rm_queue in _rm_lock.h
- */
-struct rm_queue {
-	struct rm_queue* volatile rmq_next;
-	struct rm_queue* volatile rmq_prev;
-};
-
 /*
  * This structure maps out the global data that needs to be kept on a
  * per-cpu basis.  The members are accessed via the PCPU_GET/SET/PTR
@@ -169,15 +164,7 @@ struct pcpu {
 	void		*pc_netisr;		/* netisr SWI cookie */
 	int		pc_dnweight;		/* vm_page_dontneed() */
 	int		pc_domain;		/* Memory domain. */
-
-	/*
-	 * Stuff for read mostly lock
-	 *
-	 * XXXUPS remove as soon as we have per cpu variable
-	 * linker sets.
-	 */
-	struct rm_queue	pc_rm_queue;
-
+	struct rm_queue	pc_rm_queue;		/* rmlock list of trackers */
 	uintptr_t	pc_dynamic;		/* Dynamic per-cpu data area */
 
 	/*



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