Linux-Development-Sys Digest #442, Volume #8     Thu, 25 Jan 01 16:13:15 EST

Contents:
  Sending signals to a multithreaded application (Travis Shirk)
  Re: Sending signals to a multithreaded application ("Arthur H. Gold")
  Name # of Msgs. Latest Post by 01/25/2001 Sending signals to a multithSending 
signals to a multi-threaded app ([EMAIL PROTECTED])
  Re: Httpd Error. (=?iso-8859-1?Q?Morten_B=F8hmer?=)
  Help to get microseconds cputime precision (Happosai)
  Having trouble compiling tulip.c in RedHat 7 (jtnews)
  Re: How to use network TP4 protocol on linux (Andi Kleen)
  Re: discarding backing store (Andi Kleen)
  Re: Kernel Mods ver 2.2.X ???? ([EMAIL PROTECTED])
  Re: Name # of Msgs. Latest Post by 01/25/2001 Sending signals to a multithSending 
signals to a multi-threaded app (Kaelin Colclasure)
  Re: Help to get microseconds cputime precision (Kaelin Colclasure)
  Re: Having trouble compiling tulip.c in RedHat 7 ("Markus Spiritus Familiaris")
  Socketcall (EOIN RYAN)
  Re: RAID tools cannot compile under 2.4.0 (George Houpis)
  Flash Device Driver for Linux ([EMAIL PROTECTED])
  Re: discarding backing store (Wolfram Gloger)
  Re: Help to get microseconds cputime precision (Dave Blake)
  SMP with two different clockspeeds (J.R. Lockwood)
  Re: Help to get microseconds cputime precision (Johnny Choque)
  Re: harddisk and partitions ("Ken Wilson")

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

From: Travis Shirk <[EMAIL PROTECTED]>
Subject: Sending signals to a multithreaded application
Date: Thu, 25 Jan 2001 05:16:51 GMT



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

Date: Thu, 25 Jan 2001 00:08:21 -0600
From: "Arthur H. Gold" <[EMAIL PROTECTED]>
Subject: Re: Sending signals to a multithreaded application

Travis Shirk wrote:
[nothing]
...OK, whatcha wanna know?
-- 
Artie Gold, Austin, TX  (finger the cs.utexas.edu account
for more info)
mailto:[EMAIL PROTECTED] or mailto:[EMAIL PROTECTED]
--
A: Yes I would. But not enough to put it out.

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

From: [EMAIL PROTECTED]
Subject: Name # of Msgs. Latest Post by 01/25/2001 Sending signals to a multithSending 
signals to a multi-threaded app
Date: Thu, 25 Jan 2001 08:05:10 GMT

Okay, my last message on this subject was
hosed...here it is again:

Fellow Linux Hackers,

I'm testing some signal handling routines that
I've implemented in a
multi-threaded server application.  I use the kill
command (I've tested
with both the tcsh version and /bin/kill) and it
seems that I must specify
the PID of the signal handling thread instead of
the PID of the main
thread.  First some background:

I have 4 threads (and under linux 4 kernel
processes).  One thread is
dedicated to handling the the signals (I use
sigwait within this thread)
and all others block the signals which this thread
handles. For example,
a 'ps' shows the following PIDs:
26795 (main)
26799 (the listening thread)
26800 (the request handler)
26801 (the signal handler)

What I would like to do is '/bin/kill -s TERM
26795', but when I do this
the signal is not seen by the handler.  If I
CTRL-C in the terminal where
I've run the program the signal is seen and
handled properly.  In order
to use kill I need to specify the PID of the
signal handling thread.
In this case PID 26801.  When my server starts it
writes the main PID
to a file.  I would like to use this PID to pass
SIGTERM, SIGHUP, SIGUSR1,
etc.  But it looks like I'm going to have to write
the PID of the signal
handler instead.  This seems like a kludge to me
since it is Linux
specific.  On Solaris and HPUX I can use kill on
the only PID that
shows up under 'ps'.

Do I need to do something special.  I guess I
could have main perform the
sigwait, but I think my current design is more
modular.  Any ideas?


Thanks!


Sent via Deja.com
http://www.deja.com/

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

From: =?iso-8859-1?Q?Morten_B=F8hmer?= <[EMAIL PROTECTED]>
Subject: Re: Httpd Error.
Date: Thu, 25 Jan 2001 09:28:43 +0100

This is a multi-part message in MIME format.

=======_NextPart_000_017C_01C086B1.360C6810
Content-Type: text/plain;
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

One of the following should resolve the problem

1. Add maestro to your host file
2. Use ip-adress instead of hostname in the httpd.conf file

--=20
Med vennlig hilsen=20
Morten B=F8hmer - [EMAIL PROTECTED]
AdCo Partner AS
Bjellandveien 14 - 3172 VEAR
[EMAIL PROTECTED]
http://www.veggers.no
  "Allan Van Zyl" <[EMAIL PROTECTED]> wrote in message =
news:94m88c$ffo$[EMAIL PROTECTED]...
  In my /etc/boot.log file this error comes up on boot time Does anyone =
know how to resolve this error or what possibly could be wrong.

  Jan 23 19:14:57 maestro nfs: rpc.mountd startup succeeded
  Jan 23 19:14:57 maestro nfs: rpc.nfsd startup succeeded
  Jan 23 19:15:01 maestro httpd: [Tue Jan 23 19:15:01 2001] [error] =
Cannot resolve host name maestro.infotech-online.co.za --- ignoring!
  Jan 23 19:15:01 maestro httpd: [Tue Jan 23 19:15:01 2001] [error] =
Cannot resolve host name test.netd.co.za --- ignoring!
  Jan 23 19:15:01 maestro httpd: [Tue Jan 23 19:15:01 2001] [error] =
Failed to to resolve server name for 196.25.213.8 (check DNS) -- or spec
  Jan 23 19:15:02 maestro httpd: httpd startup succeeded


=======_NextPart_000_017C_01C086B1.360C6810
Content-Type: text/html;
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 5.50.4134.600" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>One of the following should resolve the =

problem</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>1. Add maestro to your host =
file</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>2. Use ip-adress instead of hostname in =
the=20
httpd.conf file</FONT></DIV>
<DIV><BR>-- <BR>Med vennlig hilsen <BR>Morten B=F8hmer - <A=20
href=3D"mailto:[EMAIL PROTECTED]">[EMAIL PROTECTED]</A><BR>AdCo Partner=20
AS<BR>Bjellandveien 14 - 3172 VEAR<BR><A=20
href=3D"mailto:[EMAIL PROTECTED]">[EMAIL PROTECTED]</A><BR><A=20
href=3D"http://www.veggers.no">http://www.veggers.no</A></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
  <DIV>"Allan Van Zyl" &lt;<A=20
  href=3D"mailto:[EMAIL PROTECTED]">[EMAIL PROTECTED]</A>&gt; =
wrote in=20
  message <A=20
  =
href=3D"news:94m88c$ffo$[EMAIL PROTECTED]">news:94m88c$ffo$1@ctb-nnrp2=
.saix.net</A>...</DIV>
  <DIV><FONT face=3DArial size=3D2>
  <DIV><FONT face=3DArial size=3D2>In my /etc/boot.log file this error =
comes up on=20
  boot time Does anyone know how to resolve this error or what possibly =
could be=20
  wrong.</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2>Jan 23 19:14:57 maestro nfs: =
rpc.mountd startup=20
  succeeded<BR>Jan 23 19:14:57 maestro nfs: rpc.nfsd startup =
succeeded<BR>Jan 23=20
  19:15:01 maestro httpd: [Tue Jan 23 19:15:01 2001] [error] Cannot =
resolve host=20
  name maestro.infotech-online.co.za --- ignoring!<BR>Jan 23 19:15:01 =
maestro=20
  httpd: [Tue Jan 23 19:15:01 2001] [error] Cannot resolve host name=20
  test.netd.co.za --- ignoring!<BR>Jan 23 19:15:01 maestro httpd: [Tue =
Jan 23=20
  19:15:01 2001] [error] Failed to to resolve server name for =
196.25.213.8=20
  (check DNS) -- or spec</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2>Jan 23 19:15:02 maestro httpd: httpd =
startup=20
  succeeded</FONT></DIV>
  <DIV>&nbsp;</DIV></FONT></DIV></BLOCKQUOTE></BODY></HTML>

=======_NextPart_000_017C_01C086B1.360C6810==


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

From: Happosai <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps
Subject: Help to get microseconds cputime precision
Date: Thu, 25 Jan 2001 10:25:14 +0100


Hello,

Can the precision of the cputime (of the clock or getrusage calls) be
increased to microseconds?

I want to get the cputime (both user and system time) used by a process
in microseconds. I'm using RedHat 6.2 with the 2.2.16-mosix kernel. I
have tried the getrusage and clock functions, but i have a problem:

The getrusage information should be in microseconds but the 4 least
significant numbers (in decimal) are always zero. So the real precision
is 1/100 seconds instead of microseconds!

When i use clock() i have the same problem. The 4 least significant
numbers are always zero.


Can i get microseconds if i modify the "tick" kernel variable (timer
interrupt period)? Should i change something else?

Does exist another way to get microseconds precision?

Thanks in advance.



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

Date: Thu, 25 Jan 2001 05:49:31 -0500
From: jtnews <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.networking
Subject: Having trouble compiling tulip.c in RedHat 7

I'm trying to integrate the latest 
kern_compat.h pci-scan.c, and
tulip.c from ftp://ftp.scyld.com/pub/network
into RedHat 7 Linux kernel
2.2.16-22 and I'm getting the following
errors:

Anyone familiar with the cause of these
link errors?

tulip.o(.text+0x47): undefined reference to
`pci_write_config_dword_Rf0fbd200'
tulip.o(.text+0x72): undefined reference to `printk_R1b7d4074'
tulip.o(.text+0x8b): undefined reference to `init_etherdev_R3808c591'
tulip.o(.text+0x9b): undefined reference to `kmalloc_R93d4cfe6'
tulip.o(.text+0xf8): undefined reference to
`pci_read_config_byte_Re5ceea13'
tulip.o(.text+0x131): undefined reference to `printk_R1b7d4074'
tulip.o(.text+0x19c): undefined reference to `printk_R1b7d4074'
tulip.o(.text+0x42a): undefined reference to `printk_R1b7d4074'
tulip.o(.text+0x4a0): undefined reference to `printk_R1b7d4074'
tulip.o(.text+0x4bb): undefined reference to `printk_R1b7d4074'

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

From: Andi Kleen <[EMAIL PROTECTED]>
Subject: Re: How to use network TP4 protocol on linux
Date: 25 Jan 2001 13:08:30 +0100

"Mohammad Donyaee" <[EMAIL PROTECTED]> writes:

> Hi fellows,
> I want to implement a transport interface for my application (Using TLI) on
> linux RedHat 6.1, to communicate with the other machine( kind of
> Client/Server). The server side is using an OSI stack (TP4 transport layer,
> CLNP network layer, and of course device driver), How can I use the service
> of TP4 and CLNP on my side(client). Is there any module for this transport
> layer and connection less network layer on linux that I have to install? Or
> like TCP/IP it is in kernel? Or there is nothing in this regard for linux?

The only way to do TP4 on Linux AFAIK is to tunnel it over TCP via Isode
in userspace.
Isode is very hard to install though and very big. I don't know if it supports
TLI, probably not.
There is no kernel ISO/OSI stack in Linux.

Overall it is probably a much better idea to switch to TCP.  Linux doesn't 
support TLI directly, but there are emulation libraries that do a well
enough job of emulating it on top of the standard sockets interface.

-Andi


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

From: Andi Kleen <[EMAIL PROTECTED]>
Subject: Re: discarding backing store
Date: 25 Jan 2001 13:12:59 +0100

[EMAIL PROTECTED] writes:

> Is there a way in Linux to discard the backing store (at least for what
> is using swap) for a given range of virtual addresses in the caller's
> process?  In particular what I want to do is cause any dirty pages that
> have not yet been written to backing store to never have to be written.
> But I don't want to unmap the memory; I want its association with a
> given backing object to be retained, but just that it won't be written
> now unless I change it's contents again.


In 2.4 you can do it using madvise(..., MADV_DONTNEED, ...). That will drop
all dirty pages [i've been wanting to hack glibc dlmalloc for some time
now to make it support that for really big free()s, but didn't get around
to do it yet -- it's surely a very nice optimization project if someone is 
motivated.. ;]

In 2.2 there is only munmap, but it'll flush dirty pages, even when the file
has been deleted. Not sure if it does the same to anonymous memory.


-Andi



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

From: [EMAIL PROTECTED]
Subject: Re: Kernel Mods ver 2.2.X ????
Date: Thu, 25 Jan 2001 13:53:15 GMT

In article <[EMAIL PROTECTED]>,
  [EMAIL PROTECTED] (byteme) wrote:
> Does anyone know of a website / book that covers 2.2.x kernel modules,
char devs / block devs
>
>                       kevin

The Linux Kernel Module Programming Guide applies to both kernels 2.0.x
and 2.2.x : http://www.linuxdoc.org/LDP/lkmpg/mpg.html
Sylvie


Sent via Deja.com
http://www.deja.com/

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

From: Kaelin Colclasure <[EMAIL PROTECTED]>
Subject: Re: Name # of Msgs. Latest Post by 01/25/2001 Sending signals to a 
multithSending signals to a multi-threaded app
Date: 25 Jan 2001 07:10:23 -0800

[EMAIL PROTECTED] writes:

[...]
> In order
> to use kill I need to specify the PID of the
> signal handling thread.
> In this case PID 26801.  When my server starts it
> writes the main PID
> to a file.  I would like to use this PID to pass
> SIGTERM, SIGHUP, SIGUSR1,
> etc.  But it looks like I'm going to have to write
> the PID of the signal
> handler instead.  This seems like a kludge to me
> since it is Linux
> specific.  On Solaris and HPUX I can use kill on
> the only PID that
> shows up under 'ps'.

Well, first I agree with you that this is somewhat annoying. But as you
have figured out for yourself, there is a work-around.

> Do I need to do something special.  I guess I
> could have main perform the
> sigwait, but I think my current design is more
> modular.  Any ideas?

Since you say this is a server, why not have it write a pid file to
/var/run/xxx.pid? You can then write the pid of the signal handling
thread, and then your scripts (or what have you) can look there to
see what pid they should direct kills to. This should be nicely
portable -- if you have the handler thread write the file, I believe
getpid() will do ``the right thing'' everywhere.

-- Kaelin

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

From: Kaelin Colclasure <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps
Subject: Re: Help to get microseconds cputime precision
Date: 25 Jan 2001 07:14:23 -0800

Happosai <[EMAIL PROTECTED]> writes:

[...]
> Can i get microseconds if i modify the "tick" kernel variable (timer
> interrupt period)? Should i change something else?

Don't mess with tick -- reading the source comments should explain why.

> Does exist another way to get microseconds precision?

Try readtsc(). There are several threads in this group that explain how
to use it from both kernel and user space.

-- Kaelin

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

From: "Markus Spiritus Familiaris" <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.networking
Subject: Re: Having trouble compiling tulip.c in RedHat 7
Date: Thu, 25 Jan 2001 16:46:24 +0100

just upgrade gcc

[EMAIL PROTECTED]




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

From: [EMAIL PROTECTED] (EOIN RYAN)
Subject: Socketcall
Date: 25 Jan 2001 17:22:04 +0100

Hello,

I'm in the middle of a project which requires two kernel modules to
communicate over the network.  I have found some info in books and on web
and have been reading the linux source.  
Does anyone know of any good material on the net which might be helpfull
(source code, documentation)?

Also, another part of the project requires that the complete context of a
process (MM, regs, stack, heap etc) be sent to a remote computer, with the
goal of migrating the running process.  In order to do this it's necessary
to save them as files, I think (how??).  I know this is a bit vague, but if
anyone can think of any issues or have any tips they'd like to share with me
about the procedure for accomplishing this I'd be delighted to hear them.

Thanks,
Kernel Novice.

E-mail: [EMAIL PROTECTED]

-- 
Posted from mgw1.ul.ie [136.201.1.117] 
via Mailgate.ORG Server - http://www.Mailgate.ORG

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

From: George Houpis <[EMAIL PROTECTED]>
Subject: Re: RAID tools cannot compile under 2.4.0
Date: Thu, 25 Jan 2001 10:28:36 -0600


Thanks Markus, I never really looked in the alpha directory
under ftp://ftp.kernel.org/pub/linux/daemons/raid/alpha
Compiles flawlessly now.

George


Markus Kossmann wrote:

> George Houpis wrote:
> >
> > Running kernel 2.4.0.
> >
> > I cannot get raidtools 0.36 nor 0.50beta working.  It
> > seems that the source is assuming 2.2.x kernels only.
> > Is there a way to get the newest raidtools working
> > for 2.4.x?
> You will need raidtools-0.90 for kernel 2.4
>
> --
> Markus Kossmann
> [EMAIL PROTECTED]


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

From: [EMAIL PROTECTED]
Subject: Flash Device Driver for Linux
Date: Thu, 25 Jan 2001 16:56:15 GMT

Can anyone offer direction on which flash driver to use
for the PowerPC (860/FADS) board? I see there is an "mtd" device
but I really want to start with a generic char driver. This seems
to be a layered pseudo-driver with filesystem support. I really
don't waanna get bogged down in debugging a FS just yet. Thx -Jeff


Sent via Deja.com
http://www.deja.com/

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

From: Wolfram Gloger <[EMAIL PROTECTED]>
Subject: Re: discarding backing store
Date: 25 Jan 2001 18:54:06 +0100

Andi Kleen <[EMAIL PROTECTED]> writes:

> In 2.4 you can do it using madvise(..., MADV_DONTNEED, ...). That will drop
> all dirty pages [i've been wanting to hack glibc dlmalloc for some time
> now to make it support that for really big free()s, but didn't get around
> to do it yet -- it's surely a very nice optimization project if someone is 
> motivated.. ;]

I'm quite motivated :), but `really big' free()s currently in glibc
already cause munmap() to be called on the region (which has been
allocated with anonymous mmap()).

> In 2.2 there is only munmap, but it'll flush dirty pages, even when the file
> has been deleted. Not sure if it does the same to anonymous memory.

Are you suggesting it would be advantageous to call madvise(...,
MADV_DONTNEED, ...) instead of or in addition to munmap() ?  `Instead
of' would unfortunately require larger changes in malloc, because
those regions must be reusable eventually..

Regards,
Wolfram.

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

From: [EMAIL PROTECTED] (Dave Blake)
Crossposted-To: comp.os.linux.development.apps
Subject: Re: Help to get microseconds cputime precision
Date: 25 Jan 2001 14:31:20 GMT
Reply-To: [EMAIL PROTECTED]

Happosai <[EMAIL PROTECTED]> wrote:

> Does exist another way to get microseconds precision?

Try gettimeofday if you are using Intel CPUs. It should be a
nanosecond reading, limited by the latencies of the scheduler. 

-- 
Dave Blake
[EMAIL PROTECTED]

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

From: J.R. Lockwood <[EMAIL PROTECTED]>
Subject: SMP with two different clockspeeds
Date: Thu, 25 Jan 2001 20:30:05 -0000

Hi--

I am currently running kernel 2.4.0 on a home-built system with an Athlon
650 MHz processor.  I recently acquired a 700 MHz Athlon which is currently
collecting dust.  Both are Slot A.  If such a thing exists, I was thinking
of getting a motherboard to support two Slot A processors and building
an SMP kernel.

My naivete my already be evident, but I am confused about the meaning
of "symmetric" in "SMP".  Does it mean that the two processors must have
the same clock speed (ergo, I am S.O.L.) or does it mean that the two
processors are treated as equal (e.g. no sort of master/slave
relationship).  Short version: is it possible for me to use SMP with
two processors of differing clock speeds?

best,
J.R.

--
Posted via CNET Help.com
http://www.help.com/

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

From: Johnny Choque <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps
Subject: Re: Help to get microseconds cputime precision
Date: Thu, 25 Jan 2001 21:28:09 +0100

Happosai wrote:

> Hello,
>
> Can the precision of the cputime (of the clock or getrusage calls) be
> increased to microseconds?
>
> I want to get the cputime (both user and system time) used by a process
> in microseconds. I'm using RedHat 6.2 with the 2.2.16-mosix kernel. I
> have tried the getrusage and clock functions, but i have a problem:
>
> The getrusage information should be in microseconds but the 4 least
> significant numbers (in decimal) are always zero. So the real precision
> is 1/100 seconds instead of microseconds!
>
> When i use clock() i have the same problem. The 4 least significant
> numbers are always zero.
>
> Can i get microseconds if i modify the "tick" kernel variable (timer
> interrupt period)? Should i change something else?
>
> Does exist another way to get microseconds precision?
>
> Thanks in advance.

Hi!

You can usage the struct timeval defined in time.h. For example in kernel
space:

struct timeval *before;
struct timeval *after;

before=kmalloc(sizeof(struct timeval), GFP_KERNEL);
after=kmalloc(sizeof(struct timeval), GFP_KERNEL);

do_gettimeofday(before);
function_test();
do_gettimeofday(after);
printk("function_test duration %lu\n", after->tv_usec-before->tv_usec);

regards,

Johnny



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

From: "Ken Wilson" <[EMAIL PROTECTED]>
Subject: Re: harddisk and partitions
Date: Thu, 25 Jan 2001 13:08:15 -0800


"George MacDonald" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> MESMEUR Philippe wrote:
> >
> > Josef Moellers wrote:
> > >
> >
> > I want to write a C-Program that needs to know all hard-disk on the
> > current system and all partitions in each hard-disk;
> > I can write a function that reads /proc/partitions or maybe, if it
> > exists, I can use a function that does the same.
> >
> > Sorry if it was not clear.
> > thanks to answer me
>
>  fp = popen("cat /proc/partitions", "r" );
>
> Now can you do 3D pie's with wedgies?
>

If I need to find out characteristics of all partitions: active, bootable,
file type,
primary, logical...  Is there any system calls, APIs or ioctl()s available?
How
does cfdisk do it?




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


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

Reply via email to