PERFORCE change 165216 for review
John Baldwin
jhb at FreeBSD.org
Thu Jun 25 21:20:45 UTC 2009
http://perforce.freebsd.org/chv.cgi?CH=165216
Change 165216 by jhb at jhb_jhbbsd on 2009/06/25 21:20:32
IFC @165214
Affected files ...
.. //depot/projects/smpng/sys/amd64/amd64/intr_machdep.c#35 integrate
.. //depot/projects/smpng/sys/amd64/include/intr_machdep.h#20 integrate
.. //depot/projects/smpng/sys/dev/hwpmc/hwpmc_logging.c#13 integrate
.. //depot/projects/smpng/sys/dev/hwpmc/hwpmc_mod.c#30 integrate
.. //depot/projects/smpng/sys/i386/i386/intr_machdep.c#36 integrate
.. //depot/projects/smpng/sys/i386/include/intr_machdep.h#22 integrate
.. //depot/projects/smpng/sys/ufs/ufs/ufs_dirhash.c#33 integrate
Differences ...
==== //depot/projects/smpng/sys/amd64/amd64/intr_machdep.c#35 (text+ko) ====
@@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/sys/amd64/amd64/intr_machdep.c,v 1.43 2009/06/25 18:13:46 jhb Exp $
+ * $FreeBSD: src/sys/amd64/amd64/intr_machdep.c,v 1.44 2009/06/25 20:35:46 jhb Exp $
*/
/*
@@ -518,4 +518,14 @@
}
SYSINIT(intr_shuffle_irqs, SI_SUB_SMP, SI_ORDER_SECOND, intr_shuffle_irqs,
NULL);
+#else
+/*
+ * Always route interrupts to the current processor in the UP case.
+ */
+u_int
+intr_next_cpu(void)
+{
+
+ return (PCPU_GET(apic_id));
+}
#endif
==== //depot/projects/smpng/sys/amd64/include/intr_machdep.h#20 (text+ko) ====
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/sys/amd64/include/intr_machdep.h,v 1.22 2009/06/25 18:13:46 jhb Exp $
+ * $FreeBSD: src/sys/amd64/include/intr_machdep.h,v 1.23 2009/06/25 20:35:46 jhb Exp $
*/
#ifndef __MACHINE_INTR_MACHDEP_H__
@@ -152,9 +152,7 @@
int intr_config_intr(int vector, enum intr_trigger trig,
enum intr_polarity pol);
void intr_execute_handlers(struct intsrc *isrc, struct trapframe *frame);
-#ifdef SMP
u_int intr_next_cpu(void);
-#endif
struct intsrc *intr_lookup_source(int vector);
int intr_register_pic(struct pic *pic);
int intr_register_source(struct intsrc *isrc);
==== //depot/projects/smpng/sys/dev/hwpmc/hwpmc_logging.c#13 (text+ko) ====
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/hwpmc/hwpmc_logging.c,v 1.14 2008/12/15 14:41:55 jkoshy Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/hwpmc/hwpmc_logging.c,v 1.15 2009/06/25 20:59:37 attilio Exp $");
#include <sys/param.h>
#include <sys/file.h>
@@ -44,6 +44,7 @@
#include <sys/module.h>
#include <sys/mutex.h>
#include <sys/pmc.h>
+#include <sys/pmckern.h>
#include <sys/pmclog.h>
#include <sys/proc.h>
#include <sys/signalvar.h>
@@ -552,6 +553,12 @@
int error;
struct proc *p;
+ /*
+ * As long as it is possible to get a LOR between pmc_sx lock and
+ * proctree/allproc sx locks used for adding a new process, assure
+ * the former is not held here.
+ */
+ sx_assert(&pmc_sx, SA_UNLOCKED);
PMCDBG(LOG,CFG,1, "config po=%p logfd=%d", po, logfd);
p = po->po_owner;
==== //depot/projects/smpng/sys/dev/hwpmc/hwpmc_mod.c#30 (text+ko) ====
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/hwpmc/hwpmc_mod.c,v 1.42 2008/12/13 13:07:12 jkoshy Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/hwpmc/hwpmc_mod.c,v 1.43 2009/06/25 20:59:37 attilio Exp $");
#include <sys/param.h>
#include <sys/eventhandler.h>
@@ -2663,7 +2663,7 @@
static int
pmc_syscall_handler(struct thread *td, void *syscall_args)
{
- int error, is_sx_downgraded, op;
+ int error, is_sx_downgraded, is_sx_locked, op;
struct pmc_syscall_args *c;
void *arg;
@@ -2672,6 +2672,7 @@
DROP_GIANT();
is_sx_downgraded = 0;
+ is_sx_locked = 1;
c = (struct pmc_syscall_args *) syscall_args;
@@ -2720,9 +2721,11 @@
* a log file configured, flush its buffers and
* de-configure it.
*/
- if (cl.pm_logfd >= 0)
+ if (cl.pm_logfd >= 0) {
+ sx_xunlock(&pmc_sx);
+ is_sx_locked = 0;
error = pmclog_configure_log(md, po, cl.pm_logfd);
- else if (po->po_flags & PMC_PO_OWNS_LOGFILE) {
+ } else if (po->po_flags & PMC_PO_OWNS_LOGFILE) {
pmclog_process_closelog(po);
error = pmclog_flush(po);
if (error == 0) {
@@ -3772,10 +3775,12 @@
break;
}
- if (is_sx_downgraded)
- sx_sunlock(&pmc_sx);
- else
- sx_xunlock(&pmc_sx);
+ if (is_sx_locked != 0) {
+ if (is_sx_downgraded)
+ sx_sunlock(&pmc_sx);
+ else
+ sx_xunlock(&pmc_sx);
+ }
if (error)
atomic_add_int(&pmc_stats.pm_syscall_errors, 1);
==== //depot/projects/smpng/sys/i386/i386/intr_machdep.c#36 (text+ko) ====
@@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/sys/i386/i386/intr_machdep.c,v 1.39 2009/06/25 18:13:46 jhb Exp $
+ * $FreeBSD: src/sys/i386/i386/intr_machdep.c,v 1.40 2009/06/25 20:35:46 jhb Exp $
*/
/*
@@ -491,4 +491,14 @@
}
SYSINIT(intr_shuffle_irqs, SI_SUB_SMP, SI_ORDER_SECOND, intr_shuffle_irqs,
NULL);
+#else
+/*
+ * Always route interrupts to the current processor in the UP case.
+ */
+u_int
+intr_next_cpu(void)
+{
+
+ return (PCPU_GET(apic_id));
+}
#endif
==== //depot/projects/smpng/sys/i386/include/intr_machdep.h#22 (text+ko) ====
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/sys/i386/include/intr_machdep.h,v 1.23 2009/06/25 18:13:46 jhb Exp $
+ * $FreeBSD: src/sys/i386/include/intr_machdep.h,v 1.24 2009/06/25 20:35:46 jhb Exp $
*/
#ifndef __MACHINE_INTR_MACHDEP_H__
@@ -139,9 +139,7 @@
int intr_config_intr(int vector, enum intr_trigger trig,
enum intr_polarity pol);
void intr_execute_handlers(struct intsrc *isrc, struct trapframe *frame);
-#ifdef SMP
u_int intr_next_cpu(void);
-#endif
struct intsrc *intr_lookup_source(int vector);
int intr_register_pic(struct pic *pic);
int intr_register_source(struct intsrc *isrc);
==== //depot/projects/smpng/sys/ufs/ufs/ufs_dirhash.c#33 (text+ko) ====
@@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/ufs/ufs/ufs_dirhash.c,v 1.32 2009/06/17 18:55:29 snb Exp $");
+__FBSDID("$FreeBSD: src/sys/ufs/ufs/ufs_dirhash.c,v 1.33 2009/06/25 20:40:13 snb Exp $");
#include "opt_ufs.h"
@@ -348,9 +348,12 @@
int dirblocks, i, j, memreqd, nblocks, narrays, nslots, slot;
/* Take care of a decreased sysctl value. */
- while (ufs_dirhashmem > ufs_dirhashmaxmem)
+ while (ufs_dirhashmem > ufs_dirhashmaxmem) {
if (ufsdirhash_recycle(0) != 0)
return (-1);
+ /* Recycled enough memory, so unlock the list. */
+ DIRHASHLIST_UNLOCK();
+ }
/* Check if we can/should use dirhash. */
if (ip->i_size < ufs_mindirhashsize || OFSFMT(ip->i_vnode) ||
More information about the p4-projects
mailing list