From owner-freebsd-arch@FreeBSD.ORG Tue Dec 16 22:41:37 2014 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1E1F4C69 for ; Tue, 16 Dec 2014 22:41:37 +0000 (UTC) Received: from mail-pa0-f44.google.com (mail-pa0-f44.google.com [209.85.220.44]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E194CDB8 for ; Tue, 16 Dec 2014 22:41:36 +0000 (UTC) Received: by mail-pa0-f44.google.com with SMTP id et14so15097819pad.3 for ; Tue, 16 Dec 2014 14:41:35 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:mime-version:content-type:from :in-reply-to:date:cc:message-id:references:to; bh=ezXKEG3aynbfd2pkMk+ylQzWigAIWMbCw3x120CwbJE=; b=f1tSYs91+AQqw/u+E+rCmFfdC5avGr2PesylJu/syY9WO9xBiYrGC0ocJchOZKEts1 h4/j8OzIVJpCYAHOAaVcm9As3+W0EstavdtnWDUNUfFwDpbx/8d+U3i8vlslAH69hkLe F5OYIfaO2T1GGeTtiVn/9/sv2YdxbeMk5d3yqw/IlDrjB6hMskA/8U4uNhQOraWzWYvD YvBKBxQmt2G6ucl/pm1sDUlk+tI2rzOd5GKl6XDoFOYs+9dNi6piopC7z1HsuO4ZM7lV wAkmRw1vOWjnT027lc9WpYYiK5YvHV+oO7/udTkJj3zrx3cjEg9ADHHz7EGgVxwtC9gS 2wfg== X-Gm-Message-State: ALoCoQmTbP3IDHmoU+QCKc0Bnw1881vgcpWa5J/p6d3FYq+MUbgSQlReucw2EW4OFP3LTwqd2dSO X-Received: by 10.67.3.165 with SMTP id bx5mr64641294pad.59.1418769695715; Tue, 16 Dec 2014 14:41:35 -0800 (PST) Received: from [10.64.27.55] ([69.53.236.236]) by mx.google.com with ESMTPSA id vz3sm2010106pab.2.2014.12.16.14.41.34 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 16 Dec 2014 14:41:34 -0800 (PST) Sender: Warner Losh Subject: Re: Change default VFS timestamp precision? Mime-Version: 1.0 (Mac OS X Mail 8.1 \(1993\)) Content-Type: multipart/signed; boundary="Apple-Mail=_0ADC3D5A-DF91-4825-ABDA-863E50C35313"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail 2.5b3 From: Warner Losh In-Reply-To: <201412161437.16767.jhb@freebsd.org> Date: Tue, 16 Dec 2014 15:41:32 -0700 Message-Id: <12A1D992-44B8-4FB6-A069-EB7635D54914@bsdimp.com> References: <201412161348.41219.jhb@freebsd.org> <708ECB13-C3A1-46E9-BF29-6F544CC4FDE6@bsdimp.com> <201412161437.16767.jhb@freebsd.org> To: John Baldwin X-Mailer: Apple Mail (2.1993) Cc: arch@freebsd.org X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Dec 2014 22:41:37 -0000 --Apple-Mail=_0ADC3D5A-DF91-4825-ABDA-863E50C35313 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Dec 16, 2014, at 12:37 PM, John Baldwin wrote: >=20 > On Tuesday, December 16, 2014 1:51:09 pm Warner Losh wrote: >>=20 >>> On Dec 16, 2014, at 11:48 AM, John Baldwin wrote: >>>=20 >>> We still ship with vfs.timestamp_precision=3D0 by default meaning = that VFS >>> timestamps have a granularity of one second. It is not unusual on = modern >>> systems for multiple updates to a file or directory to occur within = a single >>> second (and thus share the same effective timestamp). This can = break things >>> that depend on timestamps to know when something has changed or is = stale (such >>> as make(1) or NFS clients). On hardware that has a cheap = timecounter, I we >>> should use the most-precise timestamps (vfs.timestamp_precision=3D3). = However, >>> I'm less sure of what to do for other cases such as i386/amd64 when = not using >>> TSC, or on other platforms. OTOH, perhaps you aren't doing lots of = heavy I/O >>> access on a system with a slow timecounter (or if you are doing = heavy I/O, >>> slow timecounter access won't be your bottleneck)? >>>=20 >>> I can think of a few options: >>>=20 >>> 1) Change vfs.timestamp_precision default to 3 for all systems. >>>=20 >>> 2) Only change vfs.timestamp_precision default to 3 for amd64/i386 = using an >>> #ifdef. >>>=20 >>> 3) Something else? >>>=20 >>> What do other folks think? >>=20 >> (1). If there=E2=80=99s a specific kernel / platform that=E2=80=99s = slow, we can make it an option >> for those kernels. >=20 > Mm, so something like: >=20 > Index: vfs_subr.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- vfs_subr.c (revision 275828) > +++ vfs_subr.c (working copy) > @@ -632,7 +632,11 @@ vfs_getnewfsid(struct mount *mp) > */ > enum { TSP_SEC, TSP_HZ, TSP_USEC, TSP_NSEC }; >=20 > +#ifdef VFS_CHEAP_TIMESTAMPS > static int timestamp_precision =3D TSP_SEC; > +#else > +static int timestamp_precision =3D TSP_NSEC; > +#endif > SYSCTL_INT(_vfs, OID_AUTO, timestamp_precision, CTLFLAG_RW, > ×tamp_precision, 0, "File timestamp precision (0: seconds, " > "1: sec + ns accurate to 1/HZ, 2: sec + ns truncated to ms, " >=20 > where VFS_CHEAP_TIMESTAMPS becomes a new kernel config option? >=20 > (We should also probably make this a loader tunable) Yea, the DEFAULT behavior should be set at compile time, the run-time = behavior should be set by this variable=E2=80=A6. Tunable is good too, = but the sysctl likely will suffice for that given how early the = sysctl.conf file is snarfed. Warner --Apple-Mail=_0ADC3D5A-DF91-4825-ABDA-863E50C35313 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJUkLUcAAoJEGwc0Sh9sBEA2KwP/3GIsl+aQjVntSbVtcajeoa+ v/bnG27WqpoUNOu0S6IQYJ0DlKmCPDD4Z19Jq7OpOAEa+53779NOWd3AQYeYp9s1 AlZygZQJ1p7jisQtrCYUOqbvCjZFw7AtQ6n/DqrnsmKr5fOtno0XUEQyN+z/ps/7 TgDoGREgMcjMOWvn1F25rfkTH7eWgD+N+Dzusj7TgLV3cchz5XPEQRHLi+YOK8ab l7umz5AiEFd7CrCOGrA/2BqoXUxlPvbtfL14t2DHmOoy3XDX864r6jKNAy/tGugi 08wJTt9FmibhBZh6FSpYt1IM3d3AHTLO9Dt63EWENsM1xrEZaNEL2EKS91Hs8+3Y UEsVYKF0hltJm17QX2InLa6K4eqFyIi+SzTB66ucI89I+yz3ZzSWZmGoSRsOwniz tXnS8GdPTuejU+5yA6qILmNbD6qxHrblspcwsrFeaT3gK3gaGL/oaPXjh6Sllqmx +DyhpPtQ3T0MiYQb0GDdxi1wARuFGaA1jC3ufSrCHmXglufQIyvHvnXc1w35AAQx 393JnS1TsZ8HphASPCiBzy91ttWcGkdLPAlX8ZJR4wBpP5FMqcJJQvRGo82NL9Hx 48Jz3lHpFMGRG8RlQRe33x1GiNR6fsLqBY8m1zgpFeQHbHIxGxYgWIF3nriDw51H /yPl6Qhjw/31tc4kJ8mq =m60X -----END PGP SIGNATURE----- --Apple-Mail=_0ADC3D5A-DF91-4825-ABDA-863E50C35313--