From nobody Mon Nov 25 08:05:06 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 4XxdXz219mz5fS1s; Mon, 25 Nov 2024 08:05:07 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XxdXz00qxz4R1V; Mon, 25 Nov 2024 08:05:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1732521907; 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=13fJo04AUUVo40RTAV4swYbyfLjuB46B/Gk6X3wuZJI=; b=HPjUPZV+qT+05eP4I3hRgSKLjccPhwtkZaldTlDQGgaXrKcv+rUDgBj+w5MJDmsEmqBH4X TyN8SRqztIe7Vo6wLItHkno2f55G7SqYECZw7BPqrg/PYoTEifWSRtg/9fGiPbnOBNX1HJ ULyREYgJoTszNrWtJBwAks4329i6uq89+EgKrNS+BKoTvfXCmxYiIop7eDnFr1jUOGHKii cNM+EXZTdmN8dgq2eR8QgO6staiNnk3Tx9RIURVfu9w8BePu4K5qJTCAdYay5fWHU4/WiW /HyLL7cdqTSnVJ6TNmHcY8mzCTtNpOqjl+dLtGKigBNSuGwfioGUNuASHrrhig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1732521907; 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=13fJo04AUUVo40RTAV4swYbyfLjuB46B/Gk6X3wuZJI=; b=xgNXDqU8w6N/kkUbXrViGyBlBkhOCDqCazKaM8+kUeYW/8lBW7Wc0Tw/AOfM/HyAb7s5HK EkUJKj+aFz5VvT1oDN6P25hrnT/n6q9gD+WsXPm+e6JC3ca1nkEYfnY1MfImvDQLLGytbZ zZyhmXOViBc1KVDkxLBlul7LcPuJSsagYfWaZBxBR6/N+E7DDMcco851JHJk5TJap7rr/S RlxnENduqm3XgEsKUzTauzjRaUAPripIAdKmGXiC+V1RYuv3rbaYnqPKFpxFvhKBrEG8XV wi6SZXRjoYA4W0w6KDU5AmNwz4eLUvF/wJUocHq0suPsKMz3rlFVIS/OQuRuKw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1732521907; a=rsa-sha256; cv=none; b=BnNhoEiVCBzn2sO9tCVO21jJc/nlqRDpMYfeF7vPbL/K5zVOw/9FmjzVmjhjfFrqbk9YRr WZv3Sodnaet8HjZW0xiQbi0N/ir7vLz4gRIA4Ol+mMwli8i9RENNosN2X3kQD15df8e9GR 3DFtNcbydzoHz8cqydiebe64Z/lAn+NJFvaUsUhxnOJX4bDBtZvIZHbjN5URgJEhaOO+Bu US0W910Q93UOkQdZnHUXuT1R5mYXgwnlzBuI9o4QTlNjkrMZSkyR2roCDeFEE4DDK01IQu Ww5oIsQ7UkUE2csdRV13AD9oRKKg+ecNQ/aigNoE0DMnq1WKFFfohY9/VL4fpg== 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 4XxdXy6kz5zX6c; Mon, 25 Nov 2024 08:05:06 +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 4AP856ae051206; Mon, 25 Nov 2024 08:05:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4AP8564t051203; Mon, 25 Nov 2024 08:05:06 GMT (envelope-from git) Date: Mon, 25 Nov 2024 08:05:06 GMT Message-Id: <202411250805.4AP8564t051203@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: ff4c19bb5427 - main - vm_page: pass page to iter_free 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: ff4c19bb5427ca8e90f7354ff5601b985edf3f9e Auto-Submitted: auto-generated The branch main has been updated by dougm: URL: https://cgit.FreeBSD.org/src/commit/?id=ff4c19bb5427ca8e90f7354ff5601b985edf3f9e commit ff4c19bb5427ca8e90f7354ff5601b985edf3f9e Author: Doug Moore AuthorDate: 2024-11-25 08:03:34 +0000 Commit: Doug Moore CommitDate: 2024-11-25 08:03:34 +0000 vm_page: pass page to iter_free Pass the to-be-freed page to vm_page_iter_free as a parameter, rather than computing it from the iterator parameter, to improve performance. Sort declarations of page_iter functions in vm_page.h. Reviewed by: alc Differential Revision: https://reviews.freebsd.org/D47727 --- sys/vm/vm_kern.c | 2 +- sys/vm/vm_object.c | 2 +- sys/vm/vm_page.c | 8 +++----- sys/vm/vm_page.h | 8 ++++---- 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/sys/vm/vm_kern.c b/sys/vm/vm_kern.c index 6343fb66cfa3..a748a6c57d65 100644 --- a/sys/vm/vm_kern.c +++ b/sys/vm/vm_kern.c @@ -660,7 +660,7 @@ _kmem_unback(vm_object_t object, vm_offset_t addr, vm_size_t size) m = vm_page_iter_lookup(&pages, atop(offset))) { vm_page_xbusy_claim(m); vm_page_unwire_noq(m); - vm_page_iter_free(&pages); + vm_page_iter_free(&pages, m); } VM_OBJECT_WUNLOCK(object); diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c index 21773318cea0..84981d7cc7cd 100644 --- a/sys/vm/vm_object.c +++ b/sys/vm/vm_object.c @@ -2060,7 +2060,7 @@ wired: if ((options & OBJPR_NOTMAPPED) == 0 && object->ref_count != 0 && !vm_page_try_remove_all(p)) goto wired; - vm_page_iter_free(&pages); + vm_page_iter_free(&pages, p); } vm_object_pip_wakeup(object); diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index f82ca5e16c98..a37619c7743e 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -1713,14 +1713,12 @@ vm_page_free_object_prep(vm_page_t m) /* * vm_page_iter_free: * - * Free the current page, as identified by iterator. + * Free the given page, and use the iterator to remove it from the radix + * tree. */ void -vm_page_iter_free(struct pctrie_iter *pages) +vm_page_iter_free(struct pctrie_iter *pages, vm_page_t m) { - vm_page_t m; - - m = vm_radix_iter_page(pages); vm_radix_iter_remove(pages); vm_page_free_object_prep(m); vm_page_xunbusy(m); diff --git a/sys/vm/vm_page.h b/sys/vm/vm_page.h index 613896e77dd9..f641942efb87 100644 --- a/sys/vm/vm_page.h +++ b/sys/vm/vm_page.h @@ -602,7 +602,6 @@ bool vm_page_busy_sleep(vm_page_t m, const char *msg, int allocflags); void vm_page_busy_sleep_unlocked(vm_object_t obj, vm_page_t m, vm_pindex_t pindex, const char *wmesg, int allocflags); void vm_page_free(vm_page_t m); -void vm_page_iter_free(struct pctrie_iter *); void vm_page_free_zero(vm_page_t m); void vm_page_activate (vm_page_t); @@ -651,11 +650,13 @@ void vm_page_init_marker(vm_page_t marker, int queue, uint16_t aflags); void vm_page_init_page(vm_page_t m, vm_paddr_t pa, int segind, int pool); int vm_page_insert (vm_page_t, vm_object_t, vm_pindex_t); void vm_page_invalid(vm_page_t m); -void vm_page_launder(vm_page_t m); -vm_page_t vm_page_lookup(vm_object_t, vm_pindex_t); +void vm_page_iter_free(struct pctrie_iter *pages, vm_page_t m); void vm_page_iter_init(struct pctrie_iter *, vm_object_t); void vm_page_iter_limit_init(struct pctrie_iter *, vm_object_t, vm_pindex_t); vm_page_t vm_page_iter_lookup(struct pctrie_iter *, vm_pindex_t); +bool vm_page_iter_remove(struct pctrie_iter *pages); +void vm_page_launder(vm_page_t m); +vm_page_t vm_page_lookup(vm_object_t, vm_pindex_t); vm_page_t vm_page_lookup_unlocked(vm_object_t, vm_pindex_t); vm_page_t vm_page_next(vm_page_t m); void vm_page_pqbatch_drain(void); @@ -680,7 +681,6 @@ void vm_page_release(vm_page_t m, int flags); void vm_page_release_locked(vm_page_t m, int flags); vm_page_t vm_page_relookup(vm_object_t, vm_pindex_t); bool vm_page_remove(vm_page_t); -bool vm_page_iter_remove(struct pctrie_iter *); bool vm_page_remove_xbusy(vm_page_t); int vm_page_rename(struct pctrie_iter *, vm_object_t, vm_pindex_t); void vm_page_replace(vm_page_t mnew, vm_object_t object,