文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>John Levon

John Levon

时间:2007-05-23  来源:norn_larry

本文出自:http://kerneltrap.org/node/4 Hacker Name:John Levon

This week KernelTrap spoke with John Levon, the author of OProfile and a contributer to KernelNewbies. He offers much insight into both of these projects, as well as reflecting on Linux in general. OProfile is a statistical x86 profiling system for the 2.4 Linux kernel. KernelNewbies is an excellent resource for people looking to understand the Linux kernel, comprised of a web page, an IRC channel, and a mailing list. Read on to learn much more about these projects...

Jeremy Andrews:
Please share a little about yourself and your background...

John Levon:
I live in Manchester (dance capital of England). I did my undergrad degree in
CS at Manchester University, and an M.Sc., and am currently "undergoing" the
Ph.D. process. I also spent a year out working on GSM systems, so haven't yet
totally lost touch with the real world.

JA:
What was your degree in?

John Levon:
Plain old computer science - I wanted to see what I was interested in, and ended up
in systems programming.

JA:
How and when did you get started with Linux?

John Levon:
We had a bored-looking 486, and someone at work told me about Linux, so I gave it
a try (that was in 1997, so I've only been using it for a short while). It was hell
to install, but very entertaining.

JA:
What distribution did you use in 1997? What made the installation so difficult?

John Levon:
redhat 4.2

There were some installers bugs that made reading the CDROM difficult, and then lots of
little niggles, that took me ages to find out how to solve. It was well worth it though.

Also we had no real data on the hardware in the 486, so there was a lot of guesswork.

JA:
Which distribution do you use now?

John Levon:
redhat 7.0. It's not perfect but it's pretty good. I tend to replace stuff with things
built from source anyway.

JA:
I'm a complete fan of Window Maker. What desktop do you use?

John Levon:
KDE 2. Ugly source, impressive product. They seem to be able to deliver what the Gnome
team merely promise.

JA:
What are some of the contributions you've made?

John Levon:
For the kernel, very minor fixes (search the archives ;).

I am involved in maintenance of the kernelnewbies website, and man the IRC channel and
mailing list. I was very pleased when Rik [van Riel] set this project up. It was sorely
needed and very good timing - I was about to start my M.Sc. project, which eventually
evolved into the x86 profiling system "oprofile", which a small team of us still develop.

oprofile provides the opportunity for developers to profile the entire system, from
interrupt routines, all the way down to user-space processes. It does all this at a
very low performance overhead when compared to other profilers. It is already
being used to analyse the networking stack, drivers, and user-space programs, and
is carefully approaching a production release.

JA:
"Very minor fixes" to the kernel are more than I've accomplished! Are there
any examples you wish to share? How'd you choose to contribute where you have?

John Levon:
I fixed things I needed fixing. For example, I needed to add a sysctl interface to
oprofile, so I added some docs for the sysctl API (this was actually a secret ploy
to confirm I was using the API correctly ;).

JA:
Who is currently using oprofile?

John Levon:
SuSE are using oprofile internally for a variety of user-space and kernel tasks,
including work on the networking stack.
HP are using it as part of their internal tools, and have contributed to and sponsored
oprofile development (they leant me an SMP machine)

JA:
What exactly does it mean, to 'profile the entire system'?

John Levon:
Intel and AMD provide performance counter registers on their CPUs which
can count interesting events such as cache line fills. oprofile uses these
counters to determine which routines in the system affect them most. Due to
its design, this includes all code on the system: interrupt handlers, kernel modules,
the kernel, libraries and binaries.

Other profilers focus on particular parts of the system such as a single binary.
This runs the risk of mis-directing the optimisation effort. Its non-intrusive
design allows oprofile to be run on production systems easily; getting more accurate
data than would otherwise be possible.

JA:
What are some of the challenges you've faced with oprofile?

John Levon:
dealing with races and concurrency issues,and all the corner cases, was difficult.

About halfway through writing it, I realised that my basic approach, in two ways,
would never be efficient. So I had to re-write it totally.

After is was released as open source, I started getting patches for things like
the annotated source facility and Athlon support. It always takes a few iterations
for new features to be implemented in a nice way.

JA:
What are some of the other profilers you refer to?

John Levon:
oprofile's basic design (discussed below) is inspired by DEC's DCPI (discussed
in the "Where have all the cycles gone ?" paper).

Other profilers of interest include SGI's kernprof, and perfctr, both of which use
the hardware performance counters.

JA:
How does oprofile achieve its better performance?

John Levon:
oprofile is a statistical profiler - it does not count events accurately (accounting)
but approximates an event distribution through periodic sampling via an interrupt.

The interrupt feeds the sample entry into a hash table, which "soaks up" some of
the sample load. This overflows into a kernel buffer, which is read bya user-space
daemon, which then does the necessary fixup. The samples are recorded into mmap()ed
sample buffers.

oprofile relies on the empirical rule of locality of reference: applications tend to
spend most of their time in nearby regions, both in space and in time.

JA:
How difficult is oprofile to use?

John Levon:
starting is easy, just oprof_start to start the gui, choose an event, start profiler

getting results is done via the command line, e.g. an annotated source tree
can be created via :

op_to_source --source-dir=/src/glibc/ --output-dir=/src/glibc/annotated -i /lib/libc-2.2.so

or try :

oprofpp -l <path to vmlinux>, which shows a summary

eventually the GUI will support the post-profiling stuff too.

JA:
Can you tell me more about kernelnewbies? What is it - all its parts, and why
would people want to use it as a resource?

John Levon:
Kernelnewbies is 3 services (IRC, mailng list, webpage) but more importantly is
an informal network of people; "newbies helping newbies" learn the kernel.

People wanting to learn about the kernel are more than welcome to ask questions
on the list or channel. Often the question will be answered by another newbie. Often
a real kernel guru chips in with some sage advice. More often than not, you'll find
yourself in a discussion about the kernel that ranges far and wide ;)

Don't be afraid to chip in with a question/comment even if what people are discussing goes
over your head - I do it regularly !

The big kernel hackers occassionally come to the channel and discuss what they're hacking
on. Listening in on these exchanges is very educational.

The website provides links, changelogs, faqs, and more: it's a useful starting point
when you're after gaining some general information.

JA:
Who are some of the more familiar people who have stopped by recently?

John Levon:
Greg-Koah Hartman, USB hotplug guru

Jeff Dike, Mr. User-Mode linux

marcelo, phillips, riel, bacchus - see kernelnewbies.org/faq/

JA:
Is kernelnewbies only a resource for those learning the Linux kernel? Or is
there information shared about other kernels as well?

John Levon:
only the IRC channel tends to discuss other kernels. Often you'll see discussion
on BSD's versus Linux's VM

JA:
What is some of the open source software that you use, for development and
general use?

John Levon:
vim; to live without it (and grep and sed) would be hell indeed. Mozilla is shaping up
really well. I use (and hack on) LyX when I need to write papers and the like.

JA:
Have you experimented with any of the journaling filesystems that are available?
Last week we spoke to Keith Owens, and he talked about XFS. Have you tried it?

John Levon:
no. I've been meaning to try ext3 for quite some time, I'm sick of fscks.

JA:
Are there any Linux games you're currently addicted to?

John Levon:
No, though I'm addicted to Elite on my BBC Master (again).

JA:
Do you use other operating systems besides Linux? If so, how do they compare?

John Levon:
nope ! never really felt the need. Everywhere I look I see truly horrible APIs,
and that is what matters most to me. UNIX-like systems inherit the UNIX API,
which in many parts is beautiful in its simplicity.

JA:
What reflections can you offer on the current state of the 2.4 kernel series?
Do you consider it to be stable?

John Levon:
I think the Linus tree is a bit of a mess; I'm used to rapid and often dangerous
kernel releases, but not usually in a supposed stable series. At kernelnewbies,
we tend to recommend the Alan Cox series, as it is provably more stable (going
by reports we get), and in recent times has had good performance.

I am not alone in hoping for 2.5 very soon.

JA:
What do you most look forward to in the upcoming 2.5 kernel?

John Levon:
I'd love to see Linux as a whole become usable as a professional audio solution: it has
the potential of making a great studio O/S, but still has a long way to go in both the
kernel and user-space.

JA:
How would you recommend Linus get the 2.4 tree back to being stable?

John Levon:
open 2.5 and leave the 2.4 series to Alan. Even Linus admits Alan Cox is much
better at maintaining a stable series.

JA:
Alan mentioned recently that he'll likely merge
to the Linus VM in the current -ac series. Do you think this is a good idea? Will
it affect stability?

John Levon:
I think it's a pity. People tend to compare Andrea/Linus VM with old Riel VMs, which
is very unfair to Rik and his code; only more recent Alan kernels contain the performance
fixes. Rik's VM is now very well tested, the Linus one
isn't (yet). This is readily apparent from reading the kernel list...

JA:
Have you met Linus? Alan? Other kernel hackers?

John Levon:
never met any of them; I'm very much on the fringes of the kernel clique. Unlike many
people I don't see a significant barrier to joining the kernel development social group.

JA:
Are you a member of any local Linux users groups?

John Levon:
no. very lazy really, since the guy who runs the Manchester branch works downstairs ;)

JA:
What do you enjoy doing when you're not on your computer?

John Levon:
I'm obsessed with collecting and listening to music. That really takes over the rest
of my life, apart from the mundane stuff. Be careful or I will trap you in a corner
and talk music at you all night.

JA:
I'll bite! ;^) What types of music? Talk away...

John Levon:
People have been saying for ages the guitar is dead. That's nonsense, there is as
much room for a traditional rock band like The Smiths as there always has been. As
well as "indie" music, I listen to a lot of ambient electronica, techno that isn't
too hard, deep house and funky hip hop. Practically anything really as long as it's
not opera !

JA:
I'm a fan of music as well, and always interested in finding something new. Can
you recommend some of your favorite bands and musicians, particularly ones
you've discovered recently?

John Levon:
Truant's album Neither Work Nor Leisure is really good. Mr. Scruff never stops being
brilliant. I really like the Starsailor and Strokes albums. Alpha and Stereolab
are always worthwhile. Silly name, but great band: Crazy Penis. Birdie, Tahiti 80
and I Am Kloot have all had good albums this year. The Avalanches album - album of the year no doubt

Then there's my long-term favourites like St. Etienne, The Cure, The Smiths, the Manic Street
Preachers (pre-richey-disappearance), the jam, Underworld, Suede, They Might Be Giants "Flood",
Orbital, the good Orb albums, The Divine Comedy, Bob Dylan, early Verve, my favourite
house label paperecordings ...

I could go on ;)

JA:
Are there any books or web pages you'd recommend to someone just learning the
kernel?

John Levon:
Obviously, http://kernelnewbies.org ;)

This contains links to many interesting sites, so it's a good starting point. In particular
the patches page lists almost all of the external kernel projects available - existing code
is often the single best resource for a beginner.

JA:
Can you point out a few of the patches that may be most interesting to someone
just learning the kernel?

John Levon:
projects that provide tracing things like IKD and LTT would be interesting to look at.

nullfs is probably good if you're interested in being an FS hacker (along with fs/minix
in the kernel source).

User-mode linux is also a good one.

The plug-in scheduler patch would be great if you'd like to play with Linux's process scheduler.

The compressed cache and mergemem patches are interesting to read.

JA:
Earlier we spoke with Robert Love about his preemptible kernel patch. Have you
used it?

John Levon:
I don't need it. I think it's a useful patch, but really a band-aid - I would prefer
to see any latency problem points in the kernel fixed as normal, rather than introducing
spinlock overhead on all uniprocessor machines. Those who need more than vague real-time
promises need to use a RTOS.

JA:
Thanks.

相关阅读 更多 +
排行榜 更多 +
rento大富翁手游

rento大富翁手游

休闲益智 下载
冲撞赛车3无限金币版

冲撞赛车3无限金币版

赛车竞速 下载
电动火车模拟器内置菜单

电动火车模拟器内置菜单

赛车竞速 下载