From owner-svn-src-head@freebsd.org Thu Jul 23 02:20:42 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C52AC9A85CB; Thu, 23 Jul 2015 02:20:42 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A991E1678; Thu, 23 Jul 2015 02:20:42 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6N2Kg8q070820; Thu, 23 Jul 2015 02:20:42 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6N2KgG9070819; Thu, 23 Jul 2015 02:20:42 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201507230220.t6N2KgG9070819@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Thu, 23 Jul 2015 02:20:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285808 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jul 2015 02:20:43 -0000 Author: jeff Date: Thu Jul 23 02:20:41 2015 New Revision: 285808 URL: https://svnweb.freebsd.org/changeset/base/285808 Log: - Don't defeat the FIFO nature of the buffer cache by eliminating the most recently used buffer when we are under paging pressure. This is a perversion of the buffer and page replacement algorithms and recent improvements to the page daemon have rendered it unnecessary. In the event that low-memory deadlocks become an issue it would be possible to make a daemon or event handler that performs a similar action on the oldest buffers rather than the newest. Since the buf cache is analogous to the page cache and some minimum working set is desired another possibility is to simply shrink the minimum working set which has less downside now that file pages are not directly mapped. Sponsored by: EMC / Isilon Reviewed by: alc, kib (with some minor objection) Tested by: pho Modified: head/sys/kern/vfs_bio.c Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Wed Jul 22 23:30:54 2015 (r285807) +++ head/sys/kern/vfs_bio.c Thu Jul 23 02:20:41 2015 (r285808) @@ -1563,15 +1563,6 @@ buf_dirty_count_severe(void) return(numdirtybuffers >= hidirtybuffers); } -static __noinline int -buf_vm_page_count_severe(void) -{ - - KFAIL_POINT_CODE(DEBUG_FP, buf_pressure, return 1); - - return vm_page_count_severe(); -} - /* * brelse: * @@ -1647,20 +1638,9 @@ brelse(struct buf *bp) * * We still allow the B_INVAL case to call vfs_vmio_release(), even * if B_DELWRI is set. - * - * If B_DELWRI is not set we may have to set B_RELBUF if we are low - * on pages to return pages to the VM page queues. */ if (bp->b_flags & B_DELWRI) bp->b_flags &= ~B_RELBUF; - else if (buf_vm_page_count_severe()) { - /* - * BKGRDINPROG can only be set with the buf and bufobj - * locks both held. We tolerate a race to clear it here. - */ - if (!(bp->b_vflags & BV_BKGRDINPROG)) - bp->b_flags |= B_RELBUF; - } /* * VMIO buffer rundown. It is not very necessary to keep a VMIO buffer @@ -1875,20 +1855,6 @@ bqrelse(struct buf *bp) if ((bp->b_flags & B_DELWRI) == 0 && (bp->b_xflags & BX_VNDIRTY)) panic("bqrelse: not dirty"); - /* - * BKGRDINPROG can only be set with the buf and bufobj - * locks both held. We tolerate a race to clear it here. - */ - if (buf_vm_page_count_severe() && - (bp->b_vflags & BV_BKGRDINPROG) == 0) { - /* - * We are too low on memory, we have to try to free - * the buffer (most importantly: the wired pages - * making up its backing store) *now*. - */ - brelse(bp); - return; - } qindex = QUEUE_CLEAN; } binsfree(bp, qindex); @@ -1934,8 +1900,6 @@ vfs_vmio_release(struct buf *bp) vm_page_free(m); } else if (bp->b_flags & B_DIRECT) vm_page_try_to_free(m); - else if (buf_vm_page_count_severe()) - vm_page_try_to_cache(m); vm_page_unlock(m); } if (obj != NULL)