linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tom Zanussi <zanussi@us.ibm.com>
To: "Perez-Gonzalez, Inaky" <inaky.perez-gonzalez@intel.com>
Cc: "'karim@opersys.com'" <karim@opersys.com>,
	"'Martin Hicks'" <mort@wildopensource.com>,
	"'Daniel Stekloff'" <dsteklof@us.ibm.com>,
	"'Patrick Mochel'" <mochel@osdl.org>,
	"'Randy.Dunlap'" <rddunlap@osdl.org>,
	"'hpa@zytor.com'" <hpa@zytor.com>,
	"'pavel@ucw.cz'" <pavel@ucw.cz>,
	"'jes@wildopensource.com'" <jes@wildopensource.com>,
	"'linux-kernel@vger.kernel.org'" <linux-kernel@vger.kernel.org>,
	"'wildos@sgi.com'" <wildos@sgi.com>,
	"'Tom Zanussi'" <zanussi@us.ibm.com>
Subject: RE: [patch] printk subsystems
Date: Tue, 22 Apr 2003 01:04:33 -0500	[thread overview]
Message-ID: <16036.56177.468912.341132@lepton.softprops.com> (raw)
In-Reply-To: <A46BBDB345A7D5118EC90002A5072C780C263841@orsmsx116.jf.intel.com>

Perez-Gonzalez, Inaky writes:
 > 
 > > From: Karim Yaghmour [mailto:karim@opersys.com]
 > > 
 > > Consider the following:
 > > 1) kue_read() has a while(1) which loops around and delivers messages
 > > one-by-one (to the best of my understanding of the code you posted).
 > 
 > That's right.
 > 
 > > Hence, delivery time increases with the number of events. In contrast,
 > > relayfs can deliver tens of thousands of events in a single shot.
 > 
 > Sure, I agree with that - it is the price to pay for less code and
 > not having to copy on the kernel side. As I mentioned before to Tom,
 > I don't think that in the long run the overhead will be that much,
 > although it is true it will be very dependent on the average size of 
 > the messages and how many you deliver. If we are delivering two-byte
 > messages at 1M/second rate, the effectivity rate goes down, and with
 > it the scalability.
 > 
 > However, in relayfs that problem is shifted, unless I am missing 
 > something. For what I know, so far, is that you have to copy the
 > message to the relayfs buffer, right? So you have to generate the
 > message and then copy it to the channel with relay_write(). So
 > here is kue's copy_to_user() counterpart.
 > 
 > If there were a way to reserve the space in relayfs, so that then
 > I can generate the message straight over there, that scalability
 > problem would be gone.
 > 

In relayfs, the event can be generated directly into the space
reserved for it - in fact this is exactly what LTT does.  There aren't
two separate steps, one 'generating' the event and another copying it
to the relayfs buffer, if that's what you mean.

[snip]
 > 
 > > > That's the difference. I don't intend to have that. The data
 > > > storage can be reused or not, that is up to the client of the
 > > > kernel API. They still can reuse it if needed by reclaiming the
 > > > event (recall_event), refilling the data and re-sending it.
 > > 
 > > Right, but by reusing the event, older data is thereby destroyed
 > > (undelivered). Which comes back to what I (and others) have been
 > > saying: kue requires the sender's data structures to exist until
 > > their content is delivered.
 > 
 > That's it, that is the principle of a circular buffer. AFAIK, you
 > have the same in relayfs. Old stuff gets dropped. Period. And the
 > sender's data structures don't really need to exist forever,
 > because the event is self-contained. The only part that might
 > be a problem is the destructor [if for example, you were a module,
 > the destructor code was in the module and the module unloaded 
 > without recalling pending events first - the kind of thing
 > you should never do; either use a non-modular destructor or make
 > sure the module count is not decreased until all the events have
 > been delivered or recalled ... simple to do too]
 > 

Well, I'm not sure I understand the details of kue all that well, so
let me know if I'm missing something, but for kue events to really be
self-contained, wouldn't the data need to be copied into the event
unless the data structure containing them was guaranteed to exist
until the event was disposed of one way or another?  And even if the
backing data structure was guaranteed to exist, wouldn't it need to be
static (unchanging) for the data to mean the same thing when it was
delivered as when it was logged?  If the data needs to be copied to
the event to make it self-contained, then you're actually doing 2
copies per event - the first to the event, the second the
copy_to_user().  I'm not sure how much would be necessary in normal
usage, but if you're doing a lot of kmalloc()/kfree() to contain the
events, that's another potentialy large source of overhead.

By contrast, relayfs is worst-case (and best-case) single copy
into the relayfs buffer, which is allocated/freed once during its
lifetime.

-- 
Regards,

Tom Zanussi <zanussi@us.ibm.com>
IBM Linux Technology Center/RAS


  parent reply	other threads:[~2003-04-22  5:53 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-22  4:02 [patch] printk subsystems Perez-Gonzalez, Inaky
2003-04-22  5:52 ` Karim Yaghmour
2003-04-22  6:04 ` Tom Zanussi [this message]
  -- strict thread matches above, loose matches on Subject: below --
2003-04-24 18:56 Manfred Spraul
2003-04-24 19:10 ` bob
2003-04-23  0:28 Perez-Gonzalez, Inaky
2003-04-22 22:53 Perez-Gonzalez, Inaky
2003-04-23  3:58 ` Tom Zanussi
2003-04-22 19:02 Perez-Gonzalez, Inaky
2003-04-22 19:03 ` H. Peter Anvin
2003-04-22 21:52 ` Tom Zanussi
2003-04-22 18:46 Perez-Gonzalez, Inaky
2003-04-22 23:28 ` Karim Yaghmour
2003-04-22  5:09 Perez-Gonzalez, Inaky
2003-04-24 18:22 ` bob
2003-04-22  3:04 Perez-Gonzalez, Inaky
2003-04-22  6:00 ` Tom Zanussi
2003-04-22  2:49 Perez-Gonzalez, Inaky
2003-04-22  4:34 ` Karim Yaghmour
2003-04-21 18:42 Perez-Gonzalez, Inaky
2003-04-21 18:23 Perez-Gonzalez, Inaky
2003-04-21 18:30 ` H. Peter Anvin
2003-04-17 19:58 Perez-Gonzalez, Inaky
2003-04-17 20:34 ` Karim Yaghmour
2003-04-17 21:03   ` Perez-Gonzalez, Inaky
2003-04-17 21:37     ` Tom Zanussi
2003-04-18  7:21     ` Tom Zanussi
2003-04-18  7:42     ` Greg KH
2003-04-21 15:56     ` Karim Yaghmour
2003-04-08 23:15 Chuck Ebbert
2003-04-07 20:13 Martin Hicks
2003-04-08 18:41 ` Pavel Machek
2003-04-08 20:02   ` Jes Sorensen
2003-04-08 21:02     ` Pavel Machek
2003-04-08 21:10       ` H. Peter Anvin
2003-04-08 21:57         ` Pavel Machek
2003-04-08 22:02           ` Jes Sorensen
2003-04-08 22:05           ` H. Peter Anvin
2003-04-08 22:55             ` Martin Hicks
2003-04-08 23:10               ` Randy.Dunlap
2003-04-14 18:33                 ` Patrick Mochel
2003-04-14 22:33                   ` Daniel Stekloff
2003-04-16 18:42                     ` Patrick Mochel
2003-04-16 12:35                       ` Daniel Stekloff
2003-04-16 19:16                       ` Martin Hicks
2003-04-16 12:43                         ` Daniel Stekloff
2003-04-17 15:56                           ` Martin Hicks
2003-04-17 13:58                             ` Karim Yaghmour
2003-04-15 13:27                   ` Martin Hicks
2003-04-15 14:40                     ` Karim Yaghmour
2003-04-08 22:00       ` Jes Sorensen
2003-04-11 19:21 ` Martin Hicks

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=16036.56177.468912.341132@lepton.softprops.com \
    --to=zanussi@us.ibm.com \
    --cc=dsteklof@us.ibm.com \
    --cc=hpa@zytor.com \
    --cc=inaky.perez-gonzalez@intel.com \
    --cc=jes@wildopensource.com \
    --cc=karim@opersys.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mochel@osdl.org \
    --cc=mort@wildopensource.com \
    --cc=pavel@ucw.cz \
    --cc=rddunlap@osdl.org \
    --cc=wildos@sgi.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;
as well as URLs for NNTP newsgroup(s).