Re: [PATCH v2 0/6] kernfs: proposed locking and concurrency improvement

From: Greg Kroah-Hartman
Date: Mon Jun 22 2020 - 14:03:15 EST


On Mon, Jun 22, 2020 at 01:48:45PM -0400, Tejun Heo wrote:
> Hello, Ian.
>
> On Sun, Jun 21, 2020 at 12:55:33PM +0800, Ian Kent wrote:
> > > > They are used for hotplugging and partitioning memory. The size of
> > > > the
> > > > segments (and thus the number of them) is dictated by the
> > > > underlying
> > > > hardware.
> > >
> > > This sounds so bad. There gotta be a better interface for that,
> > > right?
> >
> > I'm still struggling a bit to grasp what your getting at but ...
>
> I was more trying to say that the sysfs device interface with per-object
> directory isn't the right interface for this sort of usage at all. Are these
> even real hardware pieces which can be plugged in and out? While being a
> discrete piece of hardware isn't a requirement to be a device model device,
> the whole thing is designed with such use cases on mind. It definitely isn't
> the right design for representing six digit number of logical entities.
>
> It should be obvious that representing each consecutive memory range with a
> separate directory entry is far from an optimal way of representing
> something like this. It's outright silly.

I agree. And again, Ian, you are just "kicking the problem down the
road" if we accept these patches. Please fix this up properly so that
this interface is correctly fixed to not do looney things like this.

thanks,

greg k-h