svn commit: r234513 - stable/8/sys/fs/tmpfs
Xin LI
delphij at FreeBSD.org
Fri Apr 20 22:27:11 UTC 2012
Author: delphij
Date: Fri Apr 20 22:27:10 2012
New Revision: 234513
URL: http://svn.freebsd.org/changeset/base/234513
Log:
MFC r227802:
Improve the way to calculate available pages in tmpfs:
- Don't deduct wired pages from total usable counts because it does not
make any sense. To make things worse, on systems where swap size is
smaller than physical memory and use a lot of wired pages (e.g. ZFS),
tmpfs can suddenly have free space of 0 because of this;
- Count cached pages as available; [1]
- Don't count inactive pages as available, technically we could but that
might be too aggressive; [1]
[1] Suggested by kib@
Modified:
stable/8/sys/fs/tmpfs/tmpfs.h
Directory Properties:
stable/8/sys/ (props changed)
Modified: stable/8/sys/fs/tmpfs/tmpfs.h
==============================================================================
--- stable/8/sys/fs/tmpfs/tmpfs.h Fri Apr 20 22:16:08 2012 (r234512)
+++ stable/8/sys/fs/tmpfs/tmpfs.h Fri Apr 20 22:27:10 2012 (r234513)
@@ -483,11 +483,8 @@ int tmpfs_truncate(struct vnode *, off_t
static __inline size_t
tmpfs_mem_info(void)
{
- size_t size;
- size = swap_pager_avail + cnt.v_free_count + cnt.v_inactive_count;
- size -= size > cnt.v_wire_count ? cnt.v_wire_count : size;
- return size;
+ return (swap_pager_avail + cnt.v_free_count + cnt.v_cache_count);
}
/* Returns the maximum size allowed for a tmpfs file system. This macro
More information about the svn-src-stable-8
mailing list