Linux-Development-Sys Digest #747, Volume #8 Thu, 24 May 01 18:13:22 EDT
Contents:
Re: Newbie question about Linux Devie Driver Application (Adam Fineman)
Re: Nonblocking wait() (Adam Fineman)
Re: Raid A0 patch with Kernel 2.2.17 and ReiserFS (bill davidsen)
Re: creating files under /proc? (bill davidsen)
Re: mmap() and msync() extensions? (bill davidsen)
Re: Best PC config for linux/crosscompiler development (bill davidsen)
Re: Via / Cyrix MIII processor problems (bill davidsen)
Re: Nonblocking wait() (bill davidsen)
Re: creating files under /proc? (Adam Fineman)
Re: Best PC config for linux/crosscompiler development (Adam Fineman)
Re: X windows ("Darren LS")
Re: Via / Cyrix MIII processor problems ("Jeremy Savoy")
Re: thundering-herd vs wake-one ([EMAIL PROTECTED])
Re: thundering-herd vs wake-one ([EMAIL PROTECTED])
Re: Nonblocking wait() ([EMAIL PROTECTED])
Re: thundering-herd vs wake-one (Lee Harr)
----------------------------------------------------------------------------
From: Adam Fineman <[EMAIL PROTECTED]>
Subject: Re: Newbie question about Linux Devie Driver Application
Date: Thu, 24 May 2001 13:51:33 -0400
nickwang wrote:
>
> HI,ALL:
> From the man page I can see that ioctl return -1 when account error,and
> there are also some "errno" like "EBADF","EFAULT"... Do you know how can I
> get these? You know, I want to see where the problem is.
> Thanks again!!
man errno; man perror; man strerror
HTH
--
Adam
------------------------------
From: Adam Fineman <[EMAIL PROTECTED]>
Subject: Re: Nonblocking wait()
Date: Thu, 24 May 2001 14:06:56 -0400
Please quote the relevent portions of the post you are replying to.
morpheus wrote:
>
> Yeah, i know that this won't compile, it was just a pseudo-code
> sample.
> But waitpid() is nonblocking, is it? If I do a waitpid(pid_t,
> status, options) then the child would return to the father before
> having finished,
If you set the options correctly. Otherwise, waitpid() will not return
until the child is finished.
> wouldn't it? And what are this strange options?
> Wich one should I use?
if you use:
int options = WNOHANG;
Then the waitpid() call will return immediately if no child has exited.
This option is used when we want to fetch a child's status, but we don't
want to block.
Is this what you want? It is unclear from your post why you are calling
waitpid().
--
Adam
------------------------------
From: [EMAIL PROTECTED] (bill davidsen)
Crossposted-To: comp.os.linux.setup
Subject: Re: Raid A0 patch with Kernel 2.2.17 and ReiserFS
Date: Thu, 24 May 2001 18:16:02 +0000 (UTC)
In article <tQGM6.870$[EMAIL PROTECTED]>, <[EMAIL PROTECTED]> wrote:
| I'll add another question to the thread. 2 of the developers I work with say
| that reiserFS should be used for development because it is more robust then
| ext2 and in the embedded system we are developed, the power frequently is
| removed from the target system running Linux.
Your developers may not understand the issues... reiserfs recovers
faster, but not significantly better. You are more likely to have a sane
directory structure after crash, but the correctness (or even existance)
of the data is about the same as ext2. Also, there can be corruption
even so, and that's why there is an fsck (by whatever name) for
reiserfs. If you don't run it you could have undetected problems. See
the reiser docs, I don't remember the details, one of the developers
explained.
Note that unrecoverable corruption is unlikely with either fs, but not
impossible. And a look at the changelogs for 2.4 development shows that
there are still fairly frequent cases where reiser needs fixes for cases
which are infrequent enough to have missed developer testing, but happen
often enough to require fixes now. I would regard reiser as less stable
than ext2, even though the design has features which some people find
very useful.
| As a consequence of the fact
| that power can be removed at any time, there is no graceful shutdown of this
| system.
Other people have addressed this in other ways than "let it crash and
recover..." That mode doesn't sound particularly robust.
| I am told by one of the developers that reiserFS will be the new
| default file system in the next release of Linux.
That's by no means clear unless the decision is being made on
political rather than technical factors. IBM and SGI have spent time and
money porting the JFS and XFS journaling filesystems to Linux. In
particular JFS has been around in production for a decade, and is likely
to have a lot fewer obscure bugs than any new fs. Since JFS (on AIX)
includes all sorts of RAID-0 and 1 capability and features of the VFS, I
don't know if they are in the Linux version or if the current Linux RAID
and VFS stuff is used.
| I wonder what some of the
| developers here have to say about reiserFS and its reliability in a
| situation where power can and will be removed frequently from an embedded
| system.
Reiser was never designed for such use, nor was any other Linux fs
I've seen. Note that in a system crash with power on the physical writes
complete, vs. a power fail in which the actual write may be defective.
Journaling filesystems in general are aimed at the former case, since in
a normal computer application the power supply almost always has power
to keep the physical write going, and give the CPU a ms or two to use
powerfail to abort queued i/o. To actually drop all power generates
problems which most vendors do not try to solve with off the shelf
solutions.
Doesn't mean it can't work, but the operation is outside the usual
design parameters. perhaps the reiser developers will have some
additional comments, I don't in any way speak for them.
--
bill davidsen <[EMAIL PROTECTED]> CTO, TMR Associates, Inc
At LinuxExpo Sun was showing Linux applications running on Solaris.
They don't get it, the arrow points the other way. There's a reason why
there's no SolarisExpo, Solaris is a tool; Linux is a philosophy, a
religion, a way of life, and only incidentally an operating system.
------------------------------
From: [EMAIL PROTECTED] (bill davidsen)
Subject: Re: creating files under /proc?
Date: Thu, 24 May 2001 18:19:15 +0000 (UTC)
In article <[EMAIL PROTECTED]>,
Timur Tabi <[EMAIL PROTECTED]> wrote:
| I have a driver which creates a directory and a couple files under
| /proc, namely /proc/zfc/. Is it possible to create new files in
| /proc/zfc/ using the ln, cat, or cp commands? I can't seem to find any
| examples of doing that, so I'm not sure whether it can be done (or where
| to look to find out).
I doubt that you can do that. /proc is magic, not real data, and is
managed by the kernel. I found that you can't even change permissions on
things there, when one distribution changed a kernel tuning parameter in
/proc/sys to read-only! Needless to say we built a kernel of our own :-(
--
bill davidsen <[EMAIL PROTECTED]> CTO, TMR Associates, Inc
At LinuxExpo Sun was showing Linux applications running on Solaris.
They don't get it, the arrow points the other way. There's a reason why
there's no SolarisExpo, Solaris is a tool; Linux is a philosophy, a
religion, a way of life, and only incidentally an operating system.
------------------------------
From: [EMAIL PROTECTED] (bill davidsen)
Subject: Re: mmap() and msync() extensions?
Date: Thu, 24 May 2001 18:22:23 +0000 (UTC)
In article <[EMAIL PROTECTED]>,
At150bogomips <[EMAIL PROTECTED]> wrote:
| Dragon Cvetkovic <[EMAIL PROTECTED]> wrote:
| >You mean something like madvise(3C)?
| [snip]
|
| Yes !!! . . . and no.
|
| That Solaris feature is in some ways more than what I was talking about (being
| able to communicate more information to the kernel) and less--it does not
| indicate how an application can tell the kernel not to immediately truly map
| all of a file into memory.
|
| (I suppose this is another reason why Solaris is considered worth big-bucks.)
|
| E.g., suppose one had a database file, it might be nice if one could map the
| whole into virtual memory and let the OS worry about how much real memory
| should be used. I suspect that mmap() tries to place the entire requested
| region into memory at one time. Rather, it would be nice if one could simply
| indicate that one wishes to use virtual addresses to handle file access rather
| than a file handle (with kernel buffers).
It works that way now... unless the mlock() call is used, the kernel
brings in only what you use. That's what "demand paging" means.
--
bill davidsen <[EMAIL PROTECTED]> CTO, TMR Associates, Inc
At LinuxExpo Sun was showing Linux applications running on Solaris.
They don't get it, the arrow points the other way. There's a reason why
there's no SolarisExpo, Solaris is a tool; Linux is a philosophy, a
religion, a way of life, and only incidentally an operating system.
------------------------------
From: [EMAIL PROTECTED] (bill davidsen)
Subject: Re: Best PC config for linux/crosscompiler development
Date: Thu, 24 May 2001 18:32:59 +0000 (UTC)
In article <[EMAIL PROTECTED]>,
John Beardmore <[EMAIL PROTECTED]> wrote:
| As I recall, GNU make won't compile in parallel, a huge defect in my
| view, but if you can be bothered to organise // compilation, throwing
| CPUs at it might help so long as disk or memory access don't become a
| bottle neck.
See -j in 'man make,' it's been that way for a long time. My make
manpage, dated "22 August 1989" has the option, I use it to build
kernels.
make bzImage modules MAKE='make -j5'
where '5' is 1+Ncpu on that system, 3 for daul.
If you want to run on Power, the IBM Dorral is reported to work, and
there's a dual Mac I've never tried. Or lots of Intel systems if you
want to cross compile.
I have no idea on Mac prices, the Dorral was ~$3k when I bought some,
and probably cheaper now, you can build a nice Intel dual 1GHz with RAID
and all for <$2k.
--
bill davidsen <[EMAIL PROTECTED]> CTO, TMR Associates, Inc
At LinuxExpo Sun was showing Linux applications running on Solaris.
They don't get it, the arrow points the other way. There's a reason why
there's no SolarisExpo, Solaris is a tool; Linux is a philosophy, a
religion, a way of life, and only incidentally an operating system.
------------------------------
From: [EMAIL PROTECTED] (bill davidsen)
Subject: Re: Via / Cyrix MIII processor problems
Date: Thu, 24 May 2001 18:37:02 +0000 (UTC)
In article <[EMAIL PROTECTED]>,
Jeremy Savoy <[EMAIL PROTECTED]> wrote:
| I am having trouble using a Cyrix MII processor with Linux. The 2.4.4
| kernel has support for this processor build directly in, you can select
| it as one of the processor types. Using kgcc to build the kernel, it
| will hang where it should be passing control over to init every time. I
| also happened to notice that the kernel thinks the CPU has 16M of L2
| cache which is of course no where close to correct. Anyone seen anything
| like this??
I did a Redhat 7.0 install on one of those, which worked fine. Then I
tried to build a kernel and the compiler crashed with a segfault using
the MII config. This was the "fixed" gcc, not kgcc. I had some other
problem with that, but I can't remember what it was. I have to try again
over the holiday, so I will be reminded.
If it isn't nice to me I'll build the kernel on another machine and
just drop it in. That'll teach it ;-)
--
bill davidsen <[EMAIL PROTECTED]> CTO, TMR Associates, Inc
At LinuxExpo Sun was showing Linux applications running on Solaris.
They don't get it, the arrow points the other way. There's a reason why
there's no SolarisExpo, Solaris is a tool; Linux is a philosophy, a
religion, a way of life, and only incidentally an operating system.
------------------------------
From: [EMAIL PROTECTED] (bill davidsen)
Subject: Re: Nonblocking wait()
Date: Thu, 24 May 2001 18:47:57 +0000 (UTC)
In article <hiWO6.20088$[EMAIL PROTECTED]>,
morpheus <[EMAIL PROTECTED]> wrote:
| I got through the implementation of my shell, now I wish to make a
| background option... this wait, i need to implement a nonblocking
| wait... is this waitpid?
If you mean to just poll for any dead child, this is the wrong way to do
it. You want to catch SIGCHLD and issue a wait() only when a child has
died. That way no poll. Or have the signal catcher increment a flag and
check the flag as your poll.
If you have a LOT of processes running, you can use three counters, one
for number of processes started, one counting SIGCHLD, one counting the
number of waits completed.
--
bill davidsen <[EMAIL PROTECTED]> CTO, TMR Associates, Inc
At LinuxExpo Sun was showing Linux applications running on Solaris.
They don't get it, the arrow points the other way. There's a reason why
there's no SolarisExpo, Solaris is a tool; Linux is a philosophy, a
religion, a way of life, and only incidentally an operating system.
------------------------------
From: Adam Fineman <[EMAIL PROTECTED]>
Subject: Re: creating files under /proc?
Date: Thu, 24 May 2001 15:07:14 -0400
Timur Tabi wrote:
>
> I have a driver which creates a directory and a couple files under
> /proc, namely /proc/zfc/. Is it possible to create new files in
> /proc/zfc/ using the ln, cat, or cp commands? I can't seem to find any
> examples of doing that, so I'm not sure whether it can be done (or where
> to look to find out).
>
"Can" and "should" are two very different questions. Why do you want to
create entries in /proc using ln, cat, or cp?
The entries in the /proc psuedo-filesystem really just call a routine
when you read them. They don't actually reside on disk, and they are
not actually files.
These routines are invariably defined in the kernel (or in a module).
If the driver isn't putting out enough information for you in /proc,
look for the routines in the driver's source code and add the
information yourself. It's actually fairly easy to do.
--
Adam
------------------------------
From: Adam Fineman <[EMAIL PROTECTED]>
Subject: Re: Best PC config for linux/crosscompiler development
Date: Thu, 24 May 2001 15:09:32 -0400
bill davidsen wrote:
>
<snip>
> you can build a nice Intel dual 1GHz with RAID
> and all for <$2k.
>
One rarely sees the words "nice" and "Intel" in such proximity....
--
Adam
------------------------------
From: "Darren LS" <[EMAIL PROTECTED]>
Subject: Re: X windows
Date: Thu, 24 May 2001 20:47:33 +0100
Elias Poulojohn <[EMAIL PROTECTED]> wrote in message
news:9dscqu$p29$[EMAIL PROTECTED]...
> Darren LS wrote:
>
> > Hi all. Can anyone point me toward a decent tutorial to X windows
> > programming?
> >
> > Thank you most kindly
> >
> > Darren
> >
> >
> >
> I am a newbie in X too but as far as i understand it's quite difficult to
> programm directly in Xlib.Perhaps for starters you'd like to start with an
> easier API like Qt or GTK
> --
yeah i just got them. QT took 4 hours to compile on my old dinosaur but it
was worth it. What a babe of a peice of kit
> X~
------------------------------
From: "Jeremy Savoy" <[EMAIL PROTECTED]>
Subject: Re: Via / Cyrix MIII processor problems
Date: Thu, 24 May 2001 21:11:25 GMT
As it turns out, since I installed with a Celeron in the box, RedHat
installed the i686 optimized version of glibc. The MIII doesn't support
i686 instructions, so after reverting to the i386 compiled version of
glibc, this problem went away.
In article <[EMAIL PROTECTED]>, "Jeremy Savoy"
<[EMAIL PROTECTED]> wrote:
> I am having trouble using a Cyrix MII processor with Linux. The 2.4.4
> kernel has support for this processor build directly in, you can select
> it as one of the processor types. Using kgcc to build the kernel, it
> will hang where it should be passing control over to init every time. I
> also happened to notice that the kernel thinks the CPU has 16M of L2
> cache which is of course no where close to correct. Anyone seen anything
> like this??
>
>
> Jeremy Savoy
> IBM - Retail Store Solutions
> [EMAIL PROTECTED]
>
------------------------------
From: [EMAIL PROTECTED]
Crossposted-To: comp.unix.bsd.freebsd.misc
Subject: Re: thundering-herd vs wake-one
Date: 24 May 2001 20:31:52 GMT
In comp.os.linux.development.system Karl Heyes <[EMAIL PROTECTED]>
wrote:
| In article <[EMAIL PROTECTED]>, "Unknown"
| <[EMAIL PROTECTED]> wrote:
|
|> In comp.unix.bsd.freebsd.misc Karl Heyes
|> <[EMAIL PROTECTED]> wrote: | wake-one is whats
|> implemented in 2.4 so that only one listener is awoken and | therefore the
|> scaling is better. There are better solutions to select/poll | as they
|> suffer from the array scanning on large scale systems.
|
|> What better solutions do you have or suggest?
|
| If I remember correctly TUX uses sigio to process requests, although there is
| other things like zerocopy TCP being thrown in for good measure.
If there are 200 processes waiting for an incoming connection on a
listening socket, how many of them will receive the SIGIO when one
connection comes in?
--
=================================================================
| Phil Howard - KA9WGN | Dallas | http://linuxhomepage.com/ |
| [EMAIL PROTECTED] | Texas, USA | http://phil.ipal.org/ |
=================================================================
------------------------------
From: [EMAIL PROTECTED]
Crossposted-To: comp.unix.bsd.freebsd.misc
Subject: Re: thundering-herd vs wake-one
Date: 24 May 2001 20:38:30 GMT
In comp.os.linux.development.system Linus Torvalds <[EMAIL PROTECTED]>
wrote:
| In article <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]> wrote:
|>
|>Linux recently added "wake-one" capability in version 2.4 (patches exist
|>for 2.2),
|
| No.
|
| 2.2 does indeed have "wake_one()" patches, but the whole concept is in
| my opinion pretty broken. The waker does not know what the sleepers are
| doing, and cannot safely wake up just one sleeper.
I can believe that. Just blinding deciding to wake only one process
does have risks.
| What 2.4.x has is the notion of the _waiters_ (who _do_ know what they
| are doing) saying "I'm an exclusive waiter, once you wake me up there's
| no point in waking any other exclusive waiters". That's very different
| from "wake_one()", although it also avoids the herd behaviour when used
| correctly.
So how do waiters say this (I'm assuming they say it to the kernel in
some way)? I looked for a description in the kernel Documentation tree
but didn't find any.
|>What I am asking for is for information that specifically describes how
|>wake-one is supposed to work, including things like what circumstances it
|>offers no advantages, and what circumstances it does. I'm also interested
|>in compatibility issues with programs written with the understanding that
|>wake-many would be the way.
|
| There are no compatibility issues.
|
| Any waiters that have "wake-many" semantics (the classic example of this
| is "select()") will simply not claim to be exclusive, and behaviour does
| not change (even if there are exclusive waiters _too_ - exclusive
| waiters are only exclusive of each other).
So in a mix of exclusive and normal waiters, all the normal ones can be
woken up anyway. That wouldn't be a problem as long as I can make all of
my listeners be exclusive. But I hope I can do this on more than one listen
socket at the same time, since my need includes being able to listen on
more than 1 specifically bound IP address and/or port.
| So in this kind of schenario a wakeup is a wakeup, and the person who
| does the wakeup doesn't know (and _shouldn't_ know) what the sleeper
| actually intends to do.
Then I should make all my listeners say "I'm an exclusive waiter ...".
I want to know how. A document describing all this would be great. If
there isn't one, I could try to write one (once I know what goes in it).
--
=================================================================
| Phil Howard - KA9WGN | Dallas | http://linuxhomepage.com/ |
| [EMAIL PROTECTED] | Texas, USA | http://phil.ipal.org/ |
=================================================================
------------------------------
From: [EMAIL PROTECTED]
Subject: Re: Nonblocking wait()
Date: 24 May 2001 20:43:02 GMT
On Thu, 24 May 2001 18:47:57 +0000 (UTC) bill davidsen <[EMAIL PROTECTED]> wrote:
| If you have a LOT of processes running, you can use three counters, one
| for number of processes started, one counting SIGCHLD, one counting the
| number of waits completed.
Ah, this probably explains why gnu-pop3d gets its process count
out of sync when it suddenly experiences multiple exiting children
when running in daemon mode.
--
=================================================================
| Phil Howard - KA9WGN | Dallas | http://linuxhomepage.com/ |
| [EMAIL PROTECTED] | Texas, USA | http://phil.ipal.org/ |
=================================================================
------------------------------
From: [EMAIL PROTECTED] (Lee Harr)
Crossposted-To: comp.unix.bsd.freebsd.misc
Subject: Re: thundering-herd vs wake-one
Date: Thu, 24 May 2001 22:03:40 +0000 (UTC)
Reply-To: [EMAIL PROTECTED]
On 23 May 2001 21:30:31 GMT, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
> What I am asking for is for information that specifically describes how
> wake-one is supposed to work, including things like what circumstances it
> offers no advantages, and what circumstances it does. I'm also interested
> in compatibility issues with programs written with the understanding that
> wake-many would be the way.
>
> I'd also like to know some about the history of it, including when it
> showed up in FreeBSD (or was it always there?).
>
Not sure this is what you are looking for, but could be
the new kqueue / kevent system in FreeBSD.
There is a paper on this here:
http://people.freebsd.org/~jlemon/
------------------------------
** FOR YOUR REFERENCE **
The service address, to which questions about the list itself and requests
to be added to or deleted from it should be directed, is:
Internet: [EMAIL PROTECTED]
You can send mail to the entire list by posting to the
comp.os.linux.development.system newsgroup.
Linux may be obtained via one of these FTP sites:
ftp.funet.fi pub/Linux
tsx-11.mit.edu pub/linux
sunsite.unc.edu pub/Linux
End of Linux-Development-System Digest
******************************