From nobody Fri Dec 1 01:14:33 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 4ShFTQ2WmCz533yv for ; Fri, 1 Dec 2023 01:14:34 +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 4ShFTQ1HTgz4SkJ for ; Fri, 1 Dec 2023 01:14:34 +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=1701393274; 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=T10+zbVCuzLCOVpmI6C+sAWNh9y7V5C2qUL1hTMB4xo=; b=qlch+44XKrCtMQFW1lHzphmhR0n0wcmQcmtAZat+9wTus0KlyF/rxEltzmHApTyMn0vldt dcipS4raxOtU+gWOt47y0l4ZnoD8Khwk682Ejnbh17H4ebOxIFFxCECAM3tLMVeZUkfhH6 6cVhbjlEivZWXk5d+KdyA2Nmc3z6i77gHOONYSlWkY7G2tXXaKUjjnfFGFZBopIZk/l7GL JSh1KfQgT8grKgbPv8DuSWT8KYIaSv4OiO32lZV4y5OwtKLxsgo2MX4KaFdhsu9x/h3tmQ 9ANKwTSWZJFitIN1jTEreFArTc/j6A8IsENkStZxn+AUD3cfsv+49fY9nQ/DYA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1701393274; a=rsa-sha256; cv=none; b=DfRe3MFQ1vkosuosuvZIPVSR44Z1x2zapVv4ru5XgyB8FmoWVGzr3Iqk6QG9Vbzg8Bc1R/ 5WAABBQcGOzl/MPgULzz4MAebQS6uIKVJ6cTX4Cn81n93dns5uHFc0Fu6thGX9j3I9lk5s kZYCzSkxWGqwoq2nxlsK35k3sfy9Le4+QrNKonP1jIigwcdKDGuOz1LcpkKJj6CMD1T9NO 49/H0SeW37cUh9oaKha3kYV949gu/3ZzJxn93OYcx9iyP0kjLJBfVDc4tx7ncrlmUmMi0T QYRkK5vUhncCrRodmpGgQ+B1vwOx5Al+et0VMHLGAq+WT4UPtBAewsAicWWQ/A== 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 4ShFTP6LZ8z1CGC for ; Fri, 1 Dec 2023 01:14:33 +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 3B11EXSN004272 for ; Fri, 1 Dec 2023 01:14:33 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 3B11EXJh004271 for bugs@FreeBSD.org; Fri, 1 Dec 2023 01:14:33 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: Fri, 01 Dec 2023 01:14:33 +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: 15.0-CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: kib@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: 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: 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 --- Comment #3 from Konstantin Belousov --- tmpfs_setattr()->tmpfs_chsize()->tmpfs_truncate()->tmpfs_reg_resize() The free target has nothing to do with the availability of the (managed AKA swappable) memory for usermode. If it is used, it would cause transient 'no memory' errors, mostly due to pagedaemon not able to cope with working set changes in timely manner. This is same as requirement to not return transi= ent ENOMEMs to userspace from malloc(M_NOWAIT) in the top-level syscall code. By default, system allows most consumers to eat as much memory as they want and can. For instance, you can mmap(MAP_ANON) insanely large region, and fault physical pages on demand (recent Chrome does exactly this, it mmaps 1Tb for heap). Or you could create posix shm memory segment of that size. Or you can write a file on tmpfs. In each case, if the facility could be mis-used to exhaust memory (not phys= ical RAM but pageable storage) then specific limit should be applied. For insta= nce, for tmpfs the 'size' mount option should be used to limits its total use. The thing that is unclear to me, are you reporting that mount -o size=3D does not work? So that you can create and fill file larger than the limit? --=20 You are receiving this mail because: You are the assignee for the bug.=