All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kay Sievers <kay.sievers@vrfy.org>
To: Robert Love <rml@ximian.com>
Cc: Daniel Stekloff <dsteklof@us.ibm.com>, Greg KH <greg@kroah.com>,
	akpm@osdl.org, linux-kernel@vger.kernel.org
Subject: Re: [patch] kernel sysfs events layer
Date: Thu, 02 Sep 2004 22:29:27 +0200	[thread overview]
Message-ID: <1094156968.26430.59.camel@localhost.localdomain> (raw)
In-Reply-To: <1094142469.2284.15.camel@betsy.boston.ximian.com>

On Thu, 2004-09-02 at 12:27 -0400, Robert Love wrote:
> On Thu, 2004-09-02 at 15:26 +0200, Kay Sievers wrote:
> 
> > o What kind of signal do we need? A lazy string, a well defined set like
> >   ADD/REMOVE/CHANGE?
> >   Or can we get rid of the whole signal? But how can we distinguish between
> >   add and remove? Watching if the sysfs file comes or goes is not a option,
> >   I think.
> 
> I think (from our off-list discussions) that we really need the signal.
> Agreed?
> 
> I do think that defining the signal to specific values makes sense, e.g.
> KEVENT_ADD, KEVENT_REMOVE, KEVENT_MOUNTED, etc.  We could also send the
> attribute as a string.
> 
> To get around the hotplug issue that would occur without 'enum kevent',
> as we discussed, we could have a "hotplug_added" signal or whatever.
> Nothing wrong with that.

Hmm, the threads are a bit mixed up now, I will only reply to this one:

I think we can get rid of the kset at all, but let's see what Greg says
about it. Until that, I assume, we don't need it.

We don't depend on the multicast groups, they are only used cause the
concept was so nice, I think. I don't expect a lot of listeners on the
netlink socket, so we can live without it, if it makes something
easier. 

Yes, in our current incarnation of kevent, we need the signal as a
string value to describe what actually happens with this kobject. It is
nice as it would be easy to implement a event, without touching to much
code in the subsystems.
I like that model, if we all agree to go this way. It would look like
Robert's example in the other mail:

  int send_kevent(struct kobject *kobj,
                  const char *signal);


But Greg and Dan have valid points, that this won't work well for the
single attribute case, we possibly should cover, without encoding it in
the signal string.
If we may agree to export data only by creating an attribute in the
kobject instead of the signal "verb", it would look like this:

   int send_kevent(struct kobject *kobj,
                   struct attribute *attr,
                   const char *signal)

The signal may be well defined as "add|remove|change"(like
the /sbin/hotplug ACTION= value today), which will mandate that we
create any data as attributes (no exception). We may allow NULL as the
attribute and send the event for the whole kobject this way. 

For the mount example it would look like this:
  send_kevent(bdev->kobj, &attr_owner, "change");

For cpu overheating:
  send_kevent(cpu->kobj, &attr_temperature_state, "change");

For hotplug:
  send_kevent(cpu->kobj, NULL, "add");
  send_kevent(cpu->kobj, NULL, "remove");

This model may be a bit over-ambitious, but in the long run, it may be
the better one, as it doesn't require a signal dictionary and _any_
state is readable at any time from userspace.

It is more similar to our current /sbin/hotplug-notification, we use
e.g. for udev. There we get only the sysfs-path and the action for a
device that gets connected or disconnected.
The second model would conceptually only be a strong sysfs-state-change
notification for kobjects(sysfs-directory) or single kobject-attributes
(sysfs-attribute).

Any thoughts?

Thanks,
Kay



  reply	other threads:[~2004-09-02 20:38 UTC|newest]

Thread overview: 105+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-31 21:42 [patch] kernel sysfs events layer Robert Love
2004-08-31 21:56 ` Andrew Morton
2004-08-31 21:58   ` Robert Love
     [not found]     ` <20040831150645.4aa8fd27.akpm@osdl.org>
2004-08-31 22:05       ` Robert Love
2004-09-02  8:34         ` Greg KH
2004-09-02 12:02           ` Daniel Stekloff
2004-09-02 13:26             ` Kay Sievers
2004-09-02 16:27               ` Robert Love
2004-09-02 20:29                 ` Kay Sievers [this message]
2004-09-02 12:49           ` Kay Sievers
2004-09-02 16:25           ` Robert Love
2004-09-02 18:35             ` Daniel Stekloff
2004-09-02 18:41               ` Robert Love
2004-09-04  0:54             ` Greg KH
2004-09-05  2:18               ` Kay Sievers
2004-09-05  3:01                 ` Robert Love
2004-09-05  2:58               ` Robert Love
2004-09-05  7:35                 ` Arjan van de Ven
2004-09-05 12:18                 ` Kay Sievers
2004-09-06  2:06                   ` Kay Sievers
2004-09-10 23:54                     ` Greg KH
2004-09-11  0:18                       ` Tim Hockin
2004-09-11  0:48                         ` Greg KH
2004-09-11  1:23                           ` Daniel Stekloff
2004-09-11  4:45                             ` Robert Love
2004-09-11  1:45                           ` Tim Hockin
2004-09-11 16:56                             ` Greg KH
2004-09-11 11:35                           ` Dave Jones
2004-09-11 18:15                             ` Greg KH
2004-09-11  4:09                       ` Robert Love
2004-09-11 16:53                         ` Greg KH
2004-09-13 14:45                           ` Kay Sievers
2004-09-15  0:07                             ` Greg KH
2004-09-15  1:09                               ` Kay Sievers
2004-09-15  1:11                                 ` Tim Hockin
2004-09-15  2:10                                   ` Robert Love
2004-09-15  3:17                                     ` Tim Hockin
2004-09-15  3:42                                       ` Greg KH
2004-09-15  4:48                                         ` Tim Hockin
2004-09-15  5:09                                           ` Greg KH
2004-09-15  6:21                                             ` Tim Hockin
2004-09-15  6:45                                               ` Jan Dittmer
2004-09-15  6:47                                                 ` Tim Hockin
2004-09-15  6:50                                                   ` Jan Dittmer
     [not found]                                                     ` <20040915065515.GA11587@hockin.org>
2004-09-15  7:39                                                       ` Jan Dittmer
2004-09-15  7:56                                                         ` Paul Jackson
2004-09-15  8:32                                                           ` Jan Dittmer
2004-09-15 14:24                                                             ` Paul Jackson
2004-09-15  8:19                                                 ` Karol Kozimor
2004-09-15 15:48                                                   ` Tim Hockin
2004-09-15 16:11                                                     ` Jan Dittmer
2004-09-15 13:14                                               ` Kay Sievers
2004-09-15 21:27                                               ` Greg KH
2004-09-15  9:07                                           ` Andrew Grover
2004-09-15 18:58                                             ` Robert Love
2004-09-15  3:48                                 ` Greg KH
2004-09-15  1:19                               ` Robert Love
2004-09-15  3:44                                 ` Greg KH
2004-09-15 19:40                                   ` Greg KH
2004-09-15 20:10                                     ` Robert Love
2004-09-15 20:22                                       ` Tim Hockin
2004-09-15 20:26                                         ` Robert Love
2004-09-15 20:31                                           ` Tim Hockin
2004-09-15 20:33                                             ` Robert Love
2004-09-15 20:47                                               ` Tim Hockin
2004-09-15 20:49                                                 ` Robert Love
2004-09-15 20:56                                                   ` Tim Hockin
2004-09-15 21:01                                                     ` Robert Love
2004-09-15 21:03                                                     ` Kay Sievers
2004-09-15 21:23                                                     ` Greg KH
2004-09-15 21:26                                                       ` Robert Love
2004-09-15 21:34                                                         ` Tim Hockin
2004-09-15 21:38                                                           ` Robert Love
2004-09-16  1:21                                                             ` Herbert Poetzl
2004-09-16  4:08                                                               ` Greg KH
2004-09-16 14:10                                                                 ` Herbert Poetzl
2004-09-16 15:08                                                                   ` Greg KH
2004-09-16 18:33                                                                     ` Herbert Poetzl
2004-09-15 21:35                                                         ` Greg KH
2004-09-15 21:46                                                           ` Tim Hockin
2004-09-15 21:47                                                             ` Robert Love
2004-09-15 21:38                                                         ` Kay Sievers
2004-09-15 21:39                                                           ` Robert Love
2004-09-15 21:49                                                             ` Tim Hockin
2004-09-15 21:54                                                               ` Greg KH
2004-09-15 20:34                                             ` Kay Sievers
2004-09-15 21:21                                       ` Greg KH
2004-09-15 21:26                                         ` Robert Love
2004-09-15 21:34                                           ` Kay Sievers
2004-09-15 21:35                                           ` Greg KH
2005-07-06 22:02                     ` Mike Snitzer
2005-07-06 22:18                       ` Greg KH
2004-09-05  3:59               ` Robert Love
2004-08-31 21:58 ` Chris Wedgwood
2004-08-31 22:02   ` Robert Love
2004-08-31 22:00 ` Andrew Morton
2004-08-31 22:00   ` Robert Love
2004-08-31 22:10     ` Andrew Morton
2004-08-31 22:08       ` Robert Love
2004-09-01  2:05 ` Daniel Stekloff
2004-09-01 10:07   ` Kay Sievers
2004-09-02 20:45     ` Daniel Stekloff
2004-09-02 22:15       ` Kay Sievers
2004-09-03 23:59         ` Daniel Stekloff
2004-09-04  8:14           ` Greg KH

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=1094156968.26430.59.camel@localhost.localdomain \
    --to=kay.sievers@vrfy.org \
    --cc=akpm@osdl.org \
    --cc=dsteklof@us.ibm.com \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rml@ximian.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.