Date: Sun, 17 Dec 2017 19:49:38 +0000 (UTC) From: Mark Johnston <markj@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r326921 - stable/11/sys/ufs/ffs Message-ID: <201712171949.vBHJncXe064239@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: markj Date: Sun Dec 17 19:49:37 2017 New Revision: 326921 URL: https://svnweb.freebsd.org/changeset/base/326921 Log: MFC r326731: Provide a sysctl to force synchronous initialization of inode blocks. Modified: stable/11/sys/ufs/ffs/ffs_alloc.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/ufs/ffs/ffs_alloc.c ============================================================================== --- stable/11/sys/ufs/ffs/ffs_alloc.c Sun Dec 17 19:48:35 2017 (r326920) +++ stable/11/sys/ufs/ffs/ffs_alloc.c Sun Dec 17 19:49:37 2017 (r326921) @@ -1974,6 +1974,16 @@ getinobuf(struct inode *ip, u_int cg, u_int32_t cginob } /* + * Synchronous inode initialization is needed only when barrier writes do not + * work as advertised, and will impose a heavy cost on file creation in a newly + * created filesystem. + */ +static int doasyncinodeinit = 1; +SYSCTL_INT(_vfs_ffs, OID_AUTO, doasyncinodeinit, CTLFLAG_RWTUN, + &doasyncinodeinit, 0, + "Perform inode block initialization using asynchronous writes"); + +/* * Determine whether an inode can be allocated. * * Check to see if an inode is available, and if it is, @@ -2086,6 +2096,7 @@ gotit: dp2->di_gen = arc4random(); dp2++; } + /* * Rather than adding a soft updates dependency to ensure * that the new inode block is written before it is claimed @@ -2095,7 +2106,10 @@ gotit: * written. The barrier write should only slow down bulk * loading of newly created filesystems. */ - babarrierwrite(ibp); + if (doasyncinodeinit) + babarrierwrite(ibp); + else + bwrite(ibp); /* * After the inode block is written, try to update the
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201712171949.vBHJncXe064239>