From nobody Wed Oct 20 01:23:14 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 491DC180F9C4; Wed, 20 Oct 2021 01:23:15 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HYtCl1XYVz3lgJ; Wed, 20 Oct 2021 01:23:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 155CB1E9D4; Wed, 20 Oct 2021 01:23:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19K1NEFY095439; Wed, 20 Oct 2021 01:23:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19K1NEvq095438; Wed, 20 Oct 2021 01:23:14 GMT (envelope-from git) Date: Wed, 20 Oct 2021 01:23:14 GMT Message-Id: <202110200123.19K1NEvq095438@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: a23e6a1078d6 - main - vm_page: Move vm_page_alloc_check() to after page allocator definitions List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a23e6a1078d6d6c361481ab4f835449f177edac3 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=a23e6a1078d6d6c361481ab4f835449f177edac3 commit a23e6a1078d6d6c361481ab4f835449f177edac3 Author: Mark Johnston AuthorDate: 2021-10-20 01:22:50 +0000 Commit: Mark Johnston CommitDate: 2021-10-20 01:22:50 +0000 vm_page: Move vm_page_alloc_check() to after page allocator definitions This way all of the vm_page_alloc_*() allocator functions are grouped together. MFC after: 1 week Sponsored by: The FreeBSD Foundation --- sys/vm/vm_page.c | 43 +++++++++++++++++++++---------------------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index 25e6dce32aa6..bc1c6bbe4ce1 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -2394,28 +2394,6 @@ found: return (m_ret); } -/* - * Check a page that has been freshly dequeued from a freelist. - */ -static void -vm_page_alloc_check(vm_page_t m) -{ - - KASSERT(m->object == NULL, ("page %p has object", m)); - KASSERT(m->a.queue == PQ_NONE && - (m->a.flags & PGA_QUEUE_STATE_MASK) == 0, - ("page %p has unexpected queue %d, flags %#x", - m, m->a.queue, (m->a.flags & PGA_QUEUE_STATE_MASK))); - KASSERT(m->ref_count == 0, ("page %p has references", m)); - KASSERT(vm_page_busy_freed(m), ("page %p is not freed", m)); - KASSERT(m->dirty == 0, ("page %p is dirty", m)); - KASSERT(pmap_page_get_memattr(m) == VM_MEMATTR_DEFAULT, - ("page %p has unexpected memattr %d", - m, pmap_page_get_memattr(m))); - KASSERT(m->valid == 0, ("free page %p is valid", m)); - pmap_vm_page_alloc_check(m); -} - /* * vm_page_alloc_freelist: * @@ -2494,6 +2472,27 @@ again: return (m); } +/* + * Check a page that has been freshly dequeued from a freelist. + */ +static void +vm_page_alloc_check(vm_page_t m) +{ + KASSERT(m->object == NULL, ("page %p has object", m)); + KASSERT(m->ref_count == 0, ("page %p has references", m)); + KASSERT(vm_page_busy_freed(m), ("page %p is not freed", m)); + KASSERT(m->a.queue == PQ_NONE && + (m->a.flags & PGA_QUEUE_STATE_MASK) == 0, + ("page %p has unexpected queue %d, flags %#x", + m, m->a.queue, (m->a.flags & PGA_QUEUE_STATE_MASK))); + KASSERT(m->valid == 0, ("free page %p is valid", m)); + KASSERT(m->dirty == 0, ("page %p is dirty", m)); + KASSERT(pmap_page_get_memattr(m) == VM_MEMATTR_DEFAULT, + ("page %p has unexpected memattr %d", + m, pmap_page_get_memattr(m))); + pmap_vm_page_alloc_check(m); +} + static int vm_page_zone_import(void *arg, void **store, int cnt, int domain, int flags) {