DragonFly kernel List (threaded) for 2008-02
DragonFly BSD
DragonFly kernel List (threaded) for 2008-02
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Sync audio stutters


From: "Simon 'corecode' Schubert" <corecode@xxxxxxxxxxxx>
Date: Wed, 06 Feb 2008 14:34:15 +0100

Hey,

I'd like to commit this patch in a couple of days if nobody objects. I think this fixes the "audio stutters" on machines with a lot of memory.

cheers
  simon

Index: kern/vfs_mount.c
===================================================================
RCS file: /home/dcvs/src/sys/kern/vfs_mount.c,v
retrieving revision 1.30
diff -u -p -r1.30 vfs_mount.c
--- kern/vfs_mount.c    5 Jan 2008 14:02:38 -0000       1.30
+++ kern/vfs_mount.c    5 Feb 2008 01:18:21 -0000
@@ -906,6 +906,7 @@ vmntvnodescan(
        struct vnode *vp;
        int r = 0;
        int maxcount = 1000000;
+       int count = 0;

lwkt_gettoken(&ilock, &mntvnode_token);

@@ -981,12 +982,24 @@ vmntvnodescan(
                                break;
                }

+next:
+               /*
+                * Yield after some processing.  Depending on the number
+                * of vnodes, we might wind up running for a long time.
+                * Because threads are not preemptable, time critical
+                * userland processes might starve.  Give them a chance
+                * now and then.
+                */
+               if (++count == 10000) {
+                       lwkt_yield();
+                       count = 0;
+               }
+
                /*
                 * Iterate.  If the vnode was ripped out from under us
                 * info.vp will already point to the next vnode, otherwise
                 * we have to obtain the next valid vnode ourselves.
                 */
-next:
                if (info.vp == vp)
                        info.vp = TAILQ_NEXT(vp, v_nmntvnodes);
        }

--
Serve - BSD     +++  RENT this banner advert  +++    ASCII Ribbon   /"\
Work - Mac      +++  space for low €€€ NOW!1  +++      Campaign     \ /
Party Enjoy Relax   |   http://dragonflybsd.org      Against  HTML   \
Dude 2c 2 the max   !   http://golden-apple.biz       Mail + News   / \




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