From: "greg@kroah.com" <greg@kroah.com>
To: Viacheslav Dubeyko <Slava.Dubeyko@ibm.com>
Cc: "slava@dubeyko.com" <slava@dubeyko.com>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"bpf@vger.kernel.org" <bpf@vger.kernel.org>
Subject: Re: [RFC PATCH v1 3/4] ml-lib: Implement simple testing character device driver
Date: Tue, 10 Feb 2026 06:21:56 +0100 [thread overview]
Message-ID: <2026021045-handstand-arousal-0f74@gregkh> (raw)
In-Reply-To: <d3f051c5920d4f68c00a92845e2491003b516a1f.camel@ibm.com>
On Mon, Feb 09, 2026 at 08:56:47PM +0000, Viacheslav Dubeyko wrote:
> 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@dubeyko.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.
Please do not use sysfs for this at all.
> > > + /* 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.
We don't take code that uses apis incorrectly. Please do not use a cdev
for this type of "testing" driver, that is the incorrect thing to do and
actually makes your code more complex than it needs to.
good luck!
greg k-h
next prev parent reply other threads:[~2026-02-10 5:22 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-06 19:11 [RFC PATCH v1 0/4] Machine Learning (ML) library in Linux kernel Viacheslav Dubeyko
2026-02-06 19:11 ` [RFC PATCH v1 1/4] ml-lib: Introduce Machine Learning (ML) library declarations Viacheslav Dubeyko
2026-02-07 15:52 ` Greg KH
2026-02-09 20:48 ` Viacheslav Dubeyko
2026-02-10 5:20 ` gregkh
2026-02-10 22:44 ` Viacheslav Dubeyko
2026-02-06 19:11 ` [RFC PATCH v1 2/4] ml-lib: Implement PoC of Machine Learning (ML) library functionality Viacheslav Dubeyko
2026-02-06 19:11 ` [RFC PATCH v1 3/4] ml-lib: Implement simple testing character device driver Viacheslav Dubeyko
2026-02-07 15:55 ` Greg KH
2026-02-09 20:56 ` Viacheslav Dubeyko
2026-02-10 5:21 ` greg [this message]
2026-02-06 19:11 ` [RFC PATCH v1 4/4] ml-lib: Implement simple user-space testing application Viacheslav Dubeyko
2026-02-06 22:59 ` [RFC PATCH v1 0/4] Machine Learning (ML) library in Linux kernel Jonathan Corbet
2026-02-09 20:33 ` Viacheslav Dubeyko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2026021045-handstand-arousal-0f74@gregkh \
--to=greg@kroah.com \
--cc=Slava.Dubeyko@ibm.com \
--cc=bpf@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=slava@dubeyko.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox