From nobody Tue Jul 12 13:10:38 2022 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 E42D41CF9C31; Tue, 12 Jul 2022 13:10:38 +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 4Lj1Mf5ySJz3x8x; Tue, 12 Jul 2022 13:10:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1657631438; 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=rPca7/1lNkWTf+iMCZqj4QE+gRlxrWYYZ7KE4s/755s=; b=G7zsjy8zAtbuPIJnQfjrHKxr3CHhx2IuL2I7p8Yuel3yHWeoyJ7E+XngKPV8nf+ZDurLvR yTm9chCAv27bH+dHBH3XvaB9im+8k16Elbg+VfYjpBp0UZ0xSwpHp5ro3wntfmRnxfOMrI irpmMqV2oYcMxEC0if6LFgwSynIceKUDJCD6+BvsjmPmKvxOIezRCj0zytDH6jBRDGR+SX iT+YdfBCWECv7ekmBw+ScWJqkRTeyB03HhRbhwntXUpLoxgiai8FHSBowoaSs+o11W3Ret cunmVU6qwl+n5Tex0f3m1UBJgkfJybEYFTAK1VdTGUHE+sub4OJWiQ2WpE5gvA== 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 4Lj1Mf51mnzl1C; Tue, 12 Jul 2022 13:10:38 +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 26CDAcCr009857; Tue, 12 Jul 2022 13:10:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 26CDAcrS009856; Tue, 12 Jul 2022 13:10:38 GMT (envelope-from git) Date: Tue, 12 Jul 2022 13:10:38 GMT Message-Id: <202207121310.26CDAcrS009856@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: 6b3897408521 - main - vm_object: Modify various drivers to allocate OBJT_SWAP objects 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: 6b38974085215bcd787be0d138411ec57cf0096e Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1657631438; 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=rPca7/1lNkWTf+iMCZqj4QE+gRlxrWYYZ7KE4s/755s=; b=E+ZcQVsEg6tJz6mAbbfsfXtDR0uUYE51xP8E5LVXRpIEm5Vys8rTvHzv/vl/WF/MZ3Eyry whSF4WcVeTVygiYRPbqaPJFhhwsreri3Qx03duTwchyv7OXI2DMvt2l3j9u/hUJCCcbOy6 D0l5xRGltOzf5pv9MjkoNeuB01X9lwW3x0TKZ/Ij8jVYOiFGryDymevQq2GR4KjISkrUAT 6u6eCbIWsix4y+9ztZP92/xjHq8txgp1snWdo4DF7vgm43UsAifJo5sB0glyN5IEEKDr98 dmqfpONG62cqae++WPS9AI/VxoOBBVYX44pdP3ZaHVUXO3n5iNPXOq36qAHqYg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1657631438; a=rsa-sha256; cv=none; b=RWiUD39nLRVB2ym2vKFd/Czkr2zoMwtJfX3Qb+V2dTFCEavU5ADEZ9Xs8HqE/KMeA8hqmd 1fIGG8v12F2h9Nsyq9bO3YOYgrE08xlkdUNkqfhnNptsoFuGM716c1X0ju3k3gmX8KoKjk 6yp09mRkyyetho+MhkS3FRkKbUX98BIsArZtcjwaw9SzVJbbmkwpDMTpK5W10Bt7lE+JiC TiDeDiyhWzGI59pcfsece2roRUIrZg84TfkE/iZNJhe3K6Bt5znfndWEYu1FLSBPvFrvCI 4t25jhQyygugxv1+hqi3koINCoEChr5mNL03u6bKt2wy8ZzuxmLc9BlIIiTh2g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=6b38974085215bcd787be0d138411ec57cf0096e commit 6b38974085215bcd787be0d138411ec57cf0096e Author: Mark Johnston AuthorDate: 2022-07-12 12:51:02 +0000 Commit: Mark Johnston CommitDate: 2022-07-12 13:10:15 +0000 vm_object: Modify various drivers to allocate OBJT_SWAP objects This is in preparation for removal of OBJT_DEFAULT. In particular, it is now cheap to check whether an OBJT_SWAP object has any swap blocks allocated, so the benefit of having a separate OBJT_DEFAULT type is quite marginal, and the OBJT_DEFAULT->SWAP transition is a source of bugs. Reviewed by: alc, hselasky, kib MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D35779 --- sys/amd64/vmm/vmm.c | 2 +- sys/compat/linuxkpi/common/src/linux_shmemfs.c | 2 +- sys/dev/agp/agp.c | 2 +- sys/dev/agp/agp_i810.c | 2 +- sys/dev/drm2/drm_gem.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/amd64/vmm/vmm.c b/sys/amd64/vmm/vmm.c index 47299301f5f0..94f99fdb4f1a 100644 --- a/sys/amd64/vmm/vmm.c +++ b/sys/amd64/vmm/vmm.c @@ -697,7 +697,7 @@ vm_alloc_memseg(struct vm *vm, int ident, size_t len, bool sysmem) return (EINVAL); } - obj = vm_object_allocate(OBJT_DEFAULT, len >> PAGE_SHIFT); + obj = vm_object_allocate(OBJT_SWAP, len >> PAGE_SHIFT); if (obj == NULL) return (ENOMEM); diff --git a/sys/compat/linuxkpi/common/src/linux_shmemfs.c b/sys/compat/linuxkpi/common/src/linux_shmemfs.c index ead9cc9d9f40..741bb20c1aab 100644 --- a/sys/compat/linuxkpi/common/src/linux_shmemfs.c +++ b/sys/compat/linuxkpi/common/src/linux_shmemfs.c @@ -84,7 +84,7 @@ linux_shmem_file_setup(const char *name, loff_t size, unsigned long flags) filp->f_count = 1; filp->f_vnode = vp; - filp->f_shmem = vm_pager_allocate(OBJT_DEFAULT, NULL, size, + filp->f_shmem = vm_pager_allocate(OBJT_SWAP, NULL, size, VM_PROT_READ | VM_PROT_WRITE, 0, curthread->td_ucred); if (filp->f_shmem == NULL) { error = -ENOMEM; diff --git a/sys/dev/agp/agp.c b/sys/dev/agp/agp.c index 39e9d5dd64e7..d61ae11f998f 100644 --- a/sys/dev/agp/agp.c +++ b/sys/dev/agp/agp.c @@ -514,7 +514,7 @@ agp_generic_alloc_memory(device_t dev, int type, vm_size_t size) mem->am_id = sc->as_nextid++; mem->am_size = size; mem->am_type = 0; - mem->am_obj = vm_object_allocate(OBJT_DEFAULT, atop(round_page(size))); + mem->am_obj = vm_object_allocate(OBJT_SWAP, atop(round_page(size))); mem->am_physical = 0; mem->am_offset = 0; mem->am_is_bound = 0; diff --git a/sys/dev/agp/agp_i810.c b/sys/dev/agp/agp_i810.c index 433d7d3f50c7..400e70a402c1 100644 --- a/sys/dev/agp/agp_i810.c +++ b/sys/dev/agp/agp_i810.c @@ -1744,7 +1744,7 @@ agp_i810_alloc_memory(device_t dev, int type, vm_size_t size) mem->am_size = size; mem->am_type = type; if (type != 1 && (type != 2 || size == AGP_PAGE_SIZE)) - mem->am_obj = vm_object_allocate(OBJT_DEFAULT, + mem->am_obj = vm_object_allocate(OBJT_SWAP, atop(round_page(size))); else mem->am_obj = 0; diff --git a/sys/dev/drm2/drm_gem.c b/sys/dev/drm2/drm_gem.c index 2692eb2499ae..7cfe09e46c01 100644 --- a/sys/dev/drm2/drm_gem.c +++ b/sys/dev/drm2/drm_gem.c @@ -111,7 +111,7 @@ int drm_gem_object_init(struct drm_device *dev, ("Bad size %ju", (uintmax_t)size)); obj->dev = dev; - obj->vm_obj = vm_pager_allocate(OBJT_DEFAULT, NULL, size, + obj->vm_obj = vm_pager_allocate(OBJT_SWAP, NULL, size, VM_PROT_READ | VM_PROT_WRITE, 0, curthread->td_ucred); obj->refcount = 1;