From owner-svn-src-user@FreeBSD.ORG Sat Nov 21 01:54:33 2009 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 85FBC106566C; Sat, 21 Nov 2009 01:54:33 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5AFB68FC13; Sat, 21 Nov 2009 01:54:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAL1sXBx062510; Sat, 21 Nov 2009 01:54:33 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAL1sXon062508; Sat, 21 Nov 2009 01:54:33 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200911210154.nAL1sXon062508@svn.freebsd.org> From: Kip Macy Date: Sat, 21 Nov 2009 01:54:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199622 - user/kmacy/releng_8_fcs_buf/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Nov 2009 01:54:33 -0000 Author: kmacy Date: Sat Nov 21 01:54:32 2009 New Revision: 199622 URL: http://svn.freebsd.org/changeset/base/199622 Log: - enforce size limit in arc_evict itself - mark new buffer as B_VMIO so that they are maintained in the page cache Modified: user/kmacy/releng_8_fcs_buf/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Modified: user/kmacy/releng_8_fcs_buf/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- user/kmacy/releng_8_fcs_buf/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sat Nov 21 01:43:22 2009 (r199621) +++ user/kmacy/releng_8_fcs_buf/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sat Nov 21 01:54:32 2009 (r199622) @@ -1419,10 +1419,11 @@ arc_getblk(arc_buf_t *buf) data = newbp->b_data; buf->b_hdr->b_flags &= ~ARC_BUF_CLONING; } else { - newbp = getblk(vp, blkno, size, 0, 0, flags); - if (newbp->b_birth != buf->b_hdr->b_birth) - newbp->b_flags |= B_INVAL; - brelvp(newbp); + newbp = getblk(vp, blkno, size, 0, 0, flags | GB_NOCREAT); + if (newbp == NULL) + newbp = geteblk(size, flags); + else + brelvp(newbp); data = newbp->b_data; } @@ -1435,8 +1436,10 @@ arc_getblk(arc_buf_t *buf) newbp, newbp->b_flags); #endif - if (newbp != NULL) + if (newbp != NULL) { BUF_KERNPROC(newbp); + newbp->b_flags |= B_VMIO; + } buf->b_bp = newbp; buf->b_data = data; } @@ -1722,7 +1725,13 @@ arc_evict(arc_state_t *state, spa_t *spa ASSERT(state == arc_mru || state == arc_mfu); evicted_state = (state == arc_mru) ? arc_mru_ghost : arc_mfu_ghost; - + + /* + * don't recycle page cache bufs + * + */ + if (recycle && (size >= PAGE_SIZE)) + recycle = FALSE; if (type == ARC_BUFC_METADATA) { offset = 0; list_count = ARC_BUFC_NUMMETADATALISTS; @@ -2483,7 +2492,7 @@ arc_get_data_buf(arc_buf_t *buf) state = (arc_mru->arcs_lsize[type] > 0 && mfu_space > arc_mfu->arcs_size) ? arc_mru : arc_mfu; } - if ((buf->b_data = arc_evict(state, NULL, size, (size < PAGE_SIZE), type)) == NULL) { + if ((buf->b_data = arc_evict(state, NULL, size, TRUE, type)) == NULL) { arc_getblk(buf); ASSERT(buf->b_data != NULL); }