Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Dec 2023 15:34:26 +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-FDMwfIByLP@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 #14 from commit-hook@FreeBSD.org ---
A commit in branch main references this bug:

URL:
https://cgit.FreeBSD.org/src/commit/?id=3D636592343c3ec0feb61a4d80436763813=
84420dd

commit 636592343c3ec0feb61a4d8043676381384420dd
Author:     Mike Karels <karels@FreeBSD.org>
AuthorDate: 2023-12-19 15:33:33 +0000
Commit:     Mike Karels <karels@FreeBSD.org>
CommitDate: 2023-12-19 15:33:33 +0000

    tmpfs: increase memory reserve to a percent of available memory + swap

    The tmpfs memory reserve defaulted to 4 MB, and other than that,
    all of available memory + swap could be allocated to tmpfs files.
    This was dangerous, as the page daemon attempts to keep some memory
    free, using up swap, and then resulting in processes being killed.
    Increase the reserve to a fraction of available memory + swap at
    file system startup time.  The limit is expressed as a percentage
    of available memory + swap that can be used, and defaults to 95%.
    The percentage can be changed via the vfs.tmpfs.memory_percent sysctl,
    recomputing the reserve with the new percentage but the initial
    available memory + swap.  Note that the reserve can also be set
    directly with an existing sysctl, ignoring the percentage.  The
    previous behavior can be specified by setting vfs.tmpfs.memory_percent
    to 100.

    Add sysctl for vfs.tmpfs.memory_percent and the pre-existing
    vfs.tmpfs.memory_reserved to tmpfs(5).

    PR:             275436
    MFC after:      1 month
    Reviewed by:    rgrimes
    Differential Revision:  https://reviews.freebsd.org/D43011

 share/man/man5/tmpfs.5    | 18 ++++++++++++++++++
 sys/fs/tmpfs/tmpfs.h      |  8 ++++++++
 sys/fs/tmpfs/tmpfs_subr.c | 40 +++++++++++++++++++++++++++++++++++++++-
 3 files changed, 65 insertions(+), 1 deletion(-)

--=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-FDMwfIByLP>