linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Viacheslav Dubeyko <Slava.Dubeyko@ibm.com>
To: "gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>
Cc: "linux-mm@kvack.org" <linux-mm@kvack.org>,
	"slava@dubeyko.com" <slava@dubeyko.com>,
	"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 1/4] ml-lib: Introduce Machine Learning (ML) library declarations
Date: Tue, 10 Feb 2026 22:44:09 +0000	[thread overview]
Message-ID: <363063e09bace65c83bf04fd4d2c89c877eca581.camel@ibm.com> (raw)
In-Reply-To: <2026021005-tacky-pentagon-aab1@gregkh>

On Tue, 2026-02-10 at 06:20 +0100, gregkh@linuxfoundation.org wrote:
> On Mon, Feb 09, 2026 at 08:48:17PM +0000, Viacheslav Dubeyko wrote:
> > On Sat, 2026-02-07 at 16:52 +0100, Greg KH wrote:
> > > On Fri, Feb 06, 2026 at 11:11:33AM -0800, Viacheslav Dubeyko wrote:
> > > > + * @kobj: /sys/<subsystem>/<ml_model>/ ML model object
> > > > + * @kobj_unregister: completion state for <ml_model> kernel object
> > > > + */
> > > > +struct ml_lib_model {
> > > > +	atomic_t mode;
> > > > +	atomic_t state;
> > > > +	const char *subsystem_name;
> > > > +	const char *model_name;
> > > > +
> > > > +	struct ml_lib_subsystem *parent;
> > > > +
> > > > +	spinlock_t parent_state_lock;
> > > > +	struct ml_lib_subsystem_state * __rcu parent_state;
> > > > +
> > > > +	spinlock_t options_lock;
> > > > +	struct ml_lib_model_options * __rcu options;
> > > > +
> > > > +	spinlock_t dataset_lock;
> > > > +	struct ml_lib_dataset * __rcu dataset;
> > > > +
> > > > +	struct ml_lib_model_operations *model_ops;
> > > > +	struct ml_lib_subsystem_state_operations *system_state_ops;
> > > > +	struct ml_lib_dataset_operations *dataset_ops;
> > > > +	struct ml_lib_request_config_operations *request_config_ops;
> > > > +
> > > > +	/* /sys/<subsystem>/<ml_model>/ */
> > > > +	struct kobject kobj;
> > > > +	struct completion kobj_unregister;
> > > > +};
> > > 
> > > Do NOT abuse sysfs for something like this.  Please make your own
> > > filesystem or char device or something else, but this is not what sysfs
> > > is for at all, sorry.
> > > 
> > 
> > Currently, sysfs entry is used for sending commands (start, stop,
> > prepare_dataset, discard_dataset) from user-space on the kernel-space side. And
> > the intention of using sysfs entries is the export information about kernel
> > subsystem and exchanging by commands and notifications between user-space and
> > kernel-space sides. Do you mean that it is wrong using of sysfs? Have I
> > misunderstood your point?
> 
> Yes, this is NOT the correct use of sysfs, do NOT use it for an api like
> this at all.  Use the correct ones instead.
> 
> 

So, to summarize your recommendations:
(1) Do not use sysfs;
(2) Do not use character device but misc device instead;
(3) Implement specialized file system;
(4) eBPF?

Would you like to share any other recommendations?

Thanks,
Slava.

  reply	other threads:[~2026-02-10 22:44 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 [this message]
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
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=363063e09bace65c83bf04fd4d2c89c877eca581.camel@ibm.com \
    --to=slava.dubeyko@ibm.com \
    --cc=bpf@vger.kernel.org \
    --cc=gregkh@linuxfoundation.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