From nobody Fri Aug 12 23:53:17 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 4M4L8s5DDWz4Ytml; Fri, 12 Aug 2022 23:53: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 4M4L8s4hZCz4Nwy; Fri, 12 Aug 2022 23:53:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1660348397; 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=eulwPITB/Sg2GZjKtdyd2uMH53g6Kjd5cUaOGS8zNdM=; b=EL03i+kHqVFseS7mMVakhxqDaa7c8K3eQ0Xq7K5h326STtc2P08e8p9a1FyEdIlGu1/dCB mboWoLfCvRUr/n6fkfuj9v16G3/E1CbC4nXB5IaOgPbk7qNpx7EayZkHdvq2aV/7L4Q9e0 4himWpPaeyNsamWzb4pL9ciqPrVwK9ieFYZRmKt0NKRkniVloTEmD7lzpdOoTFmoHROdW5 fZkANnl2mTnMrfRMuDY4uKoBKGkCYFkh3dV9HUgkjJi9wAFduny4x+GtGcnAnfPp4AQtJF dHL+iSl6sD5Mb8hCFQd9qakksLsSnC/Jic1hBaxzxpNityRemINsNSU5F0+fug== 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 4M4L8s3l1qzrDR; Fri, 12 Aug 2022 23:53: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 27CNrHnk020121; Fri, 12 Aug 2022 23:53:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 27CNrHHN020120; Fri, 12 Aug 2022 23:53:17 GMT (envelope-from git) Date: Fri, 12 Aug 2022 23:53:17 GMT Message-Id: <202208122353.27CNrHHN020120@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Colin Percival Subject: git: b9fd884a8d0b - main - sys/vm: Add TSLOG to some functions 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: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b9fd884a8d0b249f77519a2c7f156b786fcc1c62 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1660348397; 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=eulwPITB/Sg2GZjKtdyd2uMH53g6Kjd5cUaOGS8zNdM=; b=gLow+ExROOg7wkcAD+6I5WgKZIzJ/gzY7yYT+P/Ie+VbENOD6o2jL+StinK+omEfQegaPq lCnjYeOFnzipJBlO2wQCFLNulLlWklEIFpAkMGfbTeS+g9UkIbqH9j9jUz7f3EhwbifJcZ 7VsomlS4bTEJdVet6BPrpoI42MOvc7vGOsE/abws81gWwOgS9rR0jkKLZRwut7tz9JH7nV NZOR1ukUJhYu1gCZ3LYxsNnWZQhdI+SFnC38hfSp8eReL9sIhjgUROMmRZvjFlDjMUjWCY ry0Lg7VVuUIu06YqV4fFoZ3TpYYJSz1zcYc+8ub9R8LBcVZ8I2FZJmmxPiwk1w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1660348397; a=rsa-sha256; cv=none; b=Kmyzb4R1/Zy5gTyCwEBbm1ZqTrNnDhwDEFKbzu21NuSODdtpb+3IoXYeTB7Ri23RubkQ2J A42346gqP+rUciog+XyYbJzWab8B3grcUQhzk/OvYFDSG31GGU+9mzWKdFMD449RRGftNT xfWf1gvXZPmd1DwHZjafDRQyaeNHcfd1QO5xso5LFHYKHnACqknNLol0AR48Zba8a7QRI1 85hgIUw0elCimYYHMGB3D/zefFzqh0p+yLzcDc85d1tDIo2rx4bnIXwAuBlSazvKofrhKO 8dI+UaXMRHf98amayrOIPcW4b2e/2PBYnJOrhSZJo5cHE1tKmtAE1DDAmVz6cw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=b9fd884a8d0b249f77519a2c7f156b786fcc1c62 commit b9fd884a8d0b249f77519a2c7f156b786fcc1c62 Author: Colin Percival AuthorDate: 2022-08-12 23:52:47 +0000 Commit: Colin Percival CommitDate: 2022-08-12 23:53:04 +0000 sys/vm: Add TSLOG to some functions The functions pbuf_init, kva_alloc, and keg_alloc_slab are significant contributors to the kernel boot time when FreeBSD boots inside the Firecracker VMM. Instrument them so they show up on flamecharts. --- sys/vm/uma_core.c | 3 +++ sys/vm/vm_kern.c | 2 ++ sys/vm/vm_pager.c | 4 ++++ 3 files changed, 9 insertions(+) diff --git a/sys/vm/uma_core.c b/sys/vm/uma_core.c index 1afcb45c4d2b..1351a54345d9 100644 --- a/sys/vm/uma_core.c +++ b/sys/vm/uma_core.c @@ -1762,6 +1762,8 @@ keg_alloc_slab(uma_keg_t keg, uma_zone_t zone, int domain, int flags, uint8_t sflags; int i; + TSENTER(); + KASSERT(domain >= 0 && domain < vm_ndomains, ("keg_alloc_slab: domain %d out of range", domain)); @@ -1858,6 +1860,7 @@ keg_alloc_slab(uma_keg_t keg, uma_zone_t zone, int domain, int flags, dom->ud_pages += keg->uk_ppera; dom->ud_free_items += keg->uk_ipers; + TSEXIT(); return (slab); fail: diff --git a/sys/vm/vm_kern.c b/sys/vm/vm_kern.c index ac132f8ec0f3..7a61a29c81a4 100644 --- a/sys/vm/vm_kern.c +++ b/sys/vm/vm_kern.c @@ -148,9 +148,11 @@ kva_alloc(vm_size_t size) { vm_offset_t addr; + TSENTER(); size = round_page(size); if (vmem_alloc(kernel_arena, size, M_BESTFIT | M_NOWAIT, &addr)) return (0); + TSEXIT(); return (addr); } diff --git a/sys/vm/vm_pager.c b/sys/vm/vm_pager.c index 2f8afd69a1b4..cc0be174987d 100644 --- a/sys/vm/vm_pager.c +++ b/sys/vm/vm_pager.c @@ -495,6 +495,8 @@ pbuf_init(void *mem, int size, int flags) { struct buf *bp = mem; + TSENTER(); + bp->b_kvabase = (void *)kva_alloc(ptoa(PBUF_PAGES)); if (bp->b_kvabase == NULL) return (ENOMEM); @@ -504,6 +506,8 @@ pbuf_init(void *mem, int size, int flags) bp->b_rcred = bp->b_wcred = NOCRED; bp->b_xflags = 0; + TSEXIT(); + return (0); }