From owner-svn-src-head@freebsd.org Thu Aug 18 07:53:22 2016 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 4919DBBE7B4; Thu, 18 Aug 2016 07:53:22 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BD9E318CC; Thu, 18 Aug 2016 07:53:21 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u7I7rHwY063896 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Thu, 18 Aug 2016 10:53:17 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u7I7rHwY063896 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u7I7rGlP063895; Thu, 18 Aug 2016 10:53:16 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 18 Aug 2016 10:53:16 +0300 From: Konstantin Belousov To: Jilles Tjoelker Cc: Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304176 - in head: include lib/libc/sys sys/compat/freebsd32 sys/kern Message-ID: <20160818075316.GW83214@kib.kiev.ua> References: <201608151908.u7FJ8phh091939@repo.freebsd.org> <20160817202040.GA21263@stack.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160817202040.GA21263@stack.nl> User-Agent: Mutt/1.6.1 (2016-04-27) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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: Thu, 18 Aug 2016 07:53:22 -0000 On Wed, Aug 17, 2016 at 10:20:40PM +0200, Jilles Tjoelker wrote: > On Mon, Aug 15, 2016 at 07:08:51PM +0000, Konstantin Belousov wrote: > > /* ISO/IEC 9945-1: 1996 */ > > #if __POSIX_VISIBLE >= 199506 || __XSI_VISIBLE > > int fsync(int); > > +int fdatasync(int); > > > > /* > > * ftruncate() was in the POSIX Realtime Extension (it's used for shared > > Apparently these functions were added closely enough in time that they > can stay together here :) Is this a form of suggestion to use other value for POSIX_VISIBLE ? > > +#if 0 > > + if (!fullsync) > > + /* XXXKIB: compete outstanding aio writes */; > > Under the _POSIX_SYNCHRONIZED_IO option, completing outstanding I/O > requests is in fact required for fsync() as well. The fdatasync() > function is completely under the _POSIX_SYNCHRONIZED_IO option. > > We do not implement this option, but keeping fdatasync()'s guarantees a > subset of fsync()'s guarantees seems sensible. I will consider this if and when the AIO flush would be implemented. I looked at the AIO code to estimate the needed work, but did not started coding and quite possible it would be postponed. > > +%% fdatasync vp L L L > > + > > +vop_fdatasync { > > + IN struct vnode *vp; > > + IN struct thread *td; > > +}; > A waitfor parameter like in vop_fsync may be useful to implement > aio_fsync(O_DSYNC) later on. I really do not see how would it be. aio_fsync(O_DSYNC) is equivalent to fdatasync(2) in the async context. Completion of the aio request indicates that virtual fdatasync(2) execution did finished in that context. The use of waitfor in the VOP_FSYNC() is to allow syncer to initiate flush without waiting, or getting notification for the completion. Could you, please, elaborate ? If the KPI change is needed there, it is obviously desirable to make it right before MFC to stable.