Linux: Focusing relayfs

Submitted by Jeremy
on January 21, 2005 - 1:15pm

The Linux Trace Kit (LTT) and relayfs were merged into Andrew Morton [interview]'s -mm patchset [forum] with the release of 2.6.11-rc1-mm1 [story]. At the time, Andrew encouraged a discussion into the merits of both to determine if they should ultimately be merged into the mainline kernel. The feedback to relayfs suggested that while it worked as advertised, it tended to be overly complicated providing more than was necessary.

Karim Yaghmour reworked the relayfs patch, purging the API and internal code. He notes, "the patch is in fact almost HALF! its original size, loosing 90KB and going from 200KB to 110KB". He went on to list some of the differences explaining, "basically this is about making relayfs do one thing and do it good: transfer high volumes of data to user-space as efficiently as possible." Karim also noted that the updated relayfs patch currently no longer works with LTT as merged in -mm, a temporary state while he waits for feedback on the direction to take. For example, Greg KH noticed some similarities between relayfs and his recently merged debugfs [story], offering suggestions for combining functionality to futher minimize the size of the relayfs patch. Discussion is ongoing.


From: Karim Yaghmour [email blocked]
To: linux-kernel [email blocked]
Subject: [PATCH] relayfs redux for 2.6.10: lean and mean
Date: 	Thu, 20 Jan 2005 01:23:48 -0500


I've reworked the relayfs patch extensively. The API and internals
have been heavily purged. The patch is in fact almost HALF! its
original size, loosing 90KB and going from 200KB to 110KB.

Here's a summary of changes:
- Dropped the lockless scheme (complaints from Christoph, Arjan,
  Ingo, Andrew, etc. regarding the debatable efficiency of cmpxchng
  over traditional locks.)
- Dropped the resizing capabilities (Andi, Christoph, etc.)
- Dropped all user-space read/write capabilities (Andi, Christoph,
  Roman, Tim, etc.) Basically this is about making relayfs do
  one thing and do it good: transfer high volumes of data to
  user-space as efficiently as possible.
- Implemented the ad-hoc mode. This mode contrasts with the
  managed mode (old locking scheme) in that it manages only
  one ring buffer, doesn't care about outside synchronization,
  and is basically the most basic buffer scheme one could have.
  (ongoing discussion with Roman on this issue.)
- Dropped the klog client (Greg).
- Modified API to use pointers instead of IDs (Roman).
- Miscallaneous cleanups (Domen).
- Miscallaneous rearrangement of code (me).

I've tested this with a hacked ltt patch and I can get it
to collect data in the managed mode without a problem.
Reading the data though is another story, I'll update the
LTT patch once I know where the relayfs stuff is heading.
Beware: don't try to use the ltt code in Andrew's tree with
this relayfs, it's a completely different beast.

So without further ado, here's the code. I've removed the
Documentation/filesystems/relayfs.txt file for now (no, don't
worry that's not part of the 90KB that went away ;). It's
probably going to need some rewriting before we're done,
so let's not get distracted by it for now.

Karim

The full patch is here:
http://www.opersys.com/ftp/pub/relayfs/patch-relayfs-redux-2.6.10-050120-real
http://www.opersys.com/ftp/pub/relayfs/patch-relayfs-redux-2.6.10-050120-real.bz2

Signed-off-by: Karim Yaghmour [email blocked]

diffstat:
 fs/Kconfig                            |   18
 fs/Makefile                           |    4
 fs/relayfs/Makefile                   |    8
 fs/relayfs/buffers.c                  |  202 +++++
 fs/relayfs/buffers.h                  |   33
 fs/relayfs/inode.c                    |  520 ++++++++++++++
 fs/relayfs/relay.c                    | 1193 ++++++++++++++++++++++++++++++++++
 fs/relayfs/relay.h                    |   62 +
 fs/relayfs/relay_adhoc.c              |  109 +++
 fs/relayfs/relay_adhoc.h              |   26
 fs/relayfs/relay_managed.c            |  270 +++++++
 fs/relayfs/relay_managed.h            |   26
 include/linux/relayfs_fs.h            |  378 ++++++++++
 14 files changed, 3659 insertions(+), 2 deletions(-)



From: Greg KH [email blocked] Subject: Re: [PATCH] relayfs redux for 2.6.10: lean and mean Date: Thu, 20 Jan 2005 06:50:46 -0800 On Thu, Jan 20, 2005 at 01:23:48AM -0500, Karim Yaghmour wrote: > > I've reworked the relayfs patch extensively. The API and internals > have been heavily purged. The patch is in fact almost HALF! its > original size, loosing 90KB and going from 200KB to 110KB. Hm, how about this idea for cutting about 500 more lines from the code: Why not drop the "fs" part of relayfs and just make the code a set of struct file_operations. That way you could have "relayfs-like" files in any ram based file system that is being used. Then, a user could use these fops and assorted interface to create debugfs or even procfs files using this type of interface. As relayfs really is almost the same (conceptually wise) as debugfs as far as concept of what kinds of files will be in there (nothing anyone would ever rely on for normal operations, but for debugging only) this keeps users and developers from having to spread their debugging and instrumenting files from accross two different file systems. Just an idea... thanks, greg k-h
From: Karim Yaghmour [email blocked] Subject: Re: [PATCH] relayfs redux for 2.6.10: lean and mean Date: Thu, 20 Jan 2005 20:38:25 -0500 Greg KH wrote: > Hm, how about this idea for cutting about 500 more lines from the code: > > Why not drop the "fs" part of relayfs and just make the code a set of > struct file_operations. That way you could have "relayfs-like" files in > any ram based file system that is being used. Then, a user could use > these fops and assorted interface to create debugfs or even procfs files > using this type of interface. > > As relayfs really is almost the same (conceptually wise) as debugfs as > far as concept of what kinds of files will be in there (nothing anyone > would ever rely on for normal operations, but for debugging only) this > keeps users and developers from having to spread their debugging and > instrumenting files from accross two different file systems. However this assumes that the users of relayfs are not going to want it during normal system operation. This is an assumption that fails with at least LTT as it is targeted at sysadmins, application developers and power users who need to be able to trace their systems at any time. I don't mind piggy-backing off another fs, if it makes sense, but unlike debugfs, relayfs is meant for general use, and all files in there are of the same type: relay channels for dumping huge amounts of data to user-space. It seems to me the target audience and basic idea (relay channels only in the fs) are different, but let me know if there's a compeling argument for doing this in another way without making it too confusing for users of those special "files" (IOW, when this starts being used in distros, it'll be more straightforward for users to understand if all files in a mounted fs behave a certain way than if they have certain "odd" files in certain directories, even if it's /proc.) Karim -- Author, Speaker, Developer, Consultant Pushing Embedded and Real-Time Linux Systems Beyond the Limits http://www.opersys.com || [email blocked] || 1-866-677-4546
From: Greg KH [email blocked] Subject: Re: [PATCH] relayfs redux for 2.6.10: lean and mean Date: Thu, 20 Jan 2005 22:43:41 -0800 On Thu, Jan 20, 2005 at 08:38:25PM -0500, Karim Yaghmour wrote: > > Greg KH wrote: > > Hm, how about this idea for cutting about 500 more lines from the code: > > > > Why not drop the "fs" part of relayfs and just make the code a set of > > struct file_operations. That way you could have "relayfs-like" files in > > any ram based file system that is being used. Then, a user could use > > these fops and assorted interface to create debugfs or even procfs files > > using this type of interface. > > > > As relayfs really is almost the same (conceptually wise) as debugfs as > > far as concept of what kinds of files will be in there (nothing anyone > > would ever rely on for normal operations, but for debugging only) this > > keeps users and developers from having to spread their debugging and > > instrumenting files from accross two different file systems. > > However this assumes that the users of relayfs are not going to want > it during normal system operation. That is true. > This is an assumption that fails with at least LTT as it is targeted > at sysadmins, application developers and power users who need to be > able to trace their systems at any time. Are they willing to trade off the performance of LTT to get this? I thought this was being touted as a "when you need to test" type of thing, not a "run it all the time" type of feature. > I don't mind piggy-backing off another fs, if it makes sense, but > unlike debugfs, relayfs is meant for general use, and all files in there > are of the same type: relay channels for dumping huge amounts of data > to user-space. And a driver will never want to have both a relay channel, and a simple debug output at the same time? You are now requiring them to look for that data in two different points in the fs. > It seems to me the target audience and basic idea (relay > channels only in the fs) are different, but let me know if there's a > compeling argument for doing this in another way without making it too > confusing for users of those special "files" (IOW, when this starts > being used in distros, it'll be more straightforward for users to > understand if all files in a mounted fs behave a certain way than if > they have certain "odd" files in certain directories, even if it's > /proc.) So, since you are proposing that relayfs be mounted all the time, where do you want to mount it at? I had to provide a "standard" location for debugfs for people to be happy with it, and the same issue comes up here. Also, why not export your relayfs ops so that someone useing debugfs can create a relay channel in it, or in any other type of fs they might create? thanks, greg k-h

Related Links:
AttachmentSize
relayfs.patch73.61 KB

LTT

Ville (not verified)
on
January 23, 2005 - 5:06am

Isn't this LTT exactly the same as DTrace for Solaris, which has been touted in various places as an "innovative" Solaris technology that should differentiate Solaris from Linux? If that is the case, I have to say it didn't take long and didn't require as much modifications as the Solaris buffs had us believe...

DTrace vs. LTT

on
January 23, 2005 - 10:01am

A quick search of Google came up with a few blog entrys from Bryan Cantrill of Sun where he comments on the DTrace versus LTT debate.

http://blogs.sun.com/roller/page/bmc/20040718#dtrace_vs_dprobes_ltt
http://blogs.sun.com/roller/page/bmc/20040725#the_big_putback
http://blogs.sun.com/roller/page/bmc/20040820#dtrace_on_lkml

One more from Eric Schrock

on
January 23, 2005 - 10:05am

I forgot to include a blog entry from Eric Schrock also from Sun that includes a bit on the fact the the major Linux hackers don't seem to see the potential for LTT.

ttp://blogs.sun.com/roller/page/eschrock/20040924#rebutting_a_rebuttal

> major Linux hackers don't s

Anonymous (not verified)
on
January 24, 2005 - 6:00am

> major Linux hackers don't seem to see the potential for LTT

"Major Linux Hackers" do not do embedded/realtime applications. "Major Linux Hackers" mostly do big and expensive stuff funded by U.S. DOE/DOD/DOO/etc.

LTT is standard in its application field - realtime applications.

I've seen not much alternatives. Doing that manually for every app is just complicated.

But most embedded developers are very reluctant to adopting new kernels: fixing new bugs, porting non-mainstream features. That's a lot of work. Couple of appliances I did developed in past were running 2.2 kernel.

On other side, LTT is definitely not for web-servers, what is major market for Linux now (major == as of made profit). So its inclusion into vanila Linux kernel wasn't ever expected. Thou, I beleive, Karim is tired porting LTT to new kernels, rather than instead doing something new.

P.S. On number of shipments, I expect embedded/realtime Linux already outnumbered its desktop/server counterpart. It's just people sometimes do not realize that some toys they have bought recently runs Linux.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.