From owner-svn-src-all@freebsd.org Thu Jan 19 18:26:07 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5DEFACB830D; Thu, 19 Jan 2017 18:26:07 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 381A5156B; Thu, 19 Jan 2017 18:26:07 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0JIQ6ib069976; Thu, 19 Jan 2017 18:26:06 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0JIQ6qO069975; Thu, 19 Jan 2017 18:26:06 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201701191826.v0JIQ6qO069975@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 19 Jan 2017 18:26:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312423 - head/share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jan 2017 18:26:07 -0000 Author: kib Date: Thu Jan 19 18:26:06 2017 New Revision: 312423 URL: https://svnweb.freebsd.org/changeset/base/312423 Log: Refresh tmpfs(5) man page. Provide more useful explanation of features and quirks. Reviewed by: emaste, vangyzen Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D9211 Modified: head/share/man/man5/tmpfs.5 Modified: head/share/man/man5/tmpfs.5 ============================================================================== --- head/share/man/man5/tmpfs.5 Thu Jan 19 18:07:24 2017 (r312422) +++ head/share/man/man5/tmpfs.5 Thu Jan 19 18:26:06 2017 (r312423) @@ -1,7 +1,12 @@ .\"- .\" Copyright (c) 2007 Xin LI +.\" Copyright (c) 2017 The FreeBSD Foundation, Inc. .\" All rights reserved. .\" +.\" Part of this documentation was written by +.\" Konstantin Belousov under sponsorship +.\" from the FreeBSD Foundation. +.\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: @@ -49,12 +54,12 @@ .\" .\" $FreeBSD$ .\" -.Dd April 23, 2012 +.Dd January 17, 2017 .Dt TMPFS 5 .Os .Sh NAME .Nm tmpfs -.Nd "efficient memory file system" +.Nd "in-memory file system" .Sh SYNOPSIS To compile this driver into the kernel, place the following line in your @@ -72,17 +77,40 @@ tmpfs_load="YES" .Sh DESCRIPTION The .Nm -driver will permit the -.Fx -kernel to access +driver implements in-memory, or .Tn tmpfs -file systems. +file system. +The filesystem stores both file metadata and data in main memory. +This allows very fast and low latency accesses to the data. +The data is volatile. +An umount or system reboot invalidates it. +These properties make the filesystem's mounts suitable for fast +scratch storage, e.g. +.Pa /tmp . +.Pp +If the system becomes low on memory and swap is configured (see +.Xr swapon 8 ), +file data may be written to the swap space, freeing memory +for other needs. +The current implementation never swaps out metadata, including +the directory content. +Keep this in mind when planning the mount limits, especially when expecting +to place many small files on a tmpfs mount. +.Pp +When a file from a tmpfs mount is mmaped (see +.Xr mmap 2 ) +into the process address space, the swap VM object which manages the file +pages is used to implement mapping and to avoid double-copying of +the file data. +This quirk causes process inspection tools, like +.Xr procstat 1 , +to report anonymous memory mappings instead of file mappings. .Sh OPTIONS The following options are available when mounting .Nm file systems: -.Bl -tag -width indent +.Bl -tag -width "It Cm maxfilesize" .It Cm gid Specifies the group ID of the root inode of the file system. Defaults to the mount point's GID. @@ -114,11 +142,15 @@ memory file system: .Pp .Dl "mount -t tmpfs tmpfs /tmp" .Sh SEE ALSO +.Xr procstat 1 , .Xr nmount 2 , +.Xr mmap 2 , .Xr unmount 2 , .Xr fstab 5 , .Xr mdmfs 8 , -.Xr mount 8 +.Xr mount 8 , +.Xr swapinfo 8 , +.Xr swapon 8 .Sh HISTORY The .Nm @@ -130,7 +162,7 @@ The .Nm kernel implementation was written by .An Julio M. Merino Vidal Aq Mt jmmv@NetBSD.org -as a Google SoC project. +as a Google Summer of Code project. .Pp .An Rohit Jalan and others ported it from @@ -140,5 +172,3 @@ to .Pp This manual page was written by .An Xin LI Aq Mt delphij@FreeBSD.org . -.Sh BUGS -Some file system mount time options may not be well-supported.