From owner-svn-src-head@freebsd.org Thu Nov 26 19:12:19 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 BBEC8A3AD9C; Thu, 26 Nov 2015 19:12:19 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 89C801233; Thu, 26 Nov 2015 19:12:19 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAQJCIl7020859; Thu, 26 Nov 2015 19:12:18 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAQJCIgU020858; Thu, 26 Nov 2015 19:12:18 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201511261912.tAQJCIgU020858@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Thu, 26 Nov 2015 19:12:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291370 - head/sys/vm 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, 26 Nov 2015 19:12:19 -0000 Author: alc Date: Thu Nov 26 19:12:18 2015 New Revision: 291370 URL: https://svnweb.freebsd.org/changeset/base/291370 Log: Correct an error in vm_reserv_reclaim_contig(). In the highly unusual case that the reservation contained "low", the starting position in the popmap for the free page search was incorrectly calculated. The most likely (and visible) symptom of this error was the assertion failure, "vm_reserv_reclaim_contig: pa is too low". Modified: head/sys/vm/vm_reserv.c Modified: head/sys/vm/vm_reserv.c ============================================================================== --- head/sys/vm/vm_reserv.c Thu Nov 26 18:56:21 2015 (r291369) +++ head/sys/vm/vm_reserv.c Thu Nov 26 19:12:18 2015 (r291370) @@ -971,7 +971,7 @@ vm_reserv_reclaim_contig(u_long npages, { vm_paddr_t pa, size; vm_reserv_t rv; - int hi, i, lo, next_free; + int hi, i, lo, low_index, next_free; mtx_assert(&vm_page_queue_free_mtx, MA_OWNED); if (npages > VM_LEVEL_0_NPAGES - 1) @@ -990,8 +990,9 @@ vm_reserv_reclaim_contig(u_long npages, } if (pa < low) { /* Start the search for free pages at "low". */ - i = (low - pa) / NBPOPMAP; - hi = (low - pa) % NBPOPMAP; + low_index = (low + PAGE_MASK - pa) >> PAGE_SHIFT; + i = low_index / NBPOPMAP; + hi = low_index % NBPOPMAP; } else i = hi = 0; do {