Re: [RFC PATCH v2 1/2] kernfs: use kernfs_node specific mutex and spinlock.

From: Tejun Heo
Date: Thu Jan 06 2022 - 15:30:18 EST


Hello,

On Tue, Jan 04, 2022 at 08:40:30AM +0100, Greg KH wrote:
> > We are seeing the launch time of some DB workloads adversely getting
> > affected with this contention.
>
> What workloads? sysfs should NEVER be in the fast-path of any normal
> operation, including booting. What benchmark or real-work is having
> problems here?

In most systems, this shouldn't matter at all but sysfs and cgroupfs host a
lot of statistics files which may be read regularly. It is conceivable that
in large enough systems, the current locking scheme doesn't scale well
enough. We should definitely measure the overhead and gains tho.

If this is something necessary, I think one possible solution is using
hashed locks. I know that it isn't a popular choice but it makes sense given
the constraints.

Thanks.

--
tejun