Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 2 Apr 2012 07:18:31 +0000 (UTC)
From:      Xin LI <delphij@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r233769 - stable/9/sys/fs/tmpfs
Message-ID:  <201204020718.q327IVAW086319@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: delphij
Date: Mon Apr  2 07:18:31 2012
New Revision: 233769
URL: http://svn.freebsd.org/changeset/base/233769

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/9/sys/fs/tmpfs/tmpfs.h
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/fs/   (props changed)

Modified: stable/9/sys/fs/tmpfs/tmpfs.h
==============================================================================
--- stable/9/sys/fs/tmpfs/tmpfs.h	Mon Apr  2 02:22:22 2012	(r233768)
+++ stable/9/sys/fs/tmpfs/tmpfs.h	Mon Apr  2 07:18:31 2012	(r233769)
@@ -502,11 +502,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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201204020718.q327IVAW086319>