Re: Understanding locking for buf

From: Alexander Lochmann <alexander.lochmann_at_tu-dortmund.de>
Date: Mon, 27 Feb 2023 15:04:30 UTC

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
> 
>> Am I right that even in this situation the accesses from g_vfs_done are
>> performed?
> I hope that the previous note answers this.
> 
>> Can those accesses be considered as valid exceptions of the overall locking
>> rule 'use b_lock' since the buf is locked?
> I am not sure what would be 'valid exceptions'.  I explained the locking scheme
> used.

- Alex

-- 
Technische Universität Dortmund
Computer Science XII - System Software Group
Alexander Lochmann                PGP key: 0xBC3EF6FD
Otto-Hahn-Str. 16                 phone:  +49.231.7556141
D-44227 Dortmund                  fax:    +49.231.7556116
https://sys.cs.tu-dortmund.de/al