From nobody Mon Jul 29 01:50:00 2024 X-Original-To: dev-commits-src-all@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 4WXLs52FxWz5S7R1; Mon, 29 Jul 2024 01:50:01 +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 4WXLs45xlYz4ng9; Mon, 29 Jul 2024 01:50:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722217800; 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=xiXFhu0J5fO+FSEiSh4CwvtvvN8nrk8brD3GyqodI+k=; b=fk/5azIvwzvVafRQZRfhjtxGpX/oVJayy4EHVtXLevqldPU7o/TeDrcWdl/9+nkjwt/Bfx AU6UtyUJlXFUjgSy+/5lVY1kQr3soVXrNnZoyCfOFQ4CA4pMDzqSQtNeUJPAH6mx+T7kJV UfMZLtb8xboKtl44l+dI4UUNQwfyMija/Ro6Uw6Eddvs8vnhF85OeDzUFKIquG1f8ZwJWW UqPhRK1zKKdCK5LOISy9oZwYxxkHvkWz6ZYvXYMwxk85WqkwOojkmGNkb02EMnmcG+Z7FZ qB94MoJaqmCvCDXxvxMxAcvdLyHFjdWbJu9Gj/taZG4DFNfEddv5ZhZKPbJ6eg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722217800; a=rsa-sha256; cv=none; b=ETeADLVigWbvBNc0WH+MHfBTr0quPs21iemj6/HjJwfN034CFW0/Ae5pfON2rYB/VH2B+u WaiDAt1+HkkVw2Wh+5MNxHHb1/bsazUj1RAJUwWqBOrPBz/5J96SITuCm5znKSusx4BwNU F3cfkQhkwVybXn001iJznFx3Urco/GYmdT6d8uQCMxfwrV+8sf0wKcaP9c3859TMTja6LF MJtufaetp8VvWT48v5QK7lVSP3NzQ2ne6/uwOlbwuNvsUbgcYzCxRQSdvphayQtQwqWdxv 1Mq1S/QxgOcZ3Qy7xeT5B5AvBmp++2AhSOu5SobFVbuPa3mAg6J+mGUPfdIVUw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722217800; 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=xiXFhu0J5fO+FSEiSh4CwvtvvN8nrk8brD3GyqodI+k=; b=R2OKmZ0JY7NnKaVGiqY6FvKYrx4Cdkm6BGEHpjwuhlLGltCQKvR6dW7fmRRN0IOMxIdpKz eq5a2/nsL6E0GVKo3i4gLnuPBoNZVWuwVl2THLFWv69PErGsRQ924Zi3xezHkV5lpHhb4o fbo5He9o5OUEczvwgfdt5S25Bm16u3v0Ru+C2lf5XlKiJ2nXmtzl2Wl3DwrwE3kk7FeSiZ TXmBPfZPy1w0/CUxX5u74PTNpZf81Yhv5LBhZEVzAZf+n06G3BFQ62937oBNxUSYiID1Jt rjDWBjYL3CCFtxeDFqp6CetqnehQZyDgd9A/IR/eJ14ezfxvAmMQlMd8o/7KIg== 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 4WXLs45ScfzF8M; Mon, 29 Jul 2024 01:50:00 +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 46T1o018093495; Mon, 29 Jul 2024 01:50:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46T1o000093473; Mon, 29 Jul 2024 01:50:00 GMT (envelope-from git) Date: Mon, 29 Jul 2024 01:50:00 GMT Message-Id: <202407290150.46T1o000093473@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: 235750ee5130 - main - vm: Remove kernel stack swapping support, part 8 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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: 235750ee5130aa71cf4151457435e806dd58f2ec Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=235750ee5130aa71cf4151457435e806dd58f2ec commit 235750ee5130aa71cf4151457435e806dd58f2ec Author: Mark Johnston AuthorDate: 2024-07-29 01:41:26 +0000 Commit: Mark Johnston CommitDate: 2024-07-29 01:43:59 +0000 vm: Remove kernel stack swapping support, part 8 - The kernel stack objects do not need to be pageable, so use OBJT_PHYS objects instead. The main difference is that mappings do not require PV entries. - Make some externally visible functions, relating to kernel thread stack internals, private to vm_glue.c, as their external consumers are now gone. Tested by: pho Reviewed by: alc, kib Differential Revision: https://reviews.freebsd.org/D46119 --- sys/vm/vm_extern.h | 4 ---- sys/vm/vm_glue.c | 17 ++++++++++------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/sys/vm/vm_extern.h b/sys/vm/vm_extern.h index 8c9addda1196..93ec6014c27d 100644 --- a/sys/vm/vm_extern.h +++ b/sys/vm/vm_extern.h @@ -127,10 +127,6 @@ struct sf_buf *vm_imgact_map_page(vm_object_t object, vm_ooffset_t offset); void vm_imgact_unmap_page(struct sf_buf *sf); void vm_thread_dispose(struct thread *td); int vm_thread_new(struct thread *td, int pages); -vm_pindex_t vm_kstack_pindex(vm_offset_t ks, int npages); -vm_object_t vm_thread_kstack_size_to_obj(int npages); -int vm_thread_stack_back(vm_offset_t kaddr, vm_page_t ma[], int npages, - int req_class, int domain); u_int vm_active_count(void); u_int vm_inactive_count(void); u_int vm_laundry_count(void); diff --git a/sys/vm/vm_glue.c b/sys/vm/vm_glue.c index 63417687a1a5..2627ee75dbff 100644 --- a/sys/vm/vm_glue.c +++ b/sys/vm/vm_glue.c @@ -56,7 +56,6 @@ * rights to redistribute these changes. */ -#include #include "opt_vm.h" #include "opt_kstack_pages.h" #include "opt_kstack_max_pages.h" @@ -101,7 +100,6 @@ #include #include #include -#include #include #include @@ -280,6 +278,11 @@ static uma_zone_t kstack_cache; static int kstack_cache_size; static vmem_t *vmd_kstack_arena[MAXMEMDOM]; +static vm_pindex_t vm_kstack_pindex(vm_offset_t ks, int npages); +static vm_object_t vm_thread_kstack_size_to_obj(int npages); +static int vm_thread_stack_back(vm_offset_t kaddr, vm_page_t ma[], int npages, + int req_class, int domain); + static int sysctl_kstack_cache_size(SYSCTL_HANDLER_ARGS) { @@ -577,7 +580,7 @@ vm_thread_dispose(struct thread *td) * Uses a non-identity mapping if guard pages are * active to avoid pindex holes in the kstack object. */ -vm_pindex_t +static vm_pindex_t vm_kstack_pindex(vm_offset_t ks, int kpages) { vm_pindex_t pindex = atop(ks - VM_MIN_KERNEL_ADDRESS); @@ -604,7 +607,7 @@ vm_kstack_pindex(vm_offset_t ks, int kpages) * Allocate physical pages, following the specified NUMA policy, to back a * kernel stack. */ -int +static int vm_thread_stack_back(vm_offset_t ks, vm_page_t ma[], int npages, int req_class, int domain) { @@ -643,7 +646,7 @@ cleanup: return (ENOMEM); } -vm_object_t +static vm_object_t vm_thread_kstack_size_to_obj(int npages) { return (npages == kstack_pages ? kstack_object : kstack_alt_object); @@ -686,7 +689,7 @@ kstack_cache_init(void *null) vm_size_t kstack_quantum; int domain; - kstack_object = vm_object_allocate(OBJT_SWAP, + kstack_object = vm_object_allocate(OBJT_PHYS, atop(VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS)); kstack_cache = uma_zcache_create("kstack_cache", kstack_pages * PAGE_SIZE, NULL, NULL, NULL, NULL, @@ -695,7 +698,7 @@ kstack_cache_init(void *null) kstack_cache_size = imax(128, mp_ncpus * 4); uma_zone_set_maxcache(kstack_cache, kstack_cache_size); - kstack_alt_object = vm_object_allocate(OBJT_SWAP, + kstack_alt_object = vm_object_allocate(OBJT_PHYS, atop(VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS)); kstack_quantum = vm_thread_kstack_import_quantum();