From owner-freebsd-bugs@FreeBSD.ORG Mon Jan 18 02:50:06 2010 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 79E191065676 for ; Mon, 18 Jan 2010 02:50:06 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 3AE008FC16 for ; Mon, 18 Jan 2010 02:50:06 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id o0I2o6ct074572 for ; Mon, 18 Jan 2010 02:50:06 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id o0I2o61N074571; Mon, 18 Jan 2010 02:50:06 GMT (envelope-from gnats) Resent-Date: Mon, 18 Jan 2010 02:50:06 GMT Resent-Message-Id: <201001180250.o0I2o61N074571@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, "Pedro F. Giffuni" Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9A27910656A3 for ; Mon, 18 Jan 2010 02:43:02 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id 6F5B98FC25 for ; Mon, 18 Jan 2010 02:43:02 +0000 (UTC) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id o0I2h1AP009175 for ; Mon, 18 Jan 2010 02:43:01 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id o0I2h18q009174; Mon, 18 Jan 2010 02:43:01 GMT (envelope-from nobody) Message-Id: <201001180243.o0I2h18q009174@www.freebsd.org> Date: Mon, 18 Jan 2010 02:43:01 GMT From: "Pedro F. Giffuni" To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: kern/142924: Small cleanup for the inode struct in ext2fs (based on UFS) X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jan 2010 02:50:06 -0000 >Number: 142924 >Category: kern >Synopsis: Small cleanup for the inode struct in ext2fs (based on UFS) >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Mon Jan 18 02:50:05 UTC 2010 >Closed-Date: >Last-Modified: >Originator: Pedro F. Giffuni >Release: 8.0-Release + BSD ext2fs >Organization: >Environment: FreeBSD mogwai.giffuni.net 8.0-RELEASE FreeBSD 8.0-RELEASE #13: Sat Jan 9 20:39:47 UTC 2010 pedro@mogwai.giffuni.net:/usr/src/sys/i386/compile/GENERIC i386 >Description: Minor enhancements based on UFS: >From SVN 118969: Eliminate the i_devvp field from the incore EXT2FS inodes, we can get the same value from ip->i_ump->um_devvp. This saves a pointer in the memory copies of inodes, which can easily run into several hundred kilobytes. The extra indirection is unmeasurable in benchmarks. ____ While here move a line before a comment in the lookup code to make space for a dirhash implementation. >How-To-Repeat: >Fix: diff -ru ext2fs.bsd/ext2_lookup.c ext2fs/ext2_lookup.c --- ext2fs.bsd/ext2_lookup.c 2010-01-17 19:02:30.000000000 +0000 +++ ext2fs/ext2_lookup.c 2010-01-17 20:40:10.000000000 +0000 @@ -347,6 +347,7 @@ slotneeded = (sizeof(struct direct) - MAXNAMLEN + cnp->cn_namelen + 3) &~ 3; */ } + bmask = VFSTOEXT2(vdp->v_mount)->um_mountp->mnt_stat.f_iosize - 1; /* * If there is cached information on a previous search of @@ -359,7 +360,6 @@ * profiling time and hence has been removed in the interest * of simplicity. */ - bmask = VFSTOEXT2(vdp->v_mount)->um_mountp->mnt_stat.f_iosize - 1; if (nameiop != LOOKUP || i_diroff == 0 || i_diroff > dp->i_size) { entryoffsetinblock = 0; diff -ru ext2fs.bsd/ext2_vfsops.c ext2fs/ext2_vfsops.c --- ext2fs.bsd/ext2_vfsops.c 2010-01-17 19:02:56.000000000 +0000 +++ ext2fs/ext2_vfsops.c 2010-01-17 20:37:52.000000000 +0000 @@ -945,9 +945,8 @@ } /* - * Finish inode initialization now that aliasing has been resolved. + * Finish inode initialization. */ - ip->i_devvp = ump->um_devvp; /* * Set up a generation number for this inode if it does not diff -ru ext2fs.bsd/inode.h ext2fs/inode.h --- ext2fs.bsd/inode.h 2010-01-17 19:03:21.000000000 +0000 +++ ext2fs/inode.h 2010-01-17 20:35:56.000000000 +0000 @@ -62,7 +62,6 @@ */ struct inode { struct vnode *i_vnode;/* Vnode associated with this inode. */ - struct vnode *i_devvp;/* Vnode for block I/O. */ struct ext2mount *i_ump; u_int32_t i_flag; /* flags, see below */ ino_t i_number; /* The identity of the inode. */ @@ -143,6 +142,9 @@ #define IN_SPACECOUNTED 0x0080 /* Blocks to be freed in free count. */ #define IN_LAZYACCESS 0x0100 /* Process IN_ACCESS after the suspension finished */ + +#define i_devvp i_ump->um_devvp + #ifdef _KERNEL /* * Structure used to pass around logical block paths generated by >Release-Note: >Audit-Trail: >Unformatted: