Index | Thread | Search

From:
Martin Pieuchot <mpi@grenadille.net>
Subject:
Re: Use foffset() to push the KERNEL_LOCK()
To:
Vitaliy Makkoveev <mvs@openbsd.org>
Cc:
Mark Kettenis <mark.kettenis@xs4all.nl>, anton@openbsd.org, visa@openbsd.org, tech@openbsd.org
Date:
Thu, 13 Nov 2025 09:38:53 +0000

Download raw body.

Thread
On 12/11/25(Wed) 22:05, Vitaliy Makkoveev wrote:
> [...] 
> I like the idea to push kernel lock deeper and keep it around
> VOP_READ()/VOP_WRITE(). We don't need to move vn_lock()/VOP_LOCK(), so
> the race for `f_offset' will be excluded.
> 
> I can make this diff by myself if mpi@ has no interest in this
> direction.

Sure, I don't mind.

Note that there are currently two independent  bottlenecks when it comes
to FS syscalls.  One is related to VOP_READ() and VOP_WRITE() and I have
a plan to address it.

The other is related to namei(9) (doopenat(), dofstatat(), and
sys___realpath()) and will certainly reduce the KERNREL_LOCK()
contention with fewer efforts.

So if you're interested in reducing the KERNEL_LOCK() contention in this
area, may I suggest you look at vn_open() and all others parts of the
kernel namei(9) is not yet surrounded by a KERNEL_LOCK() dance?  Then we
can start pushing it further into namei(9).

Thanks,
Martin