Linux-Development-Sys Digest #333, Volume #8      Fri, 8 Dec 00 23:13:12 EST

Contents:
  Zombie processes? ("Daniel Lenski")
  opening and writing to a file from w/in the kernel (Brian Horton)
  Re: opening and writing to a file from w/in the kernel (Grant Edwards)
  Re: Intel's SSE block copy paper (was: Re: A faster memcpy and bzero for x86) ("Ken 
Whaley")
  Re: A challenging problem... (Kaelin Colclasure)
  Re: Problem with LVM and LILO (Bruce Stephens)
  kernel: svc: unknown version(3) when loading nfs ([EMAIL PROTECTED])
  hdh: <3>ide-scsi unsupported command dev 22:40 ([EMAIL PROTECTED])
  pivot_root() and ramfs ([EMAIL PROTECTED])
  Re: opening and writing to a file from w/in the kernel ([EMAIL PROTECTED])
  Re: kernel: svc: unknown version(3) when loading nfs ([EMAIL PROTECTED])
  Re: syslog and variable arguments? (Erik Max Francis)

----------------------------------------------------------------------------

From: "Daniel Lenski" <[EMAIL PROTECTED]>
Subject: Zombie processes?
Date: Fri, 08 Dec 2000 16:29:39 +0500

Hi,
I have this little server daemon program that does something like this:

if (!fork()) {
        handle_incoming_connection(socket);
        close(socket);
        exit(0)
}

But it seems to leave me with a zombie process every time it forks and
then exits.  How can I get rid of these zombie processes?  I don't want
to have to do a wait() for the child processes to exit, since that would
destroy the whole point of handling multiply client connections ...

Any help will be appreciated.

-- 
Daniel Lenski
[EMAIL PROTECTED]

"If we couldn't laugh at things that didn't make sense,
we couldn't react to a lot of the world around us."
   --Calvin and Hobbes

------------------------------

From: Brian Horton <[EMAIL PROTECTED]>
Subject: opening and writing to a file from w/in the kernel
Date: Fri, 08 Dec 2000 15:28:48 -0600

I thought that I had found some write-up somewhere on how to do this,
but now I can't find it. Anyone help me out? I want to be able to write
to my own 'error log'-type file from within the kernel. Doable?

thx!  .bri.

------------------------------

From: [EMAIL PROTECTED] (Grant Edwards)
Subject: Re: opening and writing to a file from w/in the kernel
Date: Fri, 08 Dec 2000 21:44:04 GMT

In article <[EMAIL PROTECTED]>, Brian Horton wrote:

>I thought that I had found some write-up somewhere on how to do this,
>but now I can't find it. Anyone help me out? I want to be able to write
>to my own 'error log'-type file from within the kernel. Doable?

Probably, but that's _exactly_ what the syslog facility is for
(and it's far simpler), why not use it?

Here's how kHTTPd does file access via the kernel (AFAIK it
only does reads. Writes maybe harder):

     http://www.fenrus.demon.nl/kernel.html

-- 
Grant Edwards                   grante             Yow!  If elected, Zippy
                                  at               pledges to each and every
                               visi.com            American a 55-year-old
                                                   houseboy...

------------------------------

From: "Ken Whaley" <[EMAIL PROTECTED]>
Subject: Re: Intel's SSE block copy paper (was: Re: A faster memcpy and bzero for x86)
Date: Fri, 8 Dec 2000 14:15:35 -0800


"Maciej Golebiewski" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> Boris Gjenero wrote:
> >
> > Ken Whaley wrote:
> > >
> > > Here's Intel's paper on block copy using the SSE
> > > instructions.   rep movsb is still king for small (< 48 byte)
> > > copies!
> > >
> > > http://developer.intel.com/software/idap/media/pdf/copy.htm
>
> I tried to compile the code, both the C and asm versions, but my
> gcc/as do not support SSE :( I tried a few other assemblers I
> found on freshmeat but none of them would accept SSE mnemonics.
> Anyone knows where I can find one that can do that?
>

Intel has a 30-day free evaluation program for their compiler.
$400 bucks retail.  Runs only on m$.

You could try checking current development versions of binutils and
gcc (as opposed to the "stable" version), they may support SSE.

VTune ($429, m$ only) also comes with the compiler and a pile of other
tools.  If you need to do lots of x86 optimization, it's a nice
package.  You can port the code over to linux once it's optimized
on m$.  Since this is a linux group, I'll ask: does anybody know if
there is a linux tool equivalent to vtune on x86 that uses the CPU's
performance monitoring features?  One that can analyze a program w/out
having to recompile the program?     It's got to be just a matter of
(hopefully little) time before VTune is available for linux.

http://www.intel.com/software/products/compilers/c50/

> (and the concerns expressed
> by others in this thread do not apply in my case, as all the apps
> that are going to use will use FPU anyway).

If you are using MMX and floating point simultaneously, you will suffer
some performance loss when switching between the two.  SSE uses
different registers, so you can mix floating point and SSE w/no performance
problems.

Oh, and it looks like there's no support for SSE in kernel 2.2.17 (except
through a patch, perhaps, if anyone knows, please speak up)
There is support in 2.4.0-test10.



------------------------------

From: Kaelin Colclasure <[EMAIL PROTECTED]>
Crossposted-To: comp.lang.lisp
Subject: Re: A challenging problem...
Date: 08 Dec 2000 15:13:07 -0800

Frode Vatvedt Fjeld <[EMAIL PROTECTED]> writes:

[...]
> Kaelin Colclasure <[EMAIL PROTECTED]> writes:
[...]
> > Paradoxically, dynamic instrumentation of the product of a static
> > language by an external agent is relatively
> > straightforward. Precisely because the language itself is static, it
> > eventually all comes down to specific offsets into the program's
> > text segment.
[...]
> > But of course, dynamic instrumentation is trivially supported in
> > Common Lisp if the agent itself lives in the same Lisp image. In
> > fact, advice, tracing and several other Common Lisp features are
> > built on this capability.
> 
> Yes, and I'd say you should think very carefully before you throw away
> all this. The ptrace stuff is a necessity in C, but that doesn't mean
> it's desirable in lisp.

I find this argument pretty compelling.

> > Hmmm, perhaps the only realistic way to adequately support such
> > dynamic languages is to collaborate with their native capabilities
> > rather than trying to second-guess them. Maybe I need to rethink my
> > assertion that all higher-level IPC functions are verboten. But one
> > motivation for that restriction was to minimize the amount of noise
> > incurred if system call tracing was enabled along with embedded
> > probes...
> 
> There are contradictory goals of low intrusion and quality of
> extracted information. (Ideally, the user should be able to chose
> which is preferred.) But the situation is rather different in lisp and
> C. Lisp images are much more soundly constructed, and with good
> introspective capabilities (and dynamism), which means you can do lots
> of stuff (high-level or whatever) with only some performance intrusion
> (i.e. a slow-down, but practically no functional intrusion; the
> program still works exactly the same).
[...]

You've encouraged me to think about the problem from a new angle.
Particularly your parenthetical statement above about allowing users
to trade-off between intrusiveness and quality of information.

I'm now thinking that, rather than employing esoteric methods for
locating probes in the variety of possible executable formats, it
makes more sense to defer the cataloging of probes to a separate
tool. Thus, the trex program would simply consult a file with
definitions for each of the various probes a process has available.
In the event that the definitions are not available (perhaps because
this executable came from a third party), trex can be instructed to
simply enable all probes in the process -- but dump them in "raw" form
since it doesn't have the information necessary to "cook" the data.

>From the raw data it would no doubt be possible to reverse-engineer
suitable definitions for at least the most interesting probes.

In addition to better meeting your suggested goals, this approach
considerably simplifies the implementation of trex, is more portable
across OS/hardware platforms, and also simplifies the extension of the
system to support new programming languages.

The trade-off, of course, is the introduction of ancillary "probe
definition" files, and the necessity of a tool chain to support their
construction and maintenance. But I'm thinking this is probably a fine
compromise...

-- Kaelin

------------------------------

From: Bruce Stephens <[EMAIL PROTECTED]>
Subject: Re: Problem with LVM and LILO
Date: 08 Dec 2000 23:12:34 +0000

David Vidal Rodriguez <[EMAIL PROTECTED]> writes:

> Bruce Stephens wrote:
> 
> > I don't know.  Try the LVM web site, and the mailing lists there.
> > Personally, I kept my root partition and /boot as ordinary partitions.
> > If you have any ordinary partitions (for example, the root partition),
> > you should be able to stick kernel images on one of those and use
> > LILO.  Even an MSDOS partition ought to work, I think, so long as
> > you're careful not to defragment the partition.
> 
> I have carefully read the documentation & FAQs of LVM and they say
> explicitly that it is possible to mount a root LVM. I have such a
> root, indeed. The problem appears when lilo looks for devices
> recursively in /dev - it could also have to do with the lvm-module
> itself: I don't know much about the kernel internals, but it could
> be possible that a module that uses a specific special device
> (major-minor pair) registers it into the kernel as a valid device of
> some sort - in this case, a disk, partition, or something thar can
> contain a filesystem.

Lilo is quite a bit simpler than that: it just needs to know where
(physically) the kernel image is.

> I imagine a possibility of going around the problem, and this is the use of
> a so-called partition alias. I have read that a partition can overlap  with
> another though that does not make much sense, but it is useful for the
> following case:
> You have a LV from which you know the exact location and length (in units of
> physical sectors;
> that information is given by the program pvdisplay -v). It has to be fully
> contained within a partition and be contiguous (just like a normal
> partition). Then you can define a partition with sfdisk -uS -N <number>
> /dev/hda<number> which points exactly to the beginning and end of the LV.
> Now you have a partition alias for the LV. Before working with lilo you
> should mount the root-alias as /, work in the runlevel S and disable lvm.
> The "root="-entry of the lilo.conf has to be a major-minor number - the one
> of your LV- , and it should boot from your partition-alias.
> 
> That could be a work-around until lilo supports lvm. What do you think about
> this approach?

I *think* that should work.  As I say, the important thing is that
lilo be able to determine where on the disk the kernel image is.  I
can see one or two messages on some mailing list on this topic---it
might be worth you checking those out (I just did a search for "lvm
lilo" on Google).

However, I wouldn't recommend this for new users.  (If you're stuck
with a disk you can't create a real partition on, then you'll have to
work around it, I guess.)  

If you have a choice, then it's surely much simpler to make sure that
/boot is an ordinary partition.  It only has to be small (5 or 10M
should be enough), and I think lilo is likely to insist that it's not
mirrored or striped anyway, so the benefits one would get from using
LVM on it seem pretty minimal.

------------------------------

From: [EMAIL PROTECTED]
Crossposted-To: 
alt.os.linux.mandrake,alt.os.linux.slackware,alt.uu.comp.os.linux.questions,comp.os.linux.misc,comp.os.linux.networking,comp.os.linux.hardware,comp.os.linux.setup
Subject: kernel: svc: unknown version(3) when loading nfs
Date: Fri, 08 Dec 2000 23:17:06 GMT
Reply-To: [EMAIL PROTECTED]

I am getting a message when the nfs service loads:
  kernel: svc: unknown version (3)

When I do a ps ax I can also see this for rpc.mountd:
  rpc.mountd --no-nfs-version 3

Any ideas what this means and possibly how to clean this up?

best regards,
charles wilkins

p.s micro who?

------------------------------

From: [EMAIL PROTECTED]
Crossposted-To: 
alt.os.linux.mandrake,alt.os.linux.slackware,alt.uu.comp.os.linux.questions,comp.os.linux.misc,comp.os.linux.networking,comp.os.linux.hardware,comp.os.linux.setup
Subject: hdh: <3>ide-scsi unsupported command dev 22:40
Date: Fri, 08 Dec 2000 23:29:11 GMT
Reply-To: [EMAIL PROTECTED]

I have recently set up an atapi ide zip drive. I have compiled in scsi
emulation and the drive works properly as /dev/sda1.

Prior to using the scsi emulation, I was using the floppy-ide driver
and was able to use the drive as /dev/hdh1, just with some less
functionality.

Since I have gone to scsi emulation, I have this message appearing
after the partition check is done:

Dec  8 18:22:25 linux02 kernel: scsi0 : SCSI host adapter emulation
for IDE ATAPI devices
Dec  8 18:22:25 linux02 kernel: scsi : 1 host.
Dec  8 18:22:25 linux02 kernel:   Vendor: IOMEGA    Model: ZIP 100
Rev: 13.A
Dec  8 18:22:25 linux02 kernel:   Type:   Direct-Access
ANSI SCSI revision: 00
Dec  8 18:22:25 linux02 kernel: Detected scsi removable disk sda at
scsi0, channel 0, id 0, lun 0
Dec  8 18:22:25 linux02 kernel: scsi : detected 1 SCSI disk total.
Dec  8 18:22:25 linux02 kernel: SCSI device sda: hdwr sector= 512
bytes. Sectors= 196576 [95 MB] [0.1 GB]
Dec  8 18:22:25 linux02 kernel: sda: Write Protect is off
Dec  8 18:22:25 linux02 kernel: Partition check:
Dec  8 18:22:25 linux02 kernel:  sda: sda1
Dec  8 18:22:25 linux02 kernel: md.c: sizeof(mdp_super_t) = 4096
Dec  8 18:22:25 linux02 kernel:  hda: hda1 < hda5 hda6 hda7 >
Dec  8 18:22:25 linux02 kernel:  hdc: [PTBL] [1021/255/63] hdc1 < hdc5
hdc6 hdc7 >
Dec  8 18:22:25 linux02 kernel:  hdh:<3>ide-scsi: hdh: unsupported
command in request queue (0)
Dec  8 18:22:25 linux02 kernel: end_request: I/O error, dev 22:40
(hdh), sector 0
Dec  8 18:22:25 linux02 kernel:  unable to read partition table

What program is the "partition check?"

What or where is the request queue? I notice that when I boot from
floppy that this message does not occur.

Thanks in advance!
charles wilkins

p.s. 

linux rocks!

------------------------------

From: [EMAIL PROTECTED]
Subject: pivot_root() and ramfs
Date: Sat, 09 Dec 2000 02:08:52 -0000

Has anyone tried pivot_root() in a way that would make a ramfs
filesystem become the new root?  Looking through the source I
see some ambiguities that don't mesh with my understanding of
how this should work.  I guess the fundamental problem is that
ramfs doesn't have an associated device.  But the big problem
I see is it doesn't seem to work with the "df" command.  Maybe
this is another artifact of the lack of a device?

My plan is this.  The initrd will have one program /etc/init
which the kernel will start as PID 1.  This program will mount
a ramfs filesystem in a temporary place like /ramfs.  Then it
will mount another filesystem as /mnt to get a tar-like file
to populate /ramfs filesystem with.  Then /mnt will be unmounted
and /ramfs will be pivoted to / pushing the previous root over
to /oldroot.  This program will now execve() /etc/init from the
new ramfs based root (2nd stage init).  This 2nd stage program
will now unmount /oldroot then execve() /bin/init or /sbin/init
which will be the real init program.

I originally was going to try this via /linuxrc and let the
kernel do the root switching like it normally would, but in
this case it needs a device major,minor to do the mount of the
new root filesystem, which ramfs doesn't really have.  So it
seems maybe I could do this via /etc/init and call pivot_root
directly.

Anyone see any pitfalls in this?

-- 
=================================================================
| Phil Howard - KA9WGN |   Dallas   | http://linuxhomepage.com/ |
| [EMAIL PROTECTED] | Texas, USA | http://phil.ipal.org/     |
=================================================================

------------------------------

From: [EMAIL PROTECTED]
Subject: Re: opening and writing to a file from w/in the kernel
Date: Sat, 09 Dec 2000 02:14:45 -0000

On Fri, 08 Dec 2000 21:44:04 GMT Grant Edwards <[EMAIL PROTECTED]> wrote:

|>I thought that I had found some write-up somewhere on how to do this,
|>but now I can't find it. Anyone help me out? I want to be able to write
|>to my own 'error log'-type file from within the kernel. Doable?
|
| Probably, but that's _exactly_ what the syslog facility is for
| (and it's far simpler), why not use it?

I can imagine some cases where using syslog could be bad.  These would
be where depending on a userland process to record the message may be
unsafe.  Possibly the amount of data to be written could be very large
or could be binary in nature.

But most of the time it would seem syslog would be appropriate.  Now if
I can just find the time to go make a patch to syslog to make a better
log rotation scheme.

-- 
=================================================================
| Phil Howard - KA9WGN |   Dallas   | http://linuxhomepage.com/ |
| [EMAIL PROTECTED] | Texas, USA | http://phil.ipal.org/     |
=================================================================

------------------------------

From: [EMAIL PROTECTED]
Crossposted-To: 
alt.os.linux.mandrake,alt.os.linux.slackware,alt.uu.comp.os.linux.questions,comp.os.linux.misc,comp.os.linux.networking,comp.os.linux.hardware,comp.os.linux.setup
Subject: Re: kernel: svc: unknown version(3) when loading nfs
Date: Sat, 09 Dec 2000 02:25:08 GMT
Reply-To: [EMAIL PROTECTED]

This fix wasn't too hard to find.

There is a routine in the nfs script in /etc/rc.d/init.d/nfs that
checks for version 3 of nfs. Because I am running a version 2, for the
moment I have commented out the routine from running. mountd no
executes without an argument.

On Fri, 08 Dec 2000 23:17:06 GMT, [EMAIL PROTECTED] wrote:

>I am getting a message when the nfs service loads:
>  kernel: svc: unknown version (3)
>
>When I do a ps ax I can also see this for rpc.mountd:
>  rpc.mountd --no-nfs-version 3
>
>Any ideas what this means and possibly how to clean this up?
>
>best regards,
>charles wilkins
>
>p.s micro who?


------------------------------

From: Erik Max Francis <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps
Subject: Re: syslog and variable arguments?
Date: Fri, 08 Dec 2000 19:15:00 -0800

Daniel Lenski wrote:

> I've written
> a
> fair-sized program using my wrapper function debuglog, which takes a
> printf-style format list.  Now I want to make it work with syslog, but
> I
> can't pass it a variable argument list.  Is there an easy way to do
> this,
> or does anybody know of a good logging library that will hide the gory
> details?

Why can't you just write a wrapper around syslog?

-- 
 Erik Max Francis / [EMAIL PROTECTED] / http://www.alcyone.com/max/
 __ San Jose, CA, US / 37 20 N 121 53 W / ICQ16063900 / &tSftDotIotE
/  \ Women are equal because they are not different any more.
\__/ Erich Fromm
    Interstelen / http://www.interstelen.com/
 A multiplayer, strategic, turn-based Web game on an interstellar scale.

------------------------------


** 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 (and comp.os.linux.development.system) via:

    Internet: [EMAIL PROTECTED]

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
******************************

Reply via email to