Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/dtv IPL_VM -> IPL_SCHED to avoid taking kernel lock



details:   https://anonhg.NetBSD.org/src/rev/a67cda58678a
branches:  trunk
changeset: 331364:a67cda58678a
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Sat Aug 09 13:34:10 2014 +0000

description:
IPL_VM -> IPL_SCHED to avoid taking kernel lock

diffstat:

 sys/dev/dtv/dtv_demux.c   |   6 +++---
 sys/dev/dtv/dtv_device.c  |  10 +++++-----
 sys/dev/dtv/dtv_scatter.c |   9 +++------
 3 files changed, 11 insertions(+), 14 deletions(-)

diffs (99 lines):

diff -r 5147a612098d -r a67cda58678a sys/dev/dtv/dtv_demux.c
--- a/sys/dev/dtv/dtv_demux.c   Sat Aug 09 13:33:43 2014 +0000
+++ b/sys/dev/dtv/dtv_demux.c   Sat Aug 09 13:34:10 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dtv_demux.c,v 1.5 2013/10/17 21:23:05 christos Exp $ */
+/* $NetBSD: dtv_demux.c,v 1.6 2014/08/09 13:34:10 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2011 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -52,7 +52,7 @@
  */ 
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dtv_demux.c,v 1.5 2013/10/17 21:23:05 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dtv_demux.c,v 1.6 2014/08/09 13:34:10 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/types.h>
@@ -305,7 +305,7 @@
        /* Default operation mode is unconfigured */
        demux->dd_mode = DTV_DEMUX_MODE_NONE;
        selinit(&demux->dd_sel);
-       mutex_init(&demux->dd_lock, MUTEX_DEFAULT, IPL_VM);
+       mutex_init(&demux->dd_lock, MUTEX_DEFAULT, IPL_SCHED);
        cv_init(&demux->dd_section_cv, "dtvsec");
 
        error = fd_allocfile(&fp, &fd);
diff -r 5147a612098d -r a67cda58678a sys/dev/dtv/dtv_device.c
--- a/sys/dev/dtv/dtv_device.c  Sat Aug 09 13:33:43 2014 +0000
+++ b/sys/dev/dtv/dtv_device.c  Sat Aug 09 13:34:10 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dtv_device.c,v 1.10 2014/07/25 08:10:36 dholland Exp $ */
+/* $NetBSD: dtv_device.c,v 1.11 2014/08/09 13:34:10 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2011 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dtv_device.c,v 1.10 2014/07/25 08:10:36 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dtv_device.c,v 1.11 2014/08/09 13:34:10 jmcneill Exp $");
 
 #include <sys/types.h>
 #include <sys/conf.h>
@@ -106,8 +106,8 @@
        ds->ds_buf = NULL;
        SIMPLEQ_INIT(&ds->ds_ingress);
        SIMPLEQ_INIT(&ds->ds_egress);
-       mutex_init(&ds->ds_egress_lock, MUTEX_DEFAULT, IPL_VM);
-       mutex_init(&ds->ds_ingress_lock, MUTEX_DEFAULT, IPL_VM);
+       mutex_init(&ds->ds_egress_lock, MUTEX_DEFAULT, IPL_SCHED);
+       mutex_init(&ds->ds_ingress_lock, MUTEX_DEFAULT, IPL_SCHED);
        cv_init(&ds->ds_sample_cv, "dtv");
        selinit(&ds->ds_sel);
        dtv_scatter_buf_init(&ds->ds_data);
@@ -117,7 +117,7 @@
                return;
        }
 
-       mutex_init(&sc->sc_demux_lock, MUTEX_DEFAULT, IPL_VM);
+       mutex_init(&sc->sc_demux_lock, MUTEX_DEFAULT, IPL_SCHED);
        TAILQ_INIT(&sc->sc_demux_list);
        sc->sc_demux_runcnt = 0;
 
diff -r 5147a612098d -r a67cda58678a sys/dev/dtv/dtv_scatter.c
--- a/sys/dev/dtv/dtv_scatter.c Sat Aug 09 13:33:43 2014 +0000
+++ b/sys/dev/dtv/dtv_scatter.c Sat Aug 09 13:34:10 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dtv_scatter.c,v 1.1 2011/07/09 14:46:56 jmcneill Exp $ */
+/* $NetBSD: dtv_scatter.c,v 1.2 2014/08/09 13:34:10 jmcneill Exp $ */
 
 /*
  * Copyright (c) 2008 Patrick Mahoney <pat%polycrystal.org@localhost>
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dtv_scatter.c,v 1.1 2011/07/09 14:46:56 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dtv_scatter.c,v 1.2 2014/08/09 13:34:10 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/ioctl.h>
@@ -48,14 +48,11 @@
 
 #include <dev/dtv/dtvvar.h>
 
-#define IPL_DTV                IPL_VM
-#define spldtv()       splvm()
-
 void
 dtv_scatter_buf_init(struct dtv_scatter_buf *sb)
 {
        sb->sb_pool = pool_cache_init(PAGE_SIZE, 0, 0, 0,
-                                     "dtvscatter", NULL, IPL_DTV,
+                                     "dtvscatter", NULL, IPL_SCHED,
                                      NULL, NULL, NULL);
        sb->sb_size = 0;
        sb->sb_npages = 0;



Home | Main Index | Thread Index | Old Index