Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 06 Dec 2023 23:36:58 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 275436] tmpfs does not honor memory limits on writes
Message-ID:  <bug-275436-227-AgafyJihCs@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-275436-227@https.bugs.freebsd.org/bugzilla/>
References:  <bug-275436-227@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D275436

--- Comment #8 from Konstantin Belousov <kib@FreeBSD.org> ---
(In reply to Mike Karels from comment #7)
Being able to free one page is not equal to ability to free needed number of
pages, this is why 'global' OOM works only in specific situations.

Proposals to limit max tmpfs page uses to some percentage of the total of
memory and swap would not work.  Problem is that some memory is 'managed',
some is not.  For instance, all file-backed pages should be considered as
free for the purpose of the limits calculation, otherwise an app mapping
a large file and reading it would cause un-explanable ENOSPC failures from
tmpfs.  And in reverse, allowing say 80% of total use by tmpfs does not pre=
vent
a situation where we do fill that limit, and then kernel needs a lot of
unmanaged
memory, for instance, for sockets buffers due to bursts of a network activi=
ty.

There is simply no reasonable answer to question 'how to limit tmpfs physic=
al
memory consumption' without knowing the system load pattern.  And if you kn=
ow
the load and care about memory limiting, there is already the size option.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-275436-227-AgafyJihCs>