From owner-svn-src-all@freebsd.org Mon Mar 25 07:46:22 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1335155539A; Mon, 25 Mar 2019 07:46:21 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 866C784C5D; Mon, 25 Mar 2019 07:46:21 +0000 (UTC) (envelope-from allanjude@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 44F704C8D; Mon, 25 Mar 2019 07:46:21 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2P7kLgh019792; Mon, 25 Mar 2019 07:46:21 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2P7kKUu019786; Mon, 25 Mar 2019 07:46:20 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201903250746.x2P7kKUu019786@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Mon, 25 Mar 2019 07:46:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345491 - in head/sys: conf fs/tmpfs modules/tmpfs X-SVN-Group: head X-SVN-Commit-Author: allanjude X-SVN-Commit-Paths: in head/sys: conf fs/tmpfs modules/tmpfs X-SVN-Commit-Revision: 345491 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 866C784C5D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.965,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 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: Mon, 25 Mar 2019 07:46:22 -0000 Author: allanjude Date: Mon Mar 25 07:46:20 2019 New Revision: 345491 URL: https://svnweb.freebsd.org/changeset/base/345491 Log: Make TMPFS_PAGES_MINRESERVED a kernel option TMPFS_PAGES_MINRESERVED controls how much memory is reserved for the system and not used by tmpfs. On very small memory systems, the default value may be too high and this prevents these small memory systems from using reroot, which is required for them to install firmware updates. Submitted by: Hiroki Mori Reviewed by: mizhka Differential Revision: https://reviews.freebsd.org/D13583 Modified: head/sys/conf/options head/sys/fs/tmpfs/tmpfs.h head/sys/fs/tmpfs/tmpfs_vfsops.c head/sys/modules/tmpfs/Makefile Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Mon Mar 25 01:18:26 2019 (r345490) +++ head/sys/conf/options Mon Mar 25 07:46:20 2019 (r345491) @@ -640,6 +640,9 @@ NFS_MINDIRATTRTIMO opt_nfs.h NFS_MAXDIRATTRTIMO opt_nfs.h NFS_DEBUG opt_nfs.h +# TMPFS options +TMPFS_PAGES_MINRESERVED opt_tmpfs.h + # For the Bt848/Bt848A/Bt849/Bt878/Bt879 driver OVERRIDE_CARD opt_bktr.h OVERRIDE_TUNER opt_bktr.h Modified: head/sys/fs/tmpfs/tmpfs.h ============================================================================== --- head/sys/fs/tmpfs/tmpfs.h Mon Mar 25 01:18:26 2019 (r345490) +++ head/sys/fs/tmpfs/tmpfs.h Mon Mar 25 07:46:20 2019 (r345491) @@ -487,7 +487,9 @@ struct tmpfs_dirent *tmpfs_dir_next(struct tmpfs_node * Amount of memory pages to reserve for the system (e.g., to not use by * tmpfs). */ +#if !defined(TMPFS_PAGES_MINRESERVED) #define TMPFS_PAGES_MINRESERVED (4 * 1024 * 1024 / PAGE_SIZE) +#endif size_t tmpfs_mem_avail(void); Modified: head/sys/fs/tmpfs/tmpfs_vfsops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vfsops.c Mon Mar 25 01:18:26 2019 (r345490) +++ head/sys/fs/tmpfs/tmpfs_vfsops.c Mon Mar 25 07:46:20 2019 (r345491) @@ -42,6 +42,9 @@ * memory-specific data structures and algorithms to automatically * allocate and release resources. */ + +#include "opt_tmpfs.h" + #include __FBSDID("$FreeBSD$"); Modified: head/sys/modules/tmpfs/Makefile ============================================================================== --- head/sys/modules/tmpfs/Makefile Mon Mar 25 01:18:26 2019 (r345490) +++ head/sys/modules/tmpfs/Makefile Mon Mar 25 07:46:20 2019 (r345491) @@ -4,6 +4,6 @@ KMOD= tmpfs SRCS= vnode_if.h \ - tmpfs_vnops.c tmpfs_fifoops.c tmpfs_vfsops.c tmpfs_subr.c + tmpfs_vnops.c tmpfs_fifoops.c tmpfs_vfsops.c tmpfs_subr.c opt_tmpfs.h .include