Re: [RFC PATCH v1 1/4] ml-lib: Introduce Machine Learning (ML) library declarations

From: Greg KH

Date: Sat Feb 07 2026 - 10:53:00 EST


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.

greg k-h