DragonFlyBSD bugtracker: Issues
https://bugs.dragonflybsd.org/
https://bugs.dragonflybsd.org/favicon.ico?1629395208
2015-02-12T10:55:25Z
DragonFlyBSD bugtracker
Redmine
DragonFlyBSD - Submit #2787 (Closed): [PATCH] kernel -- Remove unused hogticks global from kern_s...
https://bugs.dragonflybsd.org/issues/2787
2015-02-12T10:55:25Z
vsrinivas
vsrinivas@ops101.org
<p>hogticks was a global definition used in kern_synch.c:should_yield().<br />A thread that had remained running for more than hogticks would<br />return true for should_yield(). DragonFly has not used this global<br />for a long time.<br />---<br /> sys/kern/kern_synch.c | 4 ----<br /> sys/sys/proc.h | 1 <del><br /> 2 files changed, 5 deletions(</del>)</p>
<p>diff --git a/sys/kern/kern_synch.c b/sys/kern/kern_synch.c<br />index 9285e2a..6fd5434 100644<br />--- a/sys/kern/kern_synch.c<br />+++ b/sys/kern/kern_synch.c<br /><code>@ -66,7 +66,6 </code>@ TAILQ_HEAD(tslpque, thread);<br /> static void sched_setup (void *dummy);<br /> <abbr title="sched_setup, SI_SUB_KICK_SCHEDULER, SI_ORDER_FIRST, sched_setup, NULL">SYSINIT</abbr></p>
<p><del>int hogticks;<br /> int lbolt;<br /> void <strong>lbolt_syncer;<br /> int sched_quantum; /</strong> Roundrobin scheduling quantum in ticks. */<br /><code>@ -128,7 +127,6 </code>@ sysctl_kern_quantum(SYSCTL_HANDLER_ARGS)<br /> if (new_val < ustick)<br /> return (EINVAL);<br /> sched_quantum = new_val / ustick;<br /></del> hogticks = 2 * sched_quantum;<br /> return (0);<br /> }</p>
<p><code>@ -326,8 +324,6 </code>@ sleep_gdinit(globaldata_t gd)</p>
<pre><code>if (gd->gd_cpuid == 0) {<br /> sched_quantum = (hz + 24) / 25;<br />- hogticks = 2 * sched_quantum;<br /><del><br /> gd</del>>gd_tsleep_hash = slpque_cpu0;<br /> } else {<br /> gd->gd_tsleep_hash = kmalloc(sizeof(slpque_cpu0), <br />diff --git a/sys/sys/proc.h b/sys/sys/proc.h<br />index fe239b3..c326be5 100644<br />--- a/sys/sys/proc.h<br />+++ b/sys/sys/proc.h<br /><code>@ -498,7 +498,6 </code>@ extern void stopevent(struct proc*, unsigned int, unsigned int);<br /> extern struct proc proc0; /* Process slot for swapper. <strong>/<br /> extern struct lwp lwp0; /</strong> LWP slot for swapper. <strong>/<br /> extern struct thread thread0; /</strong> Thread slot for swapper. <strong>/<br /><del>extern int hogticks; /</strong> Limit on kernel cpu hogs. <strong>/<br /> extern int nprocs, maxproc; /</strong> Current and max number of procs. <strong>/<br /> extern int maxprocperuid; /</strong> Max procs per uid. <strong>/<br /> extern int sched_quantum; /</strong> Scheduling quantum in ticks */<br />-</del> <br />2.1.0</code></pre>
DragonFlyBSD - Submit #2786 (Closed): [PATCH] kernel -- Remove unused xwait headers.
https://bugs.dragonflybsd.org/issues/2786
2015-02-12T10:54:32Z
vsrinivas
vsrinivas@ops101.org
<p>xsleep/xwakeup were added to DragonFly in 2003 to replace asleep/awakeup from<br />FreeBSD 4.x. tsleep & wakeup sleep on untyped identifiers; the sleep routines<br />do not store through the identifiers and treat them as opaque. xsleep/xwakeup<br />in contrast slept on explicit sleep structures, 'struct xwait'.</p>
<p>xsleep / xwakeup were never used; they were born #if-0ed out and were removed<br />by 2004. This commit removes a legacy declaration and associated header.<br />---<br /> sys/kern/kern_synch.c | 1 <del><br /> sys/sys/systm.h | 1 -<br /> sys/sys/xwait.h | 32 -------------------------------</del><br /> 3 files changed, 34 deletions(-)<br /> delete mode 100644 sys/sys/xwait.h</p>
<p>diff --git a/sys/kern/kern_synch.c b/sys/kern/kern_synch.c<br />index 59aa363..9285e2a 100644<br />--- a/sys/kern/kern_synch.c<br />+++ b/sys/kern/kern_synch.c<br /><code>@ -50,7 +50,6 </code>@<br /> #ifdef KTRACE<br /> #include <sys/ktrace.h><br /> #endif<br />-#include <sys/xwait.h><br /> #include <sys/ktr.h><br /> #include <sys/serialize.h></p>
<p>diff --git a/sys/sys/systm.h b/sys/sys/systm.h<br />index dfcdd80..ddd3dc1 100644<br />--- a/sys/sys/systm.h<br />+<ins>+ b/sys/sys/systm.h<br /><code>@ -128,7 +128,6 </code>@ struct mtx;<br /> struct lwkt_serialize;<br /> struct malloc_type;<br /> struct proc;<br /><del>struct xwait;<br /> struct timeval;<br /> struct tty;<br /> struct uio;<br />diff --git a/sys/sys/xwait.h b/sys/sys/xwait.h<br />deleted file mode 100644<br />index b392a0f..0000000<br />--</del> a/sys/sys/xwait.h<br /></ins>++ /dev/null<br /><code>@ -1,32 +0,0 </code>@<br /><del>/*<br /></del> * SYS/XWAIT.H<br />- <strong><br />- * $DragonFly: src/sys/sys/xwait.h,v 1.2 2006/05/20 02:42:13 dillon Exp $<br />- */<br /><del><br /></del>#ifndef <em>SYS_XWAIT_H</em><br /><del>#define <em>SYS_XWAIT_H</em><br /></del><br /><del>#ifndef <em>SYS_QUEUE_H</em><br /></del>#include <sys/queue.h><br /><del>#endif<br /></del><br /><del>struct proc;<br /></del><br /><del>/</strong><br /></del> * XWAIT structure for xsleep()/xwakeup()<br />- */<br /><del><br />-struct xwait {<br /></del> int gen;<br />- TAILQ_HEAD(,proc) waitq;<br /><del>};<br /></del><br /><del>static __inline void<br />-xupdate_gen(struct xwait *w)<br /></del>{<br />- ++w->gen;<br /><del>}<br /></del><br /><del>#endif<br /></del><br />-- <br />2.1.0</p>
DragonFlyBSD - Bug #2567 (Closed): Downloads web page link needs to be updated for 3.4.2
https://bugs.dragonflybsd.org/issues/2567
2013-06-06T17:34:51Z
vsrinivas
vsrinivas@ops101.org
<p>DragonFly BSD 3.4.2 was released; the downloads page needs to be updated to link to the 3.4.2 ISOs/Images.</p>
DragonFlyBSD - Bug #2490 (New): nmalloc should color addresses to avoid cache bank conflictsw
https://bugs.dragonflybsd.org/issues/2490
2013-01-16T07:38:34Z
vsrinivas
vsrinivas@ops101.org
<p>nmalloc returns addresses without regard as to whether those addresses<br />will result in cache bank conflicts; cache bank conflicts will result<br />in wasting a fair amount of a CPU's load bandwidth, as seen in the<br />Himeno matrix benchmark, among others.</p>
<p>commit 8120f5e2a46e669c06a7afdd7de60fa6d6996f9d added simple cache<br />coloring to nmalloc for 32KB allocations, offsetting them by 4KB. While<br />it does work (and restores Himeno's performance), it can be substantially<br />improved on. We should look at doing so.</p>
<p>-- vs;</p>
DragonFlyBSD - Bug #2489 (New): nmalloc doesn't cache VA for allocations > 8KB
https://bugs.dragonflybsd.org/issues/2489
2013-01-16T01:00:42Z
vsrinivas
vsrinivas@ops101.org
<p>Recently x86-64's default C library allocator was switched back to nmalloc<br />from dmalloc for fragmentation concerns exposed by xulrunner. nmalloc doesn't<br />cache address space in userland for buffers larger than 8KB, which mean<br />hitting mmap allocations for any of those requests. Some limited form of<br />VA caching should improve performance in general and mitigate some-to-all<br />of the performance hit going back from dmalloc to nmalloc.</p>
<p>-- vs;</p>
DragonFlyBSD - Bug #2488 (Closed): dumpsys onto virtio-blk fails
https://bugs.dragonflybsd.org/issues/2488
2013-01-15T23:16:28Z
vsrinivas
vsrinivas@ops101.org
<p>When attempting to dump a kernel core onto a virtio-blk disk, dumpsys itself<br />panics in virtio-blk.</p>
<p>It appears that vtblk_write_dump and vtblk_flush_dump are incorrectly<br />setting up a bio and bp for vtblk_poll_request.</p>
<p>-- vs;</p>
DragonFlyBSD - Bug #2487 (Closed): ddb/panic on x86-64 doesn't resolve symbols
https://bugs.dragonflybsd.org/issues/2487
2013-01-15T22:53:55Z
vsrinivas
vsrinivas@ops101.org
<p>When a system panics, ddb prints a backtrace; on x86-64, ddb's symbol<br />resolution prints garbage symbols.</p>
<p>-- vs;</p>
DragonFlyBSD - Submit #2477 (Closed): virtio & virtio-blk Driver import
https://bugs.dragonflybsd.org/issues/2477
2012-12-24T19:20:27Z
vsrinivas
vsrinivas@ops101.org
<p>-- vs;</p>
DragonFlyBSD - Submit #2470 (Closed): [PATCH] kernel -- ffs: Move inode hash to per-mount structure.
https://bugs.dragonflybsd.org/issues/2470
2012-12-10T20:02:10Z
vsrinivas
vsrinivas@ops101.org
<p>FFS uses a hash table to map inode number to per-inode data. The<br />hash table was global, rather than per-mount, and was keyed off of<br />(inode number, per-mount device minor number). This patch converts<br />it to a per-mount table, sychronized by the per-mount token.<br />---<br /> sys/vfs/ufs/ffs_alloc.c | 8 +<ins>+--<br /> sys/vfs/ufs/ffs_softdep.c | 7 +</ins>+--<br /> sys/vfs/ufs/ffs_vfsops.c | 24 +<ins>++</ins>+--------<br /> sys/vfs/ufs/ufs_extern.h | 14 +<ins>++-----<br /> sys/vfs/ufs/ufs_ihash.c | 80 +</ins>+++++++++++++++------------------------------<br /> sys/vfs/ufs/ufs_inode.c | 5 +<ins>-<br /> sys/vfs/ufs/ufs_vfsops.c | 1 <del><br /> sys/vfs/ufs/ufsmount.h | 11 +</ins>----</del><br /> 8 files changed, 64 insertions(+), 86 deletions(-)</p>
<p>diff --git a/sys/vfs/ufs/ffs_alloc.c b/sys/vfs/ufs/ffs_alloc.c<br />index afcde72..5a1f8f8 100644<br />--- a/sys/vfs/ufs/ffs_alloc.c<br />+++ b/sys/vfs/ufs/ffs_alloc.c<br /><code>@ -1354,6 +1354,7 </code>@ fail:<br /> static ino_t<br /> ffs_nodealloccg(struct inode *ip, int cg, ufs_daddr_t ipref, int mode)
{<br />+ struct ufsmount *ump;<br /> struct fs *fs;<br /> struct cg *cgp;<br /> struct buf *bp;<br /><code>@ -1362,7 +1363,10 </code>@ ffs_nodealloccg(struct inode *ip, int cg, ufs_daddr_t ipref, int mode)<br /> int error, len, arraysize, i;<br /> int icheckmiss;<br /> ufs_daddr_t ibase;<br />+ struct vnode *vp;</p>
<p>+ vp = <abbr title="ip">ITOV</abbr>;<br />+ ump = <abbr title="vp->v_mount">VFSTOUFS</abbr>;<br /> fs = ip->i_fs;<br /> if (fs->fs_cs(fs, cg).cs_nifree == 0)<br /> return (0);<br /><code>@ -1388,7 +1392,7 </code>@ ffs_nodealloccg(struct inode *ip, int cg, ufs_daddr_t ipref, int mode)<br /> if (ipref) {<br /> ipref %= fs->fs_ipg;<br /> if (isclr(inosused, ipref)) {<br />- if (ufs_ihashcheck(ip->i_dev, ibase + ipref) 0)<br />+ if (ufs_ihashcheck(ump, ip->i_dev, ibase + ipref) 0)<br /> goto gotit;<br /> }<br /> }<br /><code>@ -1422,7 +1426,7 </code>@ ffs_nodealloccg(struct inode *ip, int cg, ufs_daddr_t ipref, int mode)
* quick-check up above.<br /> */<br /> if ((map & (1 << i)) 0) {<br />- if (ufs_ihashcheck(ip->i_dev, ibase + (ipref << 3) + i) 0) {<br />+ if (ufs_ihashcheck(ump, ip->i_dev, ibase + (ipref << 3) + i) == 0) {<br /> ipref = (ipref << 3) + i;<br /> cgp->cg_irotor = (ipref + 1) % fs->fs_ipg;<br /> goto gotit;<br />diff --git a/sys/vfs/ufs/ffs_softdep.c b/sys/vfs/ufs/ffs_softdep.c<br />index b6a8cbf..2e9788d 100644<br />--- a/sys/vfs/ufs/ffs_softdep.c<br />+++ b/sys/vfs/ufs/ffs_softdep.c<br /><code>@ -592,6 +592,7 </code>@ done:<br /> static int<br /> process_worklist_item(struct mount *matchmnt, int flags)
{<br />+ struct ufsmount *ump;<br /> struct worklist *wk;<br /> struct dirrem *dirrem;<br /> struct fs *matchfs;<br /><code>@ -612,8 +613,10 </code>@ process_worklist_item(struct mount *matchmnt, int flags)<br /> if ((flags & LK_NOWAIT) == 0 || wk->wk_type != D_DIRREM)<br /> break;<br /> dirrem = WK_DIRREM(wk);<br />- vp = ufs_ihashlookup(<abbr title="dirrem->dm_mnt">VFSTOUFS</abbr>->um_dev,<br />- dirrem->dm_oldinum);<br />+ ump = <abbr title="dirrem->dm_mnt">VFSTOUFS</abbr>;<br />+ lwkt_gettoken(&ump->um_mountp->mnt_token);<br />+ vp = ufs_ihashlookup(ump, ump->um_dev, dirrem->dm_oldinum);<br />+ lwkt_reltoken(&ump->um_mountp->mnt_token);<br /> if (vp == NULL || !vn_islocked(vp))<br /> break;<br /> }<br />diff --git a/sys/vfs/ufs/ffs_vfsops.c b/sys/vfs/ufs/ffs_vfsops.c<br />index 92c008b..d62f5b3 100644<br />--- a/sys/vfs/ufs/ffs_vfsops.c<br />+++ b/sys/vfs/ufs/ffs_vfsops.c<br /><code>@ -84,7 +84,6 </code>@ static struct vfsops ufs_vfsops = {<br /> .vfs_checkexp = ufs_check_export,<br /> .vfs_vptofh = ffs_vptofh,<br /> .vfs_init = ffs_init,<br />- .vfs_uninit = ufs_uninit<br /> };</p>
<pre><code>VFS_SET(ufs_vfsops, ufs, 0);<br /><code>@ -768,6 +767,7 </code>@ ffs_mountfs(struct vnode *devvp, struct mount *mp, struct malloc_type *mtype)<br /> mp->mnt_time = fs->fs_time;<br /> }</code></pre>
<p>+ ufs_ihashinit(ump);<br /> ump->um_savedmaxfilesize = fs->fs_maxfilesize; /* XXX <strong>/<br /> maxfilesize = (uint64_t)0x40000000 * fs->fs_bsize - 1; /</strong> XXX <strong>/<br /> /</strong> Enforce limit caused by vm object backing (32 bits vm_pindex_t). */<br /><code>@ -796,6 +796,7 </code>@ out:<br /> brelse(bp);<br /> VOP_CLOSE(devvp, ronly ? FREAD : FREAD|FWRITE);<br /> if (ump) {<br />+ ufs_ihashuninit(ump);<br /> kfree(ump->um_fs, M_UFSMNT);<br /> kfree(ump, M_UFSMNT);<br /> mp->mnt_data = (qaddr_t)0;<br /><code>@ -871,6 +872,7 </code>@ ffs_unmount(struct mount *mp, int mntflags)</p>
<pre><code>vrele(ump->um_devvp);</code></pre>
<p>+ ufs_ihashuninit(ump);<br /> kfree(fs->fs_csp, M_UFSMNT);<br /> kfree(fs, M_UFSMNT);<br /> kfree(ump, M_UFSMNT);<br /><code>@ -1085,8 +1087,8 </code>@ ffs_vget(struct mount *mp, struct vnode *dvp, ino_t ino, struct vnode **vpp)</p>
<pre><code>ump = VFSTOUFS(mp);<br /> dev = ump->um_dev;<br /><del>restart:<br /></del> if ((*vpp = ufs_ihashget(dev, ino)) != NULL) {<br />+ <br />+ if ((*vpp = ufs_ihashget(ump, dev, ino)) != NULL) {<br /> return (0);<br /> }</code></pre>
<p><code>@ -1100,7 +1102,8 </code>@ restart:
* XXX this may no longer be true since getnewvnode returns a
* VX locked vnode now.<br /> */<br />- ip = kmalloc(sizeof(struct inode), ump->um_malloctype, M_WAITOK);<br />+ ip = kmalloc(sizeof(struct inode), ump->um_malloctype,<br />+ M_WAITOK | M_ZERO);</p>
<pre><code>/* Allocate a new vnode/inode. */<br /> error = getnewvnode(VT_UFS, mp, &vp, VLKTIMEOUT, LK_CANRECURSE);<br /><code>@ -1109,7 +1112,6 </code>@ restart:<br /> kfree(ip, ump->um_malloctype);<br /> return (error);<br /> }<br />- bzero((caddr_t)ip, sizeof(struct inode));<br /> ip->i_vnode = vp;<br /> ip->i_fs = fs = ump->um_fs;<br /> ip->i_dev = dev;<br /><code>@ -1123,16 +1125,10 </code>@ restart:<br /> #endif</code></pre>
<pre><code>/*<br />- * Insert it into the inode hash table and check for a collision.<br />- * If a collision occurs, throw away the vnode and try again.<br />+ * Insert it into the inode hash table.<br /> */<br />- if (ufs_ihashins(ip) != 0) {<br />- kprintf("debug: ufs ihashins collision, retrying inode %ld\n",<br />- (long)ip->i_number);<br />- vp->v_type = VBAD;<br />- vx_put(vp);<br />- kfree(ip, ump->um_malloctype);<br />- goto restart;<br />+ if (ufs_ihashins(ump, ip) != 0) {<br />+ panic("duplicate inode in inohash");<br /> }<br /> vp->v_data = ip;</code></pre>
<p>diff --git a/sys/vfs/ufs/ufs_extern.h b/sys/vfs/ufs/ufs_extern.h<br />index d05c350..6f681b6 100644<br />--- a/sys/vfs/ufs/ufs_extern.h<br />+<ins>+ b/sys/vfs/ufs/ufs_extern.h<br /><code>@ -78,16 +78,16 </code>@ int ufs_dirremove(struct vnode *, struct inode *, int, int);<br /> int ufs_dirrewrite(struct inode *, struct inode *, ino_t, int, int);<br /> int ufs_getlbns(struct vnode *, ufs_daddr_t, struct indir *, int *);<br /> struct vnode *<br />- ufs_ihashget(cdev_t, ino_t);<br /><del>int ufs_ihashcheck(cdev_t, ino_t);<br />-void ufs_ihashinit(void);<br />-int ufs_ihashins(struct inode *);<br /></ins> ufs_ihashget(struct ufsmount *, cdev_t, ino_t);<br /><ins>int ufs_ihashcheck(struct ufsmount *, cdev_t, ino_t);<br />+void ufs_ihashinit(struct ufsmount *);<br />+void ufs_ihashuninit(struct ufsmount *);<br />+int ufs_ihashins(struct ufsmount *, struct inode *);<br /> struct vnode *<br /></del> ufs_ihashlookup(cdev_t, ino_t);<br /><del>void ufs_ihashrem(struct inode *);<br /></ins> ufs_ihashlookup(struct ufsmount *, cdev_t, ino_t);<br /><ins>void ufs_ihashrem(struct ufsmount *, struct inode *);<br /> int ufs_inactive(struct vop_inactive_args *);<br /> int ufs_init(struct vfsconf *);<br />-int ufs_uninit(struct vfsconf *);<br /> void ufs_itimes(struct vnode *vp);<br /> int ufs_lookup(struct vop_old_lookup_args *);<br /> int ufs_reclaim(struct vop_reclaim_args *);<br />diff --git a/sys/vfs/ufs/ufs_ihash.c b/sys/vfs/ufs/ufs_ihash.c<br />index 277bcf2..426b2d4 100644<br />--</del> a/sys/vfs/ufs/ufs_ihash.c<br /></ins>++ b/sys/vfs/ufs/ufs_ihash.c<br /><code>@ -32,7 +32,6 </code>@
*
* @(#)ufs_ihash.c 8.7 (Berkeley) 5/17/95
* $FreeBSD: src/sys/ufs/ufs/ufs_ihash.c,v 1.20 1999/08/28 00:52:29 peter Exp $<br />- * $DragonFly: src/sys/vfs/ufs/ufs_ihash.c,v 1.20 2006/10/14 16:26:40 dillon Exp $<br /> */</p>
<pre><code>#include &lt;sys/param.h&gt;<br /><code>@ -42,60 +41,52 </code>@<br /> #include &lt;sys/vnode.h&gt;<br /> #include &lt;sys/malloc.h&gt;<br /> #include &lt;sys/proc.h&gt;<br />+#include &lt;sys/mount.h&gt;</code></pre>
<pre><code>#include "quota.h" <br /> #include "inode.h" <br /> #include "ufs_extern.h" <br />+#include "ufsmount.h"</code></pre>
<pre><code>static MALLOC_DEFINE(M_UFSIHASH, "UFS ihash", "UFS Inode hash tables");<br /><del>/*<br /></del> * Structures associated with inode cacheing.<br />- <strong>/<br />-static struct inode **ihashtbl;<br />-static u_long ihash; /</strong> size of hash table - 1 */<br />-static struct lwkt_token ufs_ihash_token;</code></pre>
<p><del>#define <abbr title="device, inum">INOHASH</abbr> (&ihashtbl[(minor(device) + (inum)) & ihash])<br /><ins>#define <abbr title="ump, inum">INOHASH</abbr> \<br /></ins> (&ump</del>>um_ihashtbl[inum & ump->um_ihash])</p>
<pre><code>/*
* Initialize inode hash table.<br /> */<br /> void<br />-ufs_ihashinit(void)<br />+ufs_ihashinit(struct ufsmount *ump)
{<br />- ihash = 16;<br />- while (ihash < desiredvnodes)<br />- ihash <<= 1;<br />- ihashtbl = kmalloc(sizeof(void *) * ihash, M_UFSIHASH, M_WAITOK|M_ZERO);<br />- --ihash;<br />- lwkt_token_init(&ufs_ihash_token, "ufsihash");<br />+ ump->um_ihash = 16;<br />+ while (ump->um_ihash < desiredvnodes)<br />+ ump->um_ihash <<= 1;<br />+ ump->um_ihashtbl = kmalloc(sizeof(void *) * ump->um_ihash, M_UFSIHASH,<br />+ M_WAITOK|M_ZERO);<br />+ --ump->um_ihash;<br /> }</code></pre>
<p>-int<br />-ufs_uninit(struct vfsconf *vfc)<br />+void<br />+ufs_ihashuninit(struct ufsmount *ump)
{<br />- lwkt_gettoken(&ufs_ihash_token);<br />- if (ihashtbl)<br />- kfree(ihashtbl, M_UFSIHASH);<br />- lwkt_reltoken(&ufs_ihash_token);<br /><del><br /></del> return (0);<br />+ if (ump->um_ihashtbl)<br />+ kfree(ump->um_ihashtbl, M_UFSIHASH);<br /> }<br />+<br /> /*
* Use the device/inum pair to find the incore inode, and return a pointer
* to it. If it is in core, return it, even if it is locked.<br /> */<br /> struct vnode *<br />-ufs_ihashlookup(cdev_t dev, ino_t inum)<br />+ufs_ihashlookup(struct ufsmount *ump, cdev_t dev, ino_t inum)
{<br />- struct inode *ip;<br />+ struct inode *ip = NULL;</p>
<p>- lwkt_gettoken(&ufs_ihash_token);<br />- for (ip = *<abbr title="dev, inum">INOHASH</abbr>; ip; ip = ip->i_next) {<br />+ for (ip = *<abbr title="ump, inum">INOHASH</abbr>; ip; ip = ip->i_next) {<br /> if (inum ip->i_number && dev ip->i_dev)<br /> break;<br /> }<br />- lwkt_reltoken(&ufs_ihash_token);<br /> if (ip)<br /> return (<abbr title="ip">ITOV</abbr>);<br /> return (NULLVP);<br /><code>@ -105,20 +96,16 </code>@ ufs_ihashlookup(cdev_t dev, ino_t inum)
* Use the device/inum pair to find the incore inode, and return a pointer
* to it. If it is in core, but locked, wait for it.
*<br />- * Note that the serializing tokens do not prevent other processes from<br />- * playing with the data structure being protected while we are blocked.<br />- * They do protect us from preemptive interrupts which might try to<br />- * play with the protected data structure.<br />+ * This subroutine may block.<br /> */<br /> struct vnode *<br />-ufs_ihashget(cdev_t dev, ino_t inum)<br />+ufs_ihashget(struct ufsmount *ump, cdev_t dev, ino_t inum)
{<br /> struct inode *ip;<br /> struct vnode *vp;</p>
<p>- lwkt_gettoken(&ufs_ihash_token);<br /> loop:<br />- for (ip = *<abbr title="dev, inum">INOHASH</abbr>; ip; ip = ip->i_next) {<br />+ for (ip = *<abbr title="ump, inum">INOHASH</abbr>; ip; ip = ip->i_next) {<br /> if (inum != ip->i_number || dev != ip->i_dev)<br /> continue;<br /> vp = <abbr title="ip">ITOV</abbr>;<br /><code>@ -128,7 +115,7 </code>@ loop:
* We must check to see if the inode has been ripped
* out from under us after blocking.<br /> */<br />- for (ip = *<abbr title="dev, inum">INOHASH</abbr>; ip; ip = ip->i_next) {<br />+ for (ip = *<abbr title="ump, inum">INOHASH</abbr>; ip; ip = ip->i_next) {<br /> if (inum ip->i_number && dev ip->i_dev)<br /> break;<br /> }<br /><code>@ -136,10 +123,8 </code>@ loop:<br /> vput(vp);<br /> goto loop;<br /> }<br />- lwkt_reltoken(&ufs_ihash_token);<br /> return (vp);<br /> }<br />- lwkt_reltoken(&ufs_ihash_token);<br /> return (NULL);<br /> }</p>
<p><code>@ -149,16 +134,14 </code>@ loop:
* reallocate of its inode number before we have had a chance to recycle it.<br /> */<br /> int<br />-ufs_ihashcheck(cdev_t dev, ino_t inum)<br />+ufs_ihashcheck(struct ufsmount *ump, cdev_t dev, ino_t inum)
{<br /> struct inode *ip;</p>
<p>- lwkt_gettoken(&ufs_ihash_token);<br />- for (ip = *<abbr title="dev, inum">INOHASH</abbr>; ip; ip = ip->i_next) {<br />+ for (ip = *<abbr title="ump, inum">INOHASH</abbr>; ip; ip = ip->i_next) {<br /> if (inum ip->i_number && dev ip->i_dev)<br /> break;<br /> }<br />- lwkt_reltoken(&ufs_ihash_token);<br /> return(ip ? 1 : 0);<br /> }</p>
<p><code>@ -166,17 +149,15 </code>@ ufs_ihashcheck(cdev_t dev, ino_t inum)
* Insert the inode into the hash table, and return it locked.<br /> */<br /> int<br />-ufs_ihashins(struct inode *ip)<br />+ufs_ihashins(struct ufsmount *ump, struct inode *ip)
{<br /> struct inode **ipp;<br /> struct inode *iq;</p>
<pre><code>KKASSERT((ip->i_flag & IN_HASHED) == 0);<br />- lwkt_gettoken(&ufs_ihash_token);<br />- ipp = INOHASH(ip->i_dev, ip->i_number);<br />+ ipp = INOHASH(ump, ip->i_number);<br /> while ((iq = *ipp) != NULL) {<br /> if (ip->i_dev iq->i_dev && ip->i_number iq->i_number) {<br />- lwkt_reltoken(&ufs_ihash_token);<br /> return(EBUSY);<br /> }<br /> ipp = &iq->i_next;<br /><code>@ -184,7 +165,6 </code>@ ufs_ihashins(struct inode *ip)<br /> ip->i_next = NULL;<br /> *ipp = ip;<br /> ip->i_flag |= IN_HASHED;<br />- lwkt_reltoken(&ufs_ihash_token);<br /> return(0);<br /> }</code></pre>
<p><code>@ -192,14 +172,13 </code>@ ufs_ihashins(struct inode *ip)
* Remove the inode from the hash table.<br /> */<br /> void<br />-ufs_ihashrem(struct inode *ip)<br />+ufs_ihashrem(struct ufsmount *ump, struct inode *ip)
{<br /> struct inode **ipp;<br /> struct inode *iq;</p>
<p>- lwkt_gettoken(&ufs_ihash_token);<br /> if (ip->i_flag & IN_HASHED) {<br />- ipp = <abbr title="ip->i_dev, ip->i_number">INOHASH</abbr>;<br />+ ipp = <abbr title="ump, ip->i_number">INOHASH</abbr>;<br /> while ((iq = *ipp) != NULL) {<br /> if (ip == iq)<br /> break;<br /><code>@ -210,6 +189,5 </code>@ ufs_ihashrem(struct inode *ip)<br /> ip->i_next = NULL;<br /> ip->i_flag &= ~IN_HASHED;<br /> }<br />- lwkt_reltoken(&ufs_ihash_token);<br /> }</p>
<p>diff --git a/sys/vfs/ufs/ufs_inode.c b/sys/vfs/ufs/ufs_inode.c<br />index 9b51bd5..6ccd0c4 100644<br />--- a/sys/vfs/ufs/ufs_inode.c<br />+++ b/sys/vfs/ufs/ufs_inode.c<br /><code>@ -116,10 +116,13 </code>@ ufs_reclaim(struct vop_reclaim_args *ap)
{<br /> struct inode *ip;<br /> struct vnode *vp = ap->a_vp;<br />+ struct ufsmount *ump;<br /> #ifdef QUOTA<br /> int i;<br /> #endif</p>
<p>+ ump = <abbr title="vp->v_mount">VFSTOUFS</abbr>;<br /><ins><br /> if (prtactive && vp->v_sysref.refcnt > 1)<br /> vprint("ufs_reclaim: pushing active", vp);<br /> ip = <abbr title="vp">VTOI</abbr>;<br /><code>@ -146,7 +149,7 </code>@ ufs_reclaim(struct vop_reclaim_args *ap)<br /> */<br /> vp->v_data = NULL;<br /> if (ip) {<br />- ufs_ihashrem(ip);<br /></ins> ufs_ihashrem(ump, ip);<br /> if (ip->i_devvp) {<br /> vrele(ip->i_devvp);<br /> ip->i_devvp = 0;<br />diff --git a/sys/vfs/ufs/ufs_vfsops.c b/sys/vfs/ufs/ufs_vfsops.c<br />index bf1ef52..315eed8 100644<br />--- a/sys/vfs/ufs/ufs_vfsops.c<br />+<ins>+ b/sys/vfs/ufs/ufs_vfsops.c<br /><code>@ -192,7 +192,6 </code>@ ufs_init(struct vfsconf *vfsp)<br /> if (done)<br /> return (0);<br /> done = 1;<br />- ufs_ihashinit();<br /> #ifdef QUOTA<br /> ufs_dqinit();<br /> #endif<br />diff --git a/sys/vfs/ufs/ufsmount.h b/sys/vfs/ufs/ufsmount.h<br />index 1a07f1d..c789428 100644<br />--- a/sys/vfs/ufs/ufsmount.h<br /></ins>++ b/sys/vfs/ufs/ufsmount.h<br /><code>@ -32,7 +32,6 </code>@
*
* @(#)ufsmount.h 8.6 (Berkeley) 3/30/95
* $FreeBSD: src/sys/ufs/ufs/ufsmount.h,v 1.17 1999/12/29 04:55:06 peter Exp $<br />- * $DragonFly: src/sys/vfs/ufs/ufsmount.h,v 1.11 2008/08/04 18:15:47 dillon Exp $<br /> */</p>
<pre><code>#ifndef <em>VFS_UFS_UFSMOUNT_H</em><br /><code>@ -76,13 +75,7 </code>@ struct ufsmount {<br /> cdev_t um_dev; /* device mounted <strong>/<br /> struct vnode *um_devvp; /</strong> block device mounted vnode */</code></pre>
<p>- union { /* pointer to superblock <strong>/<br />- struct fs *fs; /</strong> FFS <strong>/<br />- struct ext2_sb_info *e2fs; /</strong> EXT2FS <strong>/<br />- } ufsmount_u;<br /><del># define um_fs ufsmount_u.fs<br /></del># define um_e2fs ufsmount_u.e2fs<br /><del># define um_e2fsb ufsmount_u.e2fs</del>>s_es<br />+ struct fs *um_fs; /</strong> FFS <strong>/<br /> struct vnode *um_quotas[MAXQUOTAS]; /</strong> pointer to quota files <strong>/<br /> struct ucred *um_cred[MAXQUOTAS]; /</strong> quota file access cred <strong>/<br /> u_long um_nindir; /</strong> indirect ptrs per block <strong>/<br /><code>@ -95,6 +88,8 </code>@ struct ufsmount {<br /> int64_t um_savedmaxfilesize; /</strong> XXX - limit maxfilesize <strong>/<br /> struct malloc_type *um_malloctype; /</strong> The inodes malloctype <strong>/<br /> int um_i_effnlink_valid; /</strong> i_effnlink valid? <strong>/<br />+ struct inode **um_ihashtbl; /</strong> inum to inode map <strong>/<br />+ u_long um_ihash; /</strong> size of hash table - 1 */<br /> };</p>
<pre><code>/*<br />-- <br />1.7.12.1.382.gb0576a6</code></pre>
<p>-- <br />-- vs</p>
DragonFlyBSD - Submit #2469 (Closed): [PATCH] kernel -- ffs: Soft updates getdirtybuf/flush_paged...
https://bugs.dragonflybsd.org/issues/2469
2012-12-10T09:21:08Z
vsrinivas
vsrinivas@ops101.org
<p>If getdirtybuf() was unable to lookup a dirty buffer from the<br />flush_pagedep_deps path, we need to retry the lookup, rather than<br />proceeding through processing the diradd.</p>
<p>Reported-by: marino@<br />---<br /> sys/vfs/ufs/ffs_softdep.c | 3 +<ins>+<br /> 1 file changed, 3 insertions(</ins>)</p>
<p>diff --git a/sys/vfs/ufs/ffs_softdep.c b/sys/vfs/ufs/ffs_softdep.c<br />index b6a8cbf..d8a91f6 100644<br />--- a/sys/vfs/ufs/ffs_softdep.c<br />+++ b/sys/vfs/ufs/ffs_softdep.c<br /><code>@ -4593,6 +4593,7 </code>@ flush_pagedep_deps(struct vnode *pvp, struct mount *mp,
* locate that buffer, ensure that there will be no rollback
* caused by a bitmap dependency, then write the inode buffer.<br /> */<br /><ins>retry_lookup:<br /> if (inodedep_lookup(ump->um_fs, inum, 0, &inodedep) 0) {<br /> panic("flush_pagedep_deps: lost inode");<br /> }<br /><code>@ -4602,6 +4603,8 </code>@ flush_pagedep_deps(struct vnode *pvp, struct mount *mp,<br /> */<br /> if ((inodedep->id_state & DEPCOMPLETE) 0) {<br /> gotit = getdirtybuf(&inodedep->id_buf, MNT_WAIT);<br /></ins> if (gotit == 0)<br />+ goto retry_lookup;<br /> FREE_LOCK(&lk);<br /> if (gotit && (error = bwrite(inodedep->id_buf)) != 0)<br /> break;<br />-- <br />1.7.12.1.382.gb0576a6</p>
<p>-- <br />-- vs</p>
DragonFlyBSD - Submit #2468 (Closed): [PATCH] kernel -- nata: Move ata_finish to MPSAFE taskqueue.
https://bugs.dragonflybsd.org/issues/2468
2012-12-10T08:27:22Z
vsrinivas
vsrinivas@ops101.org
<p>ata_finish() doesn't need the MP Lock; moving it from taskqueue_swi<br />to taskqueue_swi_mp will make sure it's not taken.</p>
<p>Note that taskqueue_swi(<em>mp) will be processed when this ithread<br />attempts to switch back to the thread it preempted. This means that<br />taskqueue_swi(_mp) processing exclude processing further interrupts<br />on the ithread while they're running. This may not be desirable and<br />is different than taskqueue_swi / swi</em>* / setsoft* in FreeBSD 4.x.<br />---<br /> sys/dev/disk/nata/ata-queue.c | 4 +<ins>--<br /> 1 file changed, 2 insertions(</ins>), 2 deletions(-)</p>
<p>diff --git a/sys/dev/disk/nata/ata-queue.c b/sys/dev/disk/nata/ata-queue.c<br />index b1b96a3..157d5cf 100644<br />--- a/sys/dev/disk/nata/ata-queue.c<br />+<ins>+ b/sys/dev/disk/nata/ata-queue.c<br /><code>@ -285,8 +285,8 </code>@ ata_finish(struct ata_request <strong>request)<br /> /</strong> put request on the proper taskqueue for completion <strong>/<br /> /</strong> XXX FreeBSD has some sort of bio_taskqueue code here */<br /> TASK_INIT(&request->task, 0, ata_completed, request);<br />- ATA_DEBUG_RQ(request, "finish taskqueue_swi");<br />- taskqueue_enqueue(taskqueue_swi, &request->task);<br /></ins> ATA_DEBUG_RQ(request, "finish taskqueue_swi_mp");<br />+ taskqueue_enqueue(taskqueue_swi_mp, &request->task);<br /> }<br /> }</p>
<p>-- <br />1.7.12.1.382.gb0576a6</p>
<p>-- <br />-- vs</p>
DragonFlyBSD - Bug #2375 (Resolved): Wishlist: tmpfs directory lookup optimization
https://bugs.dragonflybsd.org/issues/2375
2012-05-23T18:11:20Z
vsrinivas
vsrinivas@ops101.org
<p>tmpfs directories are structured as lists of directory entries; this leads to linear lookup costs. Directories with many files become fairly expensive to operate on.</p>
<p><a class="external" href="http://leaf.dragonflybsd.org/~vsrinivas/tmpfs5.diff">http://leaf.dragonflybsd.org/~vsrinivas/tmpfs5.diff</a> is a patch that introduces a 64-wide hash table (of lists) to speed up lookups. The patch is currently littered with debugging cruft and could benefit from cleaning.</p>
<p><a class="external" href="http://leaf.dragonflybsd.org/~hofmann/tmpfs_rbtree.diff">http://leaf.dragonflybsd.org/~hofmann/tmpfs_rbtree.diff</a> is a cleaner patch that uses an RB-tree, keyed on the name of the file in question.</p>
<p>Both approaches are solid improvements over the current lists, but could use some testing (benchmarking) to determine which is worth applying. The hash list patch has had many hours of fsstress testing; it now works well. The tree patches at the same points.</p>
DragonFlyBSD - Bug #2374 (Resolved): softupdates locking bug
https://bugs.dragonflybsd.org/issues/2374
2012-05-23T17:36:36Z
vsrinivas
vsrinivas@ops101.org
<p>softupdates may still have some locking issues:</p>
In -master:
<ul>
<li><a class="external" href="http://leaf.dragonflybsd.org/~marino/core/core.20120523.txt">http://leaf.dragonflybsd.org/~marino/core/core.20120523.txt</a><br />Panic where softdep_update_inodeblock() called bwrite() with a NULL buffer</li>
</ul>
<p>getdirtybuf returned 'gotit', yet it either returned a NULL bp or the buffer was nulled after<br />it was saved in the inodedep structure. getdirtybuf can block and does release the softdep<br />lock while locking dirty buffers, but it is not clear if anyone can race in and result in the failure mode seen.</p>
<ul>
<li>(from 3.0.3 catchall bug (2336)):<br />Deadlock in -master with softdep. No more details available.</li>
</ul>
DragonFlyBSD - Bug #2360 (In Progress): Wishlist: virtio driver import
https://bugs.dragonflybsd.org/issues/2360
2012-05-02T18:28:25Z
vsrinivas
vsrinivas@ops101.org
<p>Tim Bisson ported the FreeBSD virtio-bhyve drivers to DragonFly (<a class="external" href="https://github.com/bissont/virtio_bhyve">https://github.com/bissont/virtio_bhyve</a>). It'd be nice if we could import them into DragonFly.</p>
<p>Status ===<br />I have started working on integration in the 'virtual' branch of my DragonFly tree:</p>
<p><a class="external" href="https://github.com/vsrinivas/DragonFlyBSD/commits/virtual">https://github.com/vsrinivas/DragonFlyBSD/commits/virtual</a></p>
<p>Todo:<br />x 1. Move drivers into appropriate location in source tree + rewrite makefiles</p>
DragonFlyBSD - Bug #2343 (Resolved): 'Oversized DMA transfer 131072 > 65536' when trying to dump ...
https://bugs.dragonflybsd.org/issues/2343
2012-04-06T09:09:03Z
vsrinivas
vsrinivas@ops101.org
<p>When attempting to dump a kernel core on i386/nata w/ latest -master, I get an 'Oversized DMA transfer 131072 > 65536' followed by a DUMP ERROR 5.</p>