From owner-svn-src-head@freebsd.org Mon Dec 7 15:36:23 2015 Return-Path: Delivered-To: svn-src-head@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 A66BF9B7F51; Mon, 7 Dec 2015 15:36:23 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id 702E8139C; Mon, 7 Dec 2015 15:36:22 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id 7419D425D7A; Tue, 8 Dec 2015 02:36:14 +1100 (AEDT) Date: Tue, 8 Dec 2015 02:36:13 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Andrey Chernov cc: Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r291936 - head/sys/ufs/ufs In-Reply-To: <56659DAA.1060000@freebsd.org> Message-ID: <20151208015835.R7743@besplex.bde.org> References: <201512071209.tB7C94hd024620@repo.freebsd.org> <56659AD0.2000706@freebsd.org> <56659DAA.1060000@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=cK4dyQqN c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=h08S0WsfbbBYEloxp-gA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 15:36:23 -0000 On Mon, 7 Dec 2015, Andrey Chernov wrote: > On 07.12.2015 17:42, Andrey Chernov wrote: >> On 07.12.2015 15:09, Konstantin Belousov wrote: >>> Author: kib >>> Date: Mon Dec 7 12:09:04 2015 >>> New Revision: 291936 >>> URL: https://svnweb.freebsd.org/changeset/base/291936 >>> >>> Log: >>> Update ctime when atime or birthtime are updated. >> >> Who calls ufs_itimes() and when to process IN_CHANGE flag in the new >> version? UFS_UPDATE() is called next and it call ufs_itimes(). Converting IN_CHANGE from a mark to a time could be delayed safely, but the other changes should be written soon. We use a delayed write, so they are not actually written very soon, and this could be optimized a little. Setting IN_LAZYACCESS might work as a hack (just some flag that the syncer checks and calls UFS_UPDATE() to clear). Only do this for unimportant attributes like times. For ids, I would go the other way and tell UFS_UPDATE() to do an async update. It currently only supports a waitfor boolean flag which selects bwrite() if set and normally bdwrite() if clear unless under load when it selects bawrite() if clear. >>> - ufs_itimes(vp); >>> + ip->i_flag |= IN_CHANGE | IN_MODIFIED; >> > > New version also forces IN_MODIFIED flag old one tends to avoid (only > for birthtime, and only for non-suspended systems in ufs_itimes()). That was mostly obfuscation in the old version: - for settings of the atime only, we modified the atime (possibly with a null change) but don't set IN_MODIFIED. ufs_itimes() fixeed this up by translating IN_ACCESS to a modification of the atime and a setting of IN_MODIFIED. This is depends on not being in the suspended case. Then we overwrote the modification with the final one before writing - for settings of the mtime only, ufs_itimes() fixes up IN_MODIFIED in the same way except this is obviously not affected by the suspended flag - for settings of the birthtime only, ufs_itimes() had no effect unless some update marks were already set, so we had to set IN_MODIFIED directly. The suspended case makes the side effects of ufs_itimes() even harder to understand, except it doesn't actually occur for calls from VOP_SETATTR(), since setattr is like write() -- it arranges for exclusive access and not suspended. Bruce