From nobody Wed Jan 31 07:52:56 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 4TPvR03LGGz58gwb for ; Wed, 31 Jan 2024 07:53:00 +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 4TPvR02HkJz3xrF for ; Wed, 31 Jan 2024 07:53:00 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706687580; 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=YUreaUyluKy3VdbCWBDOsu4LGRKwkX+A5bsEnUOkJZI=; b=xMbdWFHq0bJvD2kRSDcAVe5TAQMoQ69wNRy0rSoARogyWQUqNVmJpBAnymVYcpFRhsKF+k kIYkn/CbNgczPItOufZih4Crh022ONp0Uu6DJ+DjLqK82QZ05yhDf6VkiazChl5TOvJC8R kN0fJj600s6ElZcpLSb0zVpTVtTHwEmBT2J49wqsjS2+tXwNwxuVQSAl4QYgypemAVZCM5 R+OxAILlMgXHsBEFUB3GGo7idBtbTPiVu8cAZITjOkpxvfuoSU8TQyeZpjWk0VpOWU0m5y UOwEeiB39am0/kDFqQGEc4OkCVtpxE9Wa5K7HeFUYUU/wPTrOb2zA1Xu2uiXHw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706687580; a=rsa-sha256; cv=none; b=Px+On0TeBv2qvd2GjXZwdFrb8iXl5ENWyMHSlog8nekL4e38qag0/VzpnUdR3a52TTdTT8 7mCZJ26yedTVOGGLeU5PbgQCfSLpxj09n3zLmxn3YUMovcHdh14GczYW/FcScSv1xTZ65z tuwsbRwsJLaXMHJ5ih1urugXh6gaHFRwoU/X7rwlq/8u2l39OcIUafB7/iTocWzlHHw4n9 uxHagVgmnFAL4GTD63BoTP62Xp6cM8artfYoH7y9b1IU3+btaBFK1DxLmehtO3fgCbWo66 XPkwmDRPQ9MW/9NKZg6KqlrRSb4Km1d7FrbBjDZZS03nrCtlDu0mqYotmGWmmw== 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 4TPvR01Lktz19RG for ; Wed, 31 Jan 2024 07:53:00 +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 40V7r0uc012688 for ; Wed, 31 Jan 2024 07:53:00 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 40V7r0Sp012617 for fs@FreeBSD.org; Wed, 31 Jan 2024 07:53:00 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: Wed, 31 Jan 2024 07:52:56 +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 #42 from Seigo Tanimura --- (In reply to Thomas Mueller from comment #41) Thank you so much and sorry for the delayed reply. I now believe the fix w= orks on your case as well. * Fix Status I am now checking the ARC eviction and pruning triggered by the vm_lowmem kernel event. There was a case where the system stalled with pagedaemon{um= a} running at the WCPU of ~0.3% in the late stage of poudriere-bulk(8). I sus= pect that a pagedaemon thread put itself to the arc_evict_waiters list in arc_wait_for_eviction(), called by arc_lowmem(), to handle the vm_lowmem ke= rnel event. In such the case, the ARC pruning has to work more eagerly so that = the pagedaemon thread does not block forever. The issue above has been confirmed experimentally by checking for the non-e= mpty arc_evict_waiters list in {arc,zfs}_prune_task(). Also, arc_lowmem() has t= he lines for such the case. > static void > arc_lowmem(void *arg __unused, int howto __unused) > { > (snip) > /* > * It is unsafe to block here in arbitrary threads, because we can come > * here from ARC itself and may hold ARC locks and thus risk a deadlock > * with ARC reclaim thread. > */ > if (curproc =3D=3D pageproc) > arc_wait_for_eviction(to_free, B_FALSE); > } After the current test, I will see if this issue can be worked out somehow. --=20 You are receiving this mail because: You are the assignee for the bug.=