[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d3f051c5920d4f68c00a92845e2491003b516a1f.camel@ibm.com>
Date: Mon, 9 Feb 2026 20:56:47 +0000
From: Viacheslav Dubeyko <Slava.Dubeyko@....com>
To: "greg@...ah.com" <greg@...ah.com>, "slava@...eyko.com" <slava@...eyko.com>
CC: "linux-mm@...ck.org" <linux-mm@...ck.org>,
"linux-fsdevel@...r.kernel.org"
<linux-fsdevel@...r.kernel.org>,
"linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>,
"bpf@...r.kernel.org" <bpf@...r.kernel.org>
Subject: RE: [RFC PATCH v1 3/4] ml-lib: Implement simple testing character
device driver
On Sat, 2026-02-07 at 16:55 +0100, Greg KH wrote:
> On Fri, Feb 06, 2026 at 11:11:35AM -0800, Viacheslav Dubeyko wrote:
> > Implement simple testing character device driver
> >
> > Signed-off-by: Viacheslav Dubeyko <slava@...eyko.com>
>
> It's hard to tell if this is just an early april-fools joke or not, but
> if it's not:
>
> > +### Character Device Operations
> > +- **Open/Close**: Device can be opened and closed multiple times
> > +- **Read**: Read data from a kernel buffer
> > +- **Write**: Write data to a kernel buffer (1KB capacity)
> > +- **Seek**: Support for lseek() operations
> > +
> > +### IOCTL Commands
> > +- `ML_LIB_TEST_DEV_IOCRESET`: Clear the device buffer
> > +- `ML_LIB_TEST_DEV_IOCGETSIZE`: Get current data size
> > +- `ML_LIB_TEST_DEV_IOCSETSIZE`: Set data size
> > +
> > +### Sysfs Attributes
> > +Located at `/sys/class/ml_lib_test/mllibdev`:
> > +- `buffer_size`: Maximum buffer capacity (read-only)
> > +- `data_size`: Current amount of data in buffer (read-only)
> > +- `access_count`: Number of times device has been opened (read-only)
> > +- `stats`: Comprehensive statistics (opens, reads, writes)
>
> Again, this is not an acceptable use of sysfs.
Maybe, I am missing your point. Are you assuming that I am going to share huge
pieces of data by means of sysfs? If so, then I am not going to use sysfs for
it.
>
> > + /* Allocate device number */
> > + ret = alloc_chrdev_region(&dev_number, 0, 1, DEVICE_NAME);
>
> Don't burn a cdev for this, please use the misc device api.
>
It is not real-life driver. It is only testing driver with the goal to
check/test the ML library infrastructure and to show the potential way of using
the ML library.
As the next step, I am planning to use the ML library for two potential real-
life use-case: (1) GC subsystem of LFS file system, (2) ML-based DAMON approach.
So, this driver is only testing engine of implementing and testing the vision of
ML library.
Thanks,
Slava.
Powered by blists - more mailing lists