linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Karim Yaghmour <karim@opersys.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: Linus Torvalds <torvalds@transmeta.com>,
	Roman Zippel <zippel@linux-m68k.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	LTT-Dev <ltt-dev@shafik.org>
Subject: Re: [PATCH] LTT for 2.5.38 1/9: Core infrastructure
Date: Sun, 22 Sep 2002 18:09:45 -0400	[thread overview]
Message-ID: <3D8E3FA9.7389A61F@opersys.com> (raw)
In-Reply-To: Pine.LNX.4.44.0209222124580.28832-100000@localhost.localdomain


Ingo Molnar wrote:
> On Sun, 22 Sep 2002, Karim Yaghmour wrote:
> 
> > Source bloat is certainly not desirable, as I said to my reply to Ingo.
> 
> (then how should i interpret 90% of the patches you sent to lkml today?)

Please refer to my other email where I explain why tracing is essential
to the day-to-day usage of any kernel. I don't think this is bloat and
the distributions which already include LTT certainly think it's quite
useful to their clients. In fact, most embedded distro actually make
the inclusion of LTT one of the main features with which they sell
Linux to their clients.

> > What is desirable, however, is to have a uniform tracing mechanism
> > replace the ad-hoc tracing mechanisms already implemented in many
> > drivers and subsystems.
> 
> exactly what is the problem with keeping intrusive debugging patches
> separate, just like all the other ones are kept separate?

Again, this is not a kernel debugging patch. As you yourself have stated
elsewhere, instrumenting a kernel for it to yield useful information to
a kernel developer makes the code "butt-ugly" (your words). The trace
statements currently inserted by LTT are clearly useless for any kernel
debugging whatsoever. The trace statements inserted are only useful for
the day-to-day tracing needs of any Linux user.

> It's not like
> this came out of the blue, per-CPU trace buffers (and other tracers) were
> done years ago for Linux.

I don't remember claiming to having implemented the first tracer. However,
I have been working very hard in putting together a rock solid tracer
which includes the best ideas of all existing tracers and offers a wide
range of tools for _any_ user to use. The decision of the attendees of
the RAS BoF at the OLS to standardize on LTT clearly goes in this direction.

Again, please understand that LTT is not a kernel debugger. Any look at
the set of trace statements inserted by LTT will reveal their low value
for kernel developers. These trace statements are meant for providing
users with in-depth and complete understanding of the system's dynamics.

> > The lockless scheme is pretty simple, instead of using a spinlock to
> > ensure atomic allocation of buffer space, the code does an
> > allocate-and-test routine where it tries to allocate space in the buffer
> > and tests if it succeeded in doing so. If so, then it goes on to write
> > the data in the event buffer, otherwise it tries again. In most cases,
> > it does this loop only once and in most worst cases twice.
> 
> (this is in essence a moving spinlock at the tail of the trace buffer -
> same problem.)

Hmm. No offense, but I think you ought to take a better look at the code.

Because events can occur at the interrupt level and on normal non-interrupt
path, any tracer that has to record a broad range of event types needs
to use spin_lock_irqsave(), which is what LTT's tracer used. Now, last
I checked, spin_lock_irqsave() calls on local_irq_save() which, on an
i386 for example, is defined as follows:
#define local_irq_save(x)	__asm__ __volatile__("pushfl ; popl %0 ; cli":"=g" (x): /* no input */ :"memory")

There's a cli() in there. No cli's in the lockless code. Among other
things, this makes the lockless code quite different from any usual
Linux spinlock.

Karim

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

  reply	other threads:[~2002-09-22 22:01 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-22  5:43 [PATCH] LTT for 2.5.38 1/9: Core infrastructure Karim Yaghmour
2002-09-22 10:42 ` Ingo Molnar
2002-09-22 10:50   ` Ingo Molnar
2002-09-22 17:26   ` Roman Zippel
2002-09-22 18:35     ` Linus Torvalds
2002-09-22 19:18       ` Karim Yaghmour
2002-09-22 19:40         ` Ingo Molnar
2002-09-22 22:09           ` Karim Yaghmour [this message]
2002-09-22 22:24             ` Ingo Molnar
2002-09-22 22:41               ` Karim Yaghmour
2002-09-22 22:59                 ` Ingo Molnar
2002-09-22 22:50             ` Ingo Molnar
2002-09-22 23:32               ` Karim Yaghmour
2002-09-23  7:41                 ` Ingo Molnar
2002-09-23 15:12                   ` Karim Yaghmour
2002-09-23 20:11                     ` Andreas Ferber
2002-09-23 23:31                       ` Karim Yaghmour
2002-09-22 21:29       ` [ltt-dev] " bob
2002-09-22 19:06   ` Karim Yaghmour
2002-09-22 19:33     ` Karim Yaghmour
2002-09-22 21:20   ` [ltt-dev] " bob
2002-09-22 21:39     ` Ingo Molnar
2002-09-22 22:37       ` bob
2002-09-22 22:55         ` Ingo Molnar
2002-09-22 22:52           ` bob
2002-09-22 23:02             ` Ingo Molnar
2002-09-22 23:03               ` bob
2002-09-22 23:19                 ` Ingo Molnar
2002-09-22 23:50                   ` bob
2002-09-22 23:32             ` Ingo Molnar
2002-09-23  0:07               ` bob
2002-09-23  7:27                 ` Ingo Molnar
2002-09-23 13:59                   ` bob
2002-09-23  0:08               ` Karim Yaghmour
2002-09-22 22:58         ` Karim Yaghmour
     [not found] <Pine.LNX.4.44.0209221830400.8911-100000@serv.suse.lists.linux.kernel>
     [not found] ` <Pine.LNX.4.44.0209221130060.1455-100000@home.transmeta.com.suse.lists.linux.kernel>
2002-09-22 19:27   ` Andi Kleen
2002-09-24  1:07     ` john slee
2002-09-24 11:40       ` Andi Kleen

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=3D8E3FA9.7389A61F@opersys.com \
    --to=karim@opersys.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ltt-dev@shafik.org \
    --cc=mingo@elte.hu \
    --cc=torvalds@transmeta.com \
    --cc=zippel@linux-m68k.org \
    /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).