FreeBSD Bugzilla – Attachment 187197 Details for
Bug 223015
tmpfs does not support sparse files
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
vfs.tmpfs.inactive_percent sysctl
tmpfs.diff (text/plain), 1.64 KB, created by
Keith White
on 2017-10-15 16:21:01 UTC
(
hide
)
Description:
vfs.tmpfs.inactive_percent sysctl
Filename:
MIME Type:
Creator:
Keith White
Created:
2017-10-15 16:21:01 UTC
Size:
1.64 KB
patch
obsolete
>Index: /usr/src/sys/fs/tmpfs/tmpfs_subr.c >=================================================================== >--- /usr/src/sys/fs/tmpfs/tmpfs_subr.c (revision 324624) >+++ /usr/src/sys/fs/tmpfs/tmpfs_subr.c (working copy) >@@ -65,6 +65,7 @@ > SYSCTL_NODE(_vfs, OID_AUTO, tmpfs, CTLFLAG_RW, 0, "tmpfs file system"); > > static long tmpfs_pages_reserved = TMPFS_PAGES_MINRESERVED; >+static int tmpfs_inactive_percent = 0; > > static int > sysctl_mem_reserved(SYSCTL_HANDLER_ARGS) >@@ -87,9 +88,30 @@ > return (0); > } > >+static int >+sysctl_inactive_percent(SYSCTL_HANDLER_ARGS) >+{ >+ int error; >+ int percent; >+ >+ percent = *(int *)arg1; >+ error = sysctl_handle_int(oidp, &percent, 0, req); >+ if (error || !req->newptr) >+ return (error); >+ if (percent < 0) >+ percent = 0; >+ if (percent > 100) >+ percent = 100; >+ *(int *)arg1 = percent; >+ return (0); >+} >+ > SYSCTL_PROC(_vfs_tmpfs, OID_AUTO, memory_reserved, CTLTYPE_LONG|CTLFLAG_RW, > &tmpfs_pages_reserved, 0, sysctl_mem_reserved, "L", > "Amount of available memory and swap below which tmpfs growth stops"); >+SYSCTL_PROC(_vfs_tmpfs, OID_AUTO, inactive_percent, CTLTYPE_INT|CTLFLAG_RW, >+ &tmpfs_inactive_percent, 0, sysctl_inactive_percent, "I", >+ "Percentage of inactive memory to add to free space"); > > static __inline int tmpfs_dirtree_cmp(struct tmpfs_dirent *a, > struct tmpfs_dirent *b); >@@ -100,7 +122,9 @@ > { > vm_ooffset_t avail; > >- avail = swap_pager_avail + vm_cnt.v_free_count - tmpfs_pages_reserved; >+ avail = swap_pager_avail + vm_cnt.v_free_count + >+ (vm_cnt.v_inactive_count / 100 * tmpfs_inactive_percent) - >+ tmpfs_pages_reserved; > if (__predict_false(avail < 0)) > avail = 0; > return (avail);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 223015
:
187197
|
187384