Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 3 Mar 2023 02:19:32 +0200
From:      Konstantin Belousov <kostikbel@gmail.com>
To:        Alexander Lochmann <alexander.lochmann@tu-dortmund.de>
Cc:        freebsd-fs@freebsd.org
Subject:   Re: Understanding locking for buf
Message-ID:  <ZAE9FKivOiVYGggy@kib.kiev.ua>
In-Reply-To: <1743b9f5-69be-b775-fb57-92b8115d4a81@tu-dortmund.de>
References:  <45d84dae-0ca9-95ed-f6fd-8243797453ff@tu-dortmund.de> <Y/khDDKYYnt4Y6aO@kib.kiev.ua> <8e8d9145-9ee1-195e-3dd3-4e3166ac8abb@tu-dortmund.de> <Y/y8851RQLGR1VwS@kib.kiev.ua> <8e9ac2ec-6387-27b0-5cdc-1d61dbe2c831@tu-dortmund.de> <Y/4fz/hEyNiTjGmb@kib.kiev.ua> <1743b9f5-69be-b775-fb57-92b8115d4a81@tu-dortmund.de>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Mar 01, 2023 at 07:03:47PM +0100, Alexander Lochmann wrote:
> 
> 
> On 28.02.23 16:37, Konstantin Belousov wrote:
> > On Mon, Feb 27, 2023 at 04:04:30PM +0100, Alexander Lochmann wrote:
> > > 
> > > 
> > > On 27.02.23 15:23, Konstantin Belousov wrote:
> > > > Not quite.  Sync io (bread()) means that caller performs bufwait() on the
> > > > buffer.  It is still subject to the LK_KERNPROC ownership move.
> > > Ehm. Has this behavior changed recently?
> > > Our kernel version uses LK_KERNPROC to distinguish between sync and async
> > > IO. How would that be possible if ownershipt changes in either case?
> > > https://iris.cs.tu-dortmund.de/freebsd-lockdoc/latest/source/sys/geom/geom_vfs.c#L127
> > I think this is simply not _very_ accurate.  It would still catch some sync
> > operations.
> > 
> I'm sorry. What do you mean? Can you please give more details?
> 
> You said that the buf is still subject to the LK_KERNPROC ownership move
> even for sync IO.
> But why is LK_KERNPROC used to distinguish between sync and async IO?
> Have look at g_vfs_done: https://iris.cs.tu-dortmund.de/freebsd-lockdoc/latest/source/sys/geom/geom_vfs.c#L127
> If you ownership is moved in either case, none of the following lines would
> be executed: 'mp->mnt_stat.f_syncreads++;' 'mp->mnt_stat.f_syncwrites++;'.

All it means it that the statistic output by mount -v would be somewhat off
in the split of io ops by sync/async.  The total count is still correct.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?ZAE9FKivOiVYGggy>