From nobody Sat Oct 19 20:24:52 2024 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 4XWCjc6j8Wz5Z14b; Sat, 19 Oct 2024 20:24:52 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XWCjc4qfcz4HG0; Sat, 19 Oct 2024 20:24:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729369492; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3+vb8z47+5/hvnxvms0DWaAihI7RPhH7Oq0TJs60tbI=; b=g9q0joZsf9eK/aFaW2PJLWozsG2gIUrC1kMycHCyqaC4Jdv51wo9SqzBoREDq38Vx3EYJI 6exT55NboAGRP5PiLDfEOHanrb5f7pLVQ43EXm8fbnRWpW7BfUB2INAEbr1t63WQ6rUYjN e9ZPQyih4KUI6E4gu5yTXCYG1LYY2X4ujSJgTBZ1XUvc/isAMPyKNU62rXCIAcfG70l2Qr Q3HiraE1U7yNYuNB20x0zZ8cc8lBUwE698/1CiZTJMwg4Z1W35XwXY1g05plensJHEh4u+ PhjDwyFfpt0yxpFhr29SVUkkmOfjm2WDuuN1gQi/+4KW7n+LA9f+Nqqfg6SbrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729369492; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3+vb8z47+5/hvnxvms0DWaAihI7RPhH7Oq0TJs60tbI=; b=VdlNKuDYnilQjSmjc7upc2O2uhkyK0Ez0z/Mjhp8iPHQx54rMpnPIh16lc1m9tcClfsCWq PtL6NEPCoO/v/MqhBgiFt0BRSC/P75fUyneky8bXNoyLJIeGhtdLYE+q3TpJnPZE/EyUn7 ryFAGeigGR+RocZvm6HlB6RqpMxjCTPYYstATXi0nyh6INonv4ZkiiMgBLDmiZphP8x0wy et2JWlvhk4JNym1pZUmJZd5pR2B64qZV0OW9fL30DktEaYj5yLoXa6Ore+t85Qzp9TjbVd IM68mp84XgCHf1rzro8U+Ydt3V4qqvLiyiQ1W8bTKy5BY3uBQgTxKU/aMDVWbQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1729369492; a=rsa-sha256; cv=none; b=g/M+3ZD2yvFigiqffpT1Pa4KEmHO/cMtkEXaOxlHSHd1eidaYyCUpsoSCP+Sn58pgOej3m YN1grwKQcRUVi9SEawm1YA+k4lKyFuORVmkczqfIu+H6Wuvf+xOlI0G8+aCtOVvQ7JANqO gnlnLJ+Bz4Df+X0tELleob1Qz7GBukXjT53OTgtrOlgoqHT7FJRmHFBjjb0dLdDsRxz/ix V6/0UzSote09KnOmEmotlYhRNVtrDrbv63aWlFGwUwQjEoubfhfElxweldXbA0jOmm7D42 9LwfTIqrUdmGgvlUdH8mdTeW0h0EWNJXp4zE/vCmrouDUJ048dRA5Nxcjivbiw== 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 4XWCjc4RDXzY2H; Sat, 19 Oct 2024 20:24:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49JKOqrL001133; Sat, 19 Oct 2024 20:24:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49JKOq5d001130; Sat, 19 Oct 2024 20:24:52 GMT (envelope-from git) Date: Sat, 19 Oct 2024 20:24:52 GMT Message-Id: <202410192024.49JKOq5d001130@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Doug Moore Subject: git: 6d42d5dbdd67 - main - vm_glue: use vm_page_alloc_domain_after 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dougm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6d42d5dbdd677c3422bdb3867770639f48c6df7a Auto-Submitted: auto-generated The branch main has been updated by dougm: URL: https://cgit.FreeBSD.org/src/commit/?id=6d42d5dbdd677c3422bdb3867770639f48c6df7a commit 6d42d5dbdd677c3422bdb3867770639f48c6df7a Author: Doug Moore AuthorDate: 2024-10-19 20:22:20 +0000 Commit: Doug Moore CommitDate: 2024-10-19 20:22:20 +0000 vm_glue: use vm_page_alloc_domain_after Drop the function vm_page_alloc_domain, used only in vm_thread_stack_back, and replace it with vm_page_alloc_domain_after there, with the extra mpred argument either computed on the first iteration or retrieved from previous iterations. Define a function vm_page_mpred() for computing that first mpred argument. Reviewed by: bnovkov Differential Revision: https://reviews.freebsd.org/D47054 --- sys/vm/vm_glue.c | 5 +++-- sys/vm/vm_page.c | 27 +++++++++++++++------------ sys/vm/vm_page.h | 2 +- 3 files changed, 19 insertions(+), 15 deletions(-) diff --git a/sys/vm/vm_glue.c b/sys/vm/vm_glue.c index 5128c46a1d9f..0090904785ab 100644 --- a/sys/vm/vm_glue.c +++ b/sys/vm/vm_glue.c @@ -623,8 +623,9 @@ vm_thread_stack_back(vm_offset_t ks, vm_page_t ma[], int npages, int req_class, m = vm_page_grab(obj, pindex + n, VM_ALLOC_NOCREAT | VM_ALLOC_WIRED); if (m == NULL) { - m = vm_page_alloc_domain(obj, pindex + n, domain, - req_class | VM_ALLOC_WIRED); + m = n > 0 ? ma[n - 1] : vm_page_mpred(obj, pindex); + m = vm_page_alloc_domain_after(obj, pindex + n, domain, + req_class | VM_ALLOC_WIRED, m); } if (m == NULL) break; diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index f2b3baf419a0..054832e3f19a 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -2013,6 +2013,18 @@ vm_page_rename(vm_page_t m, vm_object_t new_object, vm_pindex_t new_pindex) return (0); } +/* + * vm_page_mpred: + * + * Return the greatest page of the object with index <= pindex, + * or NULL, if there is none. Assumes object lock is held. + */ +vm_page_t +vm_page_mpred(vm_object_t object, vm_pindex_t pindex) +{ + return (vm_radix_lookup_le(&object->rtree, pindex)); +} + /* * vm_page_alloc: * @@ -2040,16 +2052,7 @@ vm_page_alloc(vm_object_t object, vm_pindex_t pindex, int req) { return (vm_page_alloc_after(object, pindex, req, - vm_radix_lookup_le(&object->rtree, pindex))); -} - -vm_page_t -vm_page_alloc_domain(vm_object_t object, vm_pindex_t pindex, int domain, - int req) -{ - - return (vm_page_alloc_domain_after(object, pindex, domain, req, - vm_radix_lookup_le(&object->rtree, pindex))); + vm_page_mpred(object, pindex))); } /* @@ -2390,7 +2393,7 @@ vm_page_alloc_contig_domain(vm_object_t object, vm_pindex_t pindex, int domain, object)); KASSERT(npages > 0, ("vm_page_alloc_contig: npages is zero")); - mpred = vm_radix_lookup_le(&object->rtree, pindex); + mpred = vm_page_mpred(object, pindex); KASSERT(mpred == NULL || mpred->pindex != pindex, ("vm_page_alloc_contig: pindex already allocated")); for (;;) { @@ -5073,7 +5076,7 @@ vm_page_grab_pages(vm_object_t object, vm_pindex_t pindex, int allocflags, pflags = vm_page_grab_pflags(allocflags); i = 0; retrylookup: - m = vm_radix_lookup_le(&object->rtree, pindex + i); + m = vm_page_mpred(object, pindex + i); if (m == NULL || m->pindex != pindex + i) { mpred = m; m = NULL; diff --git a/sys/vm/vm_page.h b/sys/vm/vm_page.h index c7c1ec3872a8..b85342b784de 100644 --- a/sys/vm/vm_page.h +++ b/sys/vm/vm_page.h @@ -606,8 +606,8 @@ void vm_page_free_zero(vm_page_t m); void vm_page_activate (vm_page_t); void vm_page_advise(vm_page_t m, int advice); +vm_page_t vm_page_mpred(vm_object_t, vm_pindex_t); vm_page_t vm_page_alloc(vm_object_t, vm_pindex_t, int); -vm_page_t vm_page_alloc_domain(vm_object_t, vm_pindex_t, int, int); vm_page_t vm_page_alloc_after(vm_object_t, vm_pindex_t, int, vm_page_t); vm_page_t vm_page_alloc_domain_after(vm_object_t, vm_pindex_t, int, int, vm_page_t);