From nobody Wed Oct 27 13:56:16 2021 X-Original-To: dev-commits-src-branches@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 118D3181918F; Wed, 27 Oct 2021 13:56:17 +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 4HfVbN6wYbz4YdJ; Wed, 27 Oct 2021 13:56:16 +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 C2E6A11964; Wed, 27 Oct 2021 13:56:16 +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 19RDuGvS062992; Wed, 27 Oct 2021 13:56:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19RDuGP7062991; Wed, 27 Oct 2021 13:56:16 GMT (envelope-from git) Date: Wed, 27 Oct 2021 13:56:16 GMT Message-Id: <202110271356.19RDuGP7062991@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 74efe421ea04 - stable/13 - vm_page: Move vm_page_alloc_check() to after page allocator definitions List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 74efe421ea041b1e948041d460bbeb65ea1a3748 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=74efe421ea041b1e948041d460bbeb65ea1a3748 commit 74efe421ea041b1e948041d460bbeb65ea1a3748 Author: Mark Johnston AuthorDate: 2021-10-20 01:22:50 +0000 Commit: Mark Johnston CommitDate: 2021-10-27 13:53:29 +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. Sponsored by: The FreeBSD Foundation (cherry picked from commit a23e6a1078d6d6c361481ab4f835449f177edac3) --- 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 9ca18129f415..b5c29b27bc2a 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) {