From nobody Sun Jul 17 11:24:17 2022 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 4Lm2md5Hpbz4T2PK; Sun, 17 Jul 2022 11:24: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 4Lm2md4qJhz3PXW; Sun, 17 Jul 2022 11:24:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658057057; 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=9SjKqjAjSdmR1nao7E4ckzXysGkupWsu0HgEmIge+6o=; b=MwAB5fR4gC2wi85LdCAsQI/HU7681MAytM70gDDUk38MnZmVJv+z7/9DZ75P2cX8J/kaMy B8nD/ujmDG0R4uh+F9pZMypteUgtb4IWSK30RbTySQx+jKWrSWDmG2Q8q8IRR72OB9WBsS BST8KvKkGf6RcOkViIgqeX3rw1Ok7fGT2UQVUduQKXL3sbsqJEaseDi3B+fwTNkUIe99jv qOEkN+Sxx3rbRjkdTzC9Uwrayl9znOE3f8LXiVrIdCalfK0qphhba6nM+Tl8E9JI0UsGTg JJVWMn83hpwj4iZpNSOmEBqEeXJDH/v4CZF2ArwZEG4x4iwhkR6rIdRCnVgHiQ== 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 4Lm2md3lrMzyY4; Sun, 17 Jul 2022 11:24:17 +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 26HBOHEp014227; Sun, 17 Jul 2022 11:24:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 26HBOH0O014226; Sun, 17 Jul 2022 11:24:17 GMT (envelope-from git) Date: Sun, 17 Jul 2022 11:24:17 GMT Message-Id: <202207171124.26HBOH0O014226@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: fffc1c594a73 - main - vm_object: Release object swap charge in the swap pager destructor 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: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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: fffc1c594a7382ae4da963dfa9901e549cfa5e9d Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658057057; 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=9SjKqjAjSdmR1nao7E4ckzXysGkupWsu0HgEmIge+6o=; b=YMMgn6xpIgYYvADO6DHwXgwSek6PG8QoFNvAQG/hctHo6RDe2fnx/CrV2f8y/tE9GCRZTl Av3feVsP7LC1fw+b7zfOL7cqsvsJeZj7kEIgiavdsvmeNhbxnESu3vVscA6gzRiA1cTX+W pcWQE3e9mEsP0kwdYZXRph7PO7Ykijno6/kGUEgFVILNfykzpXn+WFmQgDiFKDq0RC/0Qb oYjw/7G44QZTlyyh4mlJwpHcCzDaRNebaygNnSw68NWu1S1fECmJ/HozVU+kTz47qh9SFB qKaQflv4LF1j7C91CRYTPwCLOeF8pJNjsqYsW2SNRKQXbTJWiCCFvoZNeIPBIw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1658057057; a=rsa-sha256; cv=none; b=LRs0q0j1LVwvlafFbVefdTwzPs62AdeDoTJcXYJViPagO9UIauAD0OY1ou60vliKLiIUw1 RSg3Tcml110+SFLxhq3SrRwTvehJrv4R0RV74U3axcWqxMRmuaIDrrT5unyPXoKV7WGMkj lZ+OGv74aav5fuLkJXJ5LO1NpHnmCcrtEKAztGNyOh2uGWdL3D2qh38XjPqOHYEGSkpwZ5 smbkcq0rHEW7ACDrZTLv+asw4OkrsF7+1zktJTwj3V5cEUsCnB4S9qAkTykseKvTbAaTDF 5StZDfSP3d46YMU519A8X/bs38X5bUTAWhUVNjl1xgLalqhQl+aZlWaCAx4VNw== 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=fffc1c594a7382ae4da963dfa9901e549cfa5e9d commit fffc1c594a7382ae4da963dfa9901e549cfa5e9d Author: Mark Johnston AuthorDate: 2022-07-16 15:28:55 +0000 Commit: Mark Johnston CommitDate: 2022-07-17 11:09:48 +0000 vm_object: Release object swap charge in the swap pager destructor With the removal of OBJT_DEFAULT, we can simply handle this in swap_pager_dealloc(). No functional change intended. Suggested by: alc Reviewed by: alc, kib Tested by: pho Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D35787 --- sys/vm/swap_pager.c | 14 ++++++++++++++ sys/vm/vm_object.c | 18 ------------------ 2 files changed, 14 insertions(+), 18 deletions(-) diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c index 931659f1891b..c20360975c4b 100644 --- a/sys/vm/swap_pager.c +++ b/sys/vm/swap_pager.c @@ -787,6 +787,20 @@ swap_pager_dealloc(vm_object_t object) swp_pager_meta_free_all(object); object->handle = NULL; object->type = OBJT_DEAD; + + /* + * Release the allocation charge. + */ + if (object->cred != NULL) { + swap_release_by_cred(object->charge, object->cred); + object->charge = 0; + crfree(object->cred); + object->cred = NULL; + } + + /* + * Hide the object from swap_pager_swapoff(). + */ vm_object_clear_flag(object, OBJ_SWAP); } diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c index 57904454eff7..bb29568ab5e4 100644 --- a/sys/vm/vm_object.c +++ b/sys/vm/vm_object.c @@ -702,27 +702,9 @@ vm_object_deallocate(vm_object_t object) } } -/* - * vm_object_destroy removes the object from the global object list - * and frees the space for the object. - */ void vm_object_destroy(vm_object_t object) { - - /* - * Release the allocation charge. - */ - if (object->cred != NULL) { - swap_release_by_cred(object->charge, object->cred); - object->charge = 0; - crfree(object->cred); - object->cred = NULL; - } - - /* - * Free the space for the object. - */ uma_zfree(obj_zone, object); }