From nobody Tue Feb 13 07:05:09 2024 X-Original-To: fs@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 4TYsln5Kxrz59Xys for ; Tue, 13 Feb 2024 07:05:09 +0000 (UTC) (envelope-from bugzilla-noreply@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 4TYsln4DlPz4Zq0 for ; Tue, 13 Feb 2024 07:05:09 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1707807909; a=rsa-sha256; cv=none; b=XUn1nwvW9O8D4hopEfD3kqZbjHRKwzmKGDGLk1oXSLh3Q5/ku75pYjLZS4KhS0z0w9OiDI 3XhHWndsymcw+oIPLS/rzWxaMn6rECd+mKPpXlWsOGVDZ7ij7gr7Xbcs/Ncn8sxO6phSXa oRCVjRGqAbluJ7q+TGGGUhuZgEsndpDDP/yUQXSkFwfbGht73+ViqCq7A6kFF+q3q8nOG5 4693iQok8JjTQvZXdKo2fAX2939jaaTPdAqCQKGe57yeDJAcC9f9fIfV3zqNOemO1CG1HL tuWWgrWIy0dZHoPmFLfpaRlS45V1ujC/6WfLhBtFnWic+A7sAL/bSUWypbJIEw== 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=1707807909; 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: in-reply-to:in-reply-to:references:references; bh=hVb3LPC56H/eGAdRwfn4k3j2gYHGsRkfRJOnaECiLlA=; b=UYsK/kJEipxwT3h+RYlvaww8bnFcXRj+iPrULR/yTABDtKfLO1cAHDnt+g4gLM3StWl4BX fzZZFUaA1kubIw/aXEfMaKS8DkHNPm0F16WzjReR5rFul6dfMGHUHwmW7WlgXyBtrfPXFM EMQjhAHwI12spkDSHc+gblrkEh8F0n0cSF/jYzcuZUltQ5Brsp+xBZOWniuAMvj4lnhOUx QlalWFcCTLQPrl1Bozi061TAv8f33gYFOzjx2p97XgOBBI0pBNy/oMG1jxrysxDrbm+D5A QsG50Y9BFtZTB5iHR2QSU/Aos/HMRCPSSPFTf9hBFlynW3CLZOVGin1gETEeWg== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (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 4TYsln3DSzz15Dq for ; Tue, 13 Feb 2024 07:05:09 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 41D759FL009817 for ; Tue, 13 Feb 2024 07:05:09 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 41D7595M009816 for fs@FreeBSD.org; Tue, 13 Feb 2024 07:05:09 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: fs@FreeBSD.org Subject: [Bug 275594] High CPU usage by arc_prune; analysis and fix Date: Tue, 13 Feb 2024 07:05:09 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 14.0-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: seigo.tanimura@gmail.com X-Bugzilla-Status: Open X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: fs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Filesystems List-Archive: https://lists.freebsd.org/archives/freebsd-fs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-fs@freebsd.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D275594 --- Comment #51 from Seigo Tanimura --- (In reply to Seigo Tanimura from comment #44) The updated fix is now ready to share. As of writing this, the test on releng/13.2 is running well without any unexpected build errors. Hopefully all of the latest fixes are ready for t= he review and merge. * Updates - Accelerate the ZFS vnode recycling when there are any ARC eviction waiter= s. - Recycle the nullfs vnodes, triggered by the vm_lowmem kernel events. * Github Sources All of the sources are under https://github.com/altimeter-130ft/freebsd-freebsd-src. - Branches and Git Commit Hashes | | Git Commit Hash | Fix Branch | Base Branch | Fix + Counter Branch | Base =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D+=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D+=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D main | topic-openzfs-arc_prune-regulation-fix | 57ddfad884 | topic-openzfs-arc_prune-regulation-counters |=20 ------------+---------------------------------------------------------+----= ------------- stable/14 | stable/14-topic-openzfs-arc_prune-regulation-fix | 20a6f4779a | stable/14-topic-openzfs-arc_prune-regulation-counters |=20 ------------+---------------------------------------------------------+----= ------------- releng/14.0 | releng/14.0-topic-openzfs-arc_prune-regulation-fix | 4edf3b8073 | releng/14.0-topic-openzfs-arc_prune-regulation-counters |=20 ------------+---------------------------------------------------------+----= ------------- stable/13 | stable/13-topic-openzfs-arc_prune-regulation-fix | 9d2f548bbe | stable/13-topic-openzfs-arc_prune-regulation-counters |=20 ------------+---------------------------------------------------------+----= ------------- releng/13.3 | releng/13.3-topic-openzfs-arc_prune-regulation-fix | 24eb518714 | releng/13.3-topic-openzfs-arc_prune-regulation-counters |=20 ------------+---------------------------------------------------------+----= ------------- releng/13.2 | releng/13.2-topic-openzfs-arc_prune-regulation-fix | c78c31d2ef | releng/13.2-topic-openzfs-arc_prune-regulation-counters |=20 | Git Commit Hash | FreeBSD-EN-23:18.openzfs | ZFS & VFS | Nullfs | Counters Base Branch | Backport | Fix | Fix | (Not for merging) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D+=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D+=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D+=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D+=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D main | N/A | cb4a97bd6b | 7bbbce6313 | ed4932a2= b4 ------------+--------------------------+------------+------------+---------= ---------- stable/14 | N/A | f1e1c524a3 | 69f7866c36 | 4e5471ad= e7 ------------+--------------------------+------------+------------+---------= ---------- releng/14.0 | N/A | af25ebd2d0 | d13f4d74a0 | 09103b5f= 9c ------------+--------------------------+------------+------------+---------= ---------- stable/13 | c733dcff2e | 9c65b44d3d | e2bac2ef1e | d52eb312= 27 ------------+--------------------------+------------+------------+---------= ---------- releng/13.3 | ca178f626f | 90bfaef58d | bd4cceca37 | aad94888= 3e ------------+--------------------------+------------+------------+---------= ---------- releng/13.2 | c733dcff2e | 9c65b44d3d | e2bac2ef1e | d52eb312= 27 * poudriere-bulk(8) Results - Contents of Result Chart Archives - poudriere-bulk-(base-branch)-(timestamp).7z - vnodes.png - The overall vnodes. - vnode-free-calls.png - The calls to the vnode recycle functions. - freed-vnodes.png - The vnodes freed for recycling. - nullfs-nodes.png - The nullfs vnodes. - vm_lowmem-kernel-events.png - The vm_lowmem kernel events. - poudriere-bulk-(base-branch)-(timestamp)-zfs.7z - zfs-arc-dnode-size.png - The ZFS ARC dnode size in bytes. - zfs-arc-pruning-regulation.png - The ZFS ARC pruning requests and regulation. - zfs-znodes-and-dnodes.png - The ZFS ARC znodes and dnodes. - zfs-dnodes-and-freeing-activity.png - The ZFS ARC dnodes and pruning activity. - poudriere-bulk-(base-branch)-(timestamp)-zfs-sizes.7z - zfs-arc-mru-metadata-size.png - The ZFS ARC MRU metadata size. - zfs-arc-mru-data-size.png - The ZFS ARC MRU data size. - zfs-arc-mfu-metadata-size.png - The ZFS ARC MFU metadata size. - zfs-arc-mfu-data-size.png - The ZFS ARC MFU data size. - Some charts and traces are not available in 13.x due to the major versi= on difference. - Common Setup - sysctl(3) - vfs.zfs.arc_max: 4294967296 - 4GB. - vfs.zfs.arc.dnode_limit: 0 (default) - kstat.zfs.misc.arcstats.arc_dnode_limit: 322122547 (calculated automatically) - poudriere-bulk(8) - USE_TMPFS=3D"wrkdir data localbase" - releng/14.0 - Date - 09 Feb 2024 00:30Z - 09 Feb 2024 09:07Z - Build time - 09:06:22 (234 pkgs / hr) - Failed port(s): 3 - japanese/xv: Expected, port Makefile problem? - graphics/gimp-app: Expected, a compiler internal error. - java/eclipse: Expected, JVM out of heap. - Skipped port(s): 2 - graphics/gimp: graphics/gimp-app. - print/gimp-gutenprint: graphics/gimp-app. - Result Chart Archive - poudriere-bulk-14_0_release_p4-2024-02-09_09h30m00s.7z, Attachment #248418 - poudriere-bulk-14_0_release_p4-2024-02-09_09h30m00s-zfs.7z, Attachment #248419 - poudriere-bulk-14_0_release_p4-2024-02-09_09h30m00s-zfs-sizes.7z, Attachment #248420 - releng/13.3 - Date - 08 Feb 2024 03:20Z - 09 Feb 2024 12:01Z - Build time - 09:00:46 (237 pkgs / hr) - Failed port(s): 1 - japanese/xv: Expected, port Makefile problem? - Skipped port(s): 0 - Result Chart Archive - poudriere-bulk-13_3_beta_1-2024-02-08_12h20m00s.7z, Attachment #248421 - poudriere-bulk-13_3_beta_1-2024-02-08_12h20m00s-zfs.7z, Attachment #248422 - poudriere-bulk-13_3_beta_1-2024-02-08_12h20m00s-zfs-sizes.7z, Attachm= ent #248423 - Missing traces - The total sizes of each ARC states and types. (Data and metadata) - releng/13.2 - In progress. - Started at 13 Feb 2024 02:40Z. - main, stable/14, stable/13 - No plan for the poudriere-bulk(8) tests for now. - stable/14 and stable/13 are expected to behave like releng/14.0 and releng/13.3, respectively. - Analysis and Findings - The ZFS ARC dnodes stayed at most ~400MB. - Before the nullfs fix: monotonic increase in general. - The ZFS ARC dnodes decreased when only a few builders were running. - The vnodes stayed at most ~1.2M. - Before the nullfs fix: up to ~3M. - The nullfs node number is controlled well as per the build load. - There are often the ARC eviction waiters in the late stage of poudriere-bulk(8). - The tmpfs wrkdirs hold a lot of files for both the build and prerequisites. - There are almost always some ARC-prunable vnodes. - The ZFS ARC always have some evictable parts. - Almost all data in the ZFS ARC is evictable. --=20 You are receiving this mail because: You are the assignee for the bug.=