From nobody Wed Nov 29 19:19:02 2023 X-Original-To: bugs@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 4SgTdg1YP1z527kx for ; Wed, 29 Nov 2023 19:19:03 +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 4SgTdf6dNfz4RmK for ; Wed, 29 Nov 2023 19:19:02 +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=1701285542; 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=6c8JbsNrPSC+IqqBnKmLZ7JWXlc4KfAM2CcZVra7rao=; b=pau3NwyfST684GGtTA7UK8WV6CaGutzQgjiNgXYqoN5cy+L/s0Hvi6y43ntTXxoD1QakrW Q5Va4Np5Px9H9lhHvy6za/VYTWRh6lNo9OyqHyvlknhGnmy55o700hE8DCQ+Qzl7uzV2S3 P4e2OBXwPSh3cjGBz/UB2LPthiSJlQdCwdSuJ3YDPdZE6CdRoZqomBd1g3FPI82V24+v7E IsNV6mbASQy3kHZDhkelIC3Qph+05kcABxkF0pmuDMcko7zfH8Doz6GOUdB40R7jBnq5gq zZI/0Kl7gmL6cWkUX4Pz6v3CrgbyU4MWr89p4hyWJi3KDzuNcUlkLuaG2SqPgw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1701285542; a=rsa-sha256; cv=none; b=fcE9gIi3BgAEDSEonNjNOkEc0oNm00X/BFAs03ufDgfzCqBL0Z+oAzBhM+52d3JkbHaydG bluay97uB2nsM3ylydGYuJQLtTZb9jMw5KNxLr9+3x3Vq52oO7bUlEcfI5qb5BuZ8ya6za p3mDq+aTrGlnLbGDcx984LRvzHIDglxS6kSDLqijBPpE3WY4ng8wuySw4w8Xl6PWb1R0eQ V7o2SbHtbBI8PGYMIKBSDsxX8s9+Hox08AafqoIkcvVyXRLITeeC79whTj5nI+Y6qkkHx/ fF2zYElDspf3HM8oCn30l0W1UyFVCzxrFCwtKH2x6PfRGK0hwLkCVkGxqIBuDQ== 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 4SgTdf5jGzz3D7 for ; Wed, 29 Nov 2023 19:19:02 +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 3ATJJ2HK031030 for ; Wed, 29 Nov 2023 19:19:02 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 3ATJJ2f2031029 for bugs@FreeBSD.org; Wed, 29 Nov 2023 19:19:02 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: bugs@FreeBSD.org Subject: [Bug 275436] tmpfs does not honor memory limits on writes Date: Wed, 29 Nov 2023 19:19:02 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 15.0-CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: karels@freebsd.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter attachments.created Message-ID: 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: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D275436 Bug ID: 275436 Summary: tmpfs does not honor memory limits on writes Product: Base System Version: 15.0-CURRENT Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: karels@freebsd.org Created attachment 246673 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D246673&action= =3Dedit sample patch that works around the problem The tmpfs file system checks for available memory when a file is created, b= ut not during writes. If I create a file, then run the system nearly out of memory, I can write to that file until processes are killed because the sys= tem is out of memory, and in some cases the system is so screwed up that a shut= down cannot be run. A df shows continuously growing usage and size while showin= g 0 for free space all along; this can go on for gigabytes. Note, this is usin= g a tmpfs file system with the default size. I'll attach a patch that adds a check in the write path, which helps. It s= till runs the system out of memory and swap, so there are two additional changes= in the patch: one divides swap space by two, and the other asks the VM system = for the free memory in excess of the free target, using that in place of simply free memory. I am not convinced that any of the changes are correct, but t= hey help considerably. With these changes, a large memory process keeps running although swap is exhausted when the writes fail. More details or tests available on request. --=20 You are receiving this mail because: You are the assignee for the bug.=