From owner-svn-src-all@freebsd.org Fri Oct 25 16:59:55 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B70CB175817; Fri, 25 Oct 2019 16:59:55 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4709Mb4NW9z3GqS; Fri, 25 Oct 2019 16:59:55 +0000 (UTC) (envelope-from glebius@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 76901295C4; Fri, 25 Oct 2019 16:59:55 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9PGxtxM076417; Fri, 25 Oct 2019 16:59:55 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9PGxtLX076416; Fri, 25 Oct 2019 16:59:55 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201910251659.x9PGxtLX076416@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 25 Oct 2019 16:59:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354083 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 354083 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Oct 2019 16:59:55 -0000 Author: glebius Date: Fri Oct 25 16:59:54 2019 New Revision: 354083 URL: https://svnweb.freebsd.org/changeset/base/354083 Log: Add couple more assertions to vm_pager_assert_in(). The bogus page is not allowed at ends of the request, and all non-bogus pages must be consecutive. Reviewed by: kib Modified: head/sys/vm/vm_pager.c Modified: head/sys/vm/vm_pager.c ============================================================================== --- head/sys/vm/vm_pager.c Fri Oct 25 16:30:24 2019 (r354082) +++ head/sys/vm/vm_pager.c Fri Oct 25 16:59:54 2019 (r354083) @@ -257,15 +257,20 @@ vm_pager_assert_in(vm_object_t object, vm_page_t *m, i { #ifdef INVARIANTS - VM_OBJECT_ASSERT_WLOCKED(object); - KASSERT(count > 0, ("%s: 0 count", __func__)); /* - * All pages must be busied, not mapped, not fully valid, - * not dirty and belong to the proper object. + * All pages must be consecutive, busied, not mapped, not fully valid, + * not dirty and belong to the proper object. Some pages may be the + * bogus page, but the first and last pages must be a real ones. */ + + VM_OBJECT_ASSERT_WLOCKED(object); + KASSERT(count > 0, ("%s: 0 count", __func__)); for (int i = 0 ; i < count; i++) { - if (m[i] == bogus_page) + if (m[i] == bogus_page) { + KASSERT(i != 0 && i != count - 1, + ("%s: page %d is the bogus page", __func__, i)); continue; + } vm_page_assert_xbusied(m[i]); KASSERT(!pmap_page_is_mapped(m[i]), ("%s: page %p is mapped", __func__, m[i])); @@ -275,6 +280,8 @@ vm_pager_assert_in(vm_object_t object, vm_page_t *m, i ("%s: page %p is dirty", __func__, m[i])); KASSERT(m[i]->object == object, ("%s: wrong object %p/%p", __func__, object, m[i]->object)); + KASSERT(m[i]->pindex == m[0]->pindex + i, + ("%s: page %p isn't consecutive", __func__, m[i])); } #endif }