linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Karim Yaghmour <karim@opersys.com>
To: "Perez-Gonzalez, Inaky" <inaky.perez-gonzalez@intel.com>
Cc: "'linux-kernel@vger.kernel.org'" <linux-kernel@vger.kernel.org>,
	"'Tom Zanussi'" <zanussi@us.ibm.com>
Subject: Re: [patch] printk subsystems
Date: Tue, 22 Apr 2003 19:28:36 -0400	[thread overview]
Message-ID: <3EA5D024.9728E1A6@opersys.com> (raw)
In-Reply-To: A46BBDB345A7D5118EC90002A5072C780C263A2C@orsmsx116.jf.intel.com


[The CC list has been trimmed]

"Perez-Gonzalez, Inaky" wrote:
> copy_to_user() has to do some more gymnastics in the process,
> but basically, the bulk is the same [at least by reading the
> asm of __copy_user() in usercopy.c and __memcpy() in string.h
> -- it is kind of different, but in function is/should
> be the same - bar that copy_to_user() might sleep due to
> paging-in and preemption and who knows what else].

The difference between copy_to_user() and memcpy() is not a
minor detail. There is a reason why relayfs does its things the
way it does.

> That is a good point, that brought me yesterday night to the following
> doubt. How do you guarantee integrity of the data when reading with
> mmap. In other words, if I am just copying the mmap region, how do
> I know that what I am copying is safe enough, that it is not being
> modified by CPU #2, for example?
[snip]

"Use the source, Luke."

> As I explained below, you don't _have_to_ drop it; however, in some
> cases, it makes sense to drop it because it is meaningless anyway (ie
> the device-plugged message - why would I want the userspace to check
> it if I know there is no device - so I recall it). Errors are another
> matter, and you don't want to recall those.

OK, so you are suggesting we start making a difference in the kernel
between those printks which are "optional" and those that are
"compulsory"? Interested kernel developers are free to voice their
interest at any time now ...

> This is different from running out of space. Like it or not, if you
> have a circular buffer with limited space and you run out ... moc!
> you loose, drop something somewhere to make space for it. This is not
> a kue limitation, this is a property of buffers: they fill up.

I wasn't interested in teaching anyone about buffering basics. The point
I was making is that different buffering schemes have different behaviors
in regards to overflow. IMNSHO I think the drop-the-oldest behavior
is preferable to the drop-whatever-has-gone-away behavior. But maybe
that's just me.

> Now, if you want to make it resizable, that understands Japanese and
> does double loops followed by a nose dive and a vertical climb up,
> well, that's up to the client of the API. And I didn't want to
> constraint the gymnastics that the client could do to handle a buffer.

Well, if we're talking about "double loops followed by a nose dive"
we're certainly not going anywhere. I'll leave it to other LKML
subscribers to decided wether automatically resizeable buffers are
of interest.

> > I'm sorry, but the way I see printk() is that once I send something
> > to it, it really ought to show up somewhere. Heck, I'm printk'ing
> > it. If I plugged a device and the driver said "Your chair is
> > on fire", I want to know about it whether the device has been
> > unplugged later or not.
> 
> I would say this case, printk(), would fit in my second example,
> doesn't it? ... this is one message you want delivered, not recalled.

What I've been trying to say here is that there are no two kinds of
printk. printk is printk and it ought to behave the same in all
instances.

Karim

===================================================
                 Karim Yaghmour
               karim@opersys.com
      Embedded and Real-Time Linux Expert
===================================================

  reply	other threads:[~2003-04-22 23:21 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-22 18:46 [patch] printk subsystems Perez-Gonzalez, Inaky
2003-04-22 23:28 ` Karim Yaghmour [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  5:09 Perez-Gonzalez, Inaky
2003-04-24 18:22 ` bob
2003-04-22  4:02 Perez-Gonzalez, Inaky
2003-04-22  5:52 ` Karim Yaghmour
2003-04-22  6:04 ` Tom Zanussi
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=3EA5D024.9728E1A6@opersys.com \
    --to=karim@opersys.com \
    --cc=inaky.perez-gonzalez@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=zanussi@us.ibm.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).