Linux-Development-Sys Digest #784, Volume #8     Wed, 13 Jun 01 06:13:10 EDT

Contents:
  Re: How many CPUs can linux support? (Phil Ehrens)
  Profiler for Pthread apps on Linux (Kamala Prasad Kakulavarapu)
  multiple .c files into a single device drive module? (Jerry Walden)
  Re: multiple .c files into a single device drive module? (Lew Pitcher)
  Re: How many CPUs can linux support? (Ulrich Weigand)
  Shared memory  RDONLY question (Rob Yampolsky)
  Re: Shared memory  RDONLY question ("Urban A. Haas")
  Re: Shared memory RDONLY question (Ulrich Weigand)
  Re: Shared memory RDONLY question (Rob Yampolsky)
  Re: Shared memory  RDONLY question (Rob Yampolsky)
  Re: Shared memory RDONLY question (Ulrich Weigand)
  Re: Stack size of kernel_thread (Ricardo da Silva)
  lilo.conf append syntax ("D. Stimits")
  VFS and mount (Petric Frank)
  How to create an experimental driver in the Kernel Tree (Jerry Walden)
  Re: VFS and mount (Alexander Viro)
  Re: lilo.conf append syntax ("Norm Dresner")
  Re: VFS and mount (Petric Frank)
  Re: VFS and mount (Alexander Viro)
  Re: VFS and mount (Petric Frank)

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

From: [EMAIL PROTECTED] (Phil Ehrens)
Subject: Re: How many CPUs can linux support?
Date: 12 Jun 2001 16:11:56 GMT
Reply-To: -@-

Anthony DeRobertis wrote:
> In article <[EMAIL PROTECTED]>, "Ted Specht"
><[EMAIL PROTECTED]> wrote:
> 
>> I am writing an application that performs parallel processing and I
>> would like to know if Linux supports multiple CPUs per server
> 
> Yes. I run dual-CPU systems routinely. E.g., IBM will be happy to sell you
> many-CPU systems.

We run a few 4 cpu boxes and have found problems with threads and
exceptions from c++ code (some of the c++ core is NOT thread safe),
but in general, if you configure your kernel carefully for your
system (make sure you don't enable all sorts of chipset compatibility
that does not apply to your system) you can do quite well.

The 2.2.X series kernels had some strange problems with processes
hopping about among cpu's which was not nice.

IBM, as the man says, will sell you an 8-way linux box ;^)

Phil

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

From: Kamala Prasad Kakulavarapu <[EMAIL PROTECTED]>
Crossposted-To: comp.programming.threads,comp.os.linux.development.apps
Subject: Profiler for Pthread apps on Linux
Date: Tue, 12 Jun 2001 13:15:23 -0400


Hello,

Does gprof (available with RH7.1) have multithreading support? When I
profile a non-threaded app with gprof, it shows non-zero time in the flat
profile, but the threaded version shows zeros in the time columns in the
flat profile.

I read on Corel and IBM webpage that cprof has multithreading support, but
Corel's download  URL seems to be down.

Question: What profiler can we use to profile Pthreads apps on Linux?

Appreciate any help.

Thanks,
Prasad


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

From: [EMAIL PROTECTED] (Jerry Walden)
Subject: multiple .c files into a single device drive module?
Date: 12 Jun 2001 12:19:58 -0700

Greetings:

I have am porting a device driver from a "generic source library". 
The current tree consists of several .c source files.  Is there
another way to create a single .o file from several source files short
of having a single .c file #include the rest?

Thanks for any hel.

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

From: [EMAIL PROTECTED] (Lew Pitcher)
Subject: Re: multiple .c files into a single device drive module?
Reply-To: [EMAIL PROTECTED]
Date: Tue, 12 Jun 2001 19:25:18 GMT

On 12 Jun 2001 12:19:58 -0700, [EMAIL PROTECTED] (Jerry Walden)
wrote:

>Greetings:
>
>I have am porting a device driver from a "generic source library". 
>The current tree consists of several .c source files.  Is there
>another way to create a single .o file from several source files short
>of having a single .c file #include the rest?

Yes. You link them together; that's what ld does for a living.
'man 1 ld' will tell you all about it.

>Thanks for any hel.

I haven't given you hel yet <g>, but your welcome for the help.



Lew Pitcher, Information Technology Consultant, Toronto Dominion Bank Financial Group
([EMAIL PROTECTED])

(Opinions expressed are my own, not my employer's.)

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

From: [EMAIL PROTECTED] (Ulrich Weigand)
Subject: Re: How many CPUs can linux support?
Date: 12 Jun 2001 21:28:47 +0200

[EMAIL PROTECTED] (Phil Ehrens) writes:

>IBM, as the man says, will sell you an 8-way linux box ;^)

Well, on an IBM eServer zSeries z900, Linux will run just 
fine on all 16 processors ...  If you run z/VM, you can even
define up to 64 virtual processors, and Linux for zSeries 
will run 64-way ;-)

-- 
  Dr. Ulrich Weigand
  [EMAIL PROTECTED]

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

From: Rob Yampolsky <[EMAIL PROTECTED]>
Crossposted-To: comp.unix.aix,comp.unix.programmer
Subject: Shared memory  RDONLY question
Date: Tue, 12 Jun 2001 16:26:49 -0400

I have a set of apps that all share a single memory segment.  Most of 
the time, they only need to read from the shared memory, but 
occasionally they also need to update it.

Currently, I attach the shared memory at startup in read/write mode, but 
I'd like to protect myself from accidentally trashing it.

So...

1. Is it possible to attach a shared memory segment with SHM_RDONLY and 
then flip temporarily into read/write mode and back.  I had thought you 
could do this with shmctl(), but looking closer, it seems like the 
permissions there have to do with 'permission to attach' as opposed to 
the current read/write permission.

2. If not, would it be much of a performance hit to detach and reattach 
whenever I want to write to the shared memory?  And then detach and 
re-attach again to get it back into rdonly mode?

3. Any other ways to do this?  I suppose I could use semaphores for the 
few items that most apps need to update.  Then, at least, I wouldn't 
have to worry about stray pointers trashing the global stuff.

Thanks,
Rob Yampolsky
[EMAIL PROTECTED]


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

From: "Urban A. Haas" <[EMAIL PROTECTED]>
Crossposted-To: comp.unix.aix,comp.unix.programmer
Subject: Re: Shared memory  RDONLY question
Date: Tue, 12 Jun 2001 15:52:08 -0500

"Rob Yampolsky" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> I have a set of apps that all share a single memory segment.  Most of
> the time, they only need to read from the shared memory, but
> occasionally they also need to update it.
>
> Currently, I attach the shared memory at startup in read/write mode, but
> I'd like to protect myself from accidentally trashing it.
>
> So...
>
> 1. Is it possible to attach a shared memory segment with SHM_RDONLY and
> then flip temporarily into read/write mode and back.  I had thought you
> could do this with shmctl(), but looking closer, it seems like the
> permissions there have to do with 'permission to attach' as opposed to
> the current read/write permission.
>
> 2. If not, would it be much of a performance hit to detach and reattach
> whenever I want to write to the shared memory?  And then detach and
> re-attach again to get it back into rdonly mode?
>
> 3. Any other ways to do this?  I suppose I could use semaphores for the
> few items that most apps need to update.  Then, at least, I wouldn't
> have to worry about stray pointers trashing the global stuff.
>

Usually, this involves locking code with something that is known as critical
sections. I suggest you pick up a good book on Multiprocessor programming. I
had communication code I wrote several years ago that did this, but only God
knows where it is now. I haven't done that in years. Maybe Gary could point
you in the right direction.

> Thanks,
> Rob Yampolsky
> [EMAIL PROTECTED]
>



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

From: [EMAIL PROTECTED] (Ulrich Weigand)
Crossposted-To: comp.unix.aix,comp.unix.programmer
Subject: Re: Shared memory RDONLY question
Date: 12 Jun 2001 23:07:23 +0200

Rob Yampolsky <[EMAIL PROTECTED]> writes:

>1. Is it possible to attach a shared memory segment with SHM_RDONLY and 
>then flip temporarily into read/write mode and back.  I had thought you 
>could do this with shmctl(), but looking closer, it seems like the 
>permissions there have to do with 'permission to attach' as opposed to 
>the current read/write permission.

mprotect() should work just as well on shared memory ...

-- 
  Dr. Ulrich Weigand
  [EMAIL PROTECTED]

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

From: Rob Yampolsky <[EMAIL PROTECTED]>
Crossposted-To: comp.unix.aix,comp.unix.programmer
Subject: Re: Shared memory RDONLY question
Date: Tue, 12 Jun 2001 18:25:07 -0400

Ulrich Weigand wrote:

> Rob Yampolsky <[EMAIL PROTECTED]> writes:
> 
> 
>>1. Is it possible to attach a shared memory segment with SHM_RDONLY and 
>>then flip temporarily into read/write mode and back.  I had thought you 
>>could do this with shmctl(), but looking closer, it seems like the 
>>permissions there have to do with 'permission to attach' as opposed to 
>>the current read/write permission.
>>
> 
> mprotect() should work just as well on shared memory ...
> 
> 

Yep.  I found mprotect() after I posted my question.  But do you have to 
use mmap() in order to use mprotect()?  I'm using shmget(), shmat(). 
And I'm using a well-known integer as my IPC key.  To switch to mmap() 
would require some restructuring.


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

From: Rob Yampolsky <[EMAIL PROTECTED]>
Crossposted-To: comp.unix.aix,comp.unix.programmer
Subject: Re: Shared memory  RDONLY question
Date: Tue, 12 Jun 2001 18:28:56 -0400

Urban A. Haas wrote:

> Usually, this involves locking code with something that is known as critical
> sections. I suggest you pick up a good book on Multiprocessor programming. I
> had communication code I wrote several years ago that did this, but only God
> knows where it is now. I haven't done that in years. Maybe Gary could point
> you in the right direction.
> 


Ummm.  I'm not talking about preventing simultaneous updates to a 
section of shared memory (I'm already locking against that).  What I'm 
worried about is a stray pointer trashing parts of the shared memory 
that I'm not intending to look at.  This kind of thing gets very hard to 
debug when the culprit could be any one of, say, 50 applications that 
have this thing mapped.

That leads me to another question, though.  Is it a bad idea to 
routinely map a large shared memory segment into a large (~50) set of 
processes?  Any performance hits, or are these references fairly cheap?



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

From: [EMAIL PROTECTED] (Ulrich Weigand)
Crossposted-To: comp.unix.aix,comp.unix.programmer
Subject: Re: Shared memory RDONLY question
Date: 13 Jun 2001 00:44:24 +0200

Rob Yampolsky <[EMAIL PROTECTED]> writes:

>Ulrich Weigand wrote:

>> Rob Yampolsky <[EMAIL PROTECTED]> writes:
>> 
>> 
>>>1. Is it possible to attach a shared memory segment with SHM_RDONLY and 
>>>then flip temporarily into read/write mode and back.  I had thought you 
>>>could do this with shmctl(), but looking closer, it seems like the 
>>>permissions there have to do with 'permission to attach' as opposed to 
>>>the current read/write permission.
>>>
>> 
>> mprotect() should work just as well on shared memory ...
>> 
>> 

>Yep.  I found mprotect() after I posted my question.  But do you have to 
>use mmap() in order to use mprotect()?  I'm using shmget(), shmat(). 
>And I'm using a well-known integer as my IPC key.  To switch to mmap() 
>would require some restructuring.

No, you should be able to use mprotect() on any part of the address
space, no matter what's mapped there.

-- 
  Dr. Ulrich Weigand
  [EMAIL PROTECTED]

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

From: Ricardo da Silva <[EMAIL PROTECTED]>
Subject: Re: Stack size of kernel_thread
Date: Tue, 12 Jun 2001 15:42:48 -0700

Hanspeter Halle wrote:
> 
> Hi,
> does anybody know how to increase the memory avaliable for the stack of a
> kernel_thread (kerbnel 2.2 and 2.4)?
> 
> Thanks, Hanspeter

you can use ulimit or limit (depend of the shell you're using) to set
this.

limit stacksize unlimited

you can use also

setenv MPSTKZ 8M
export MPSTKZ=8M

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

Date: Tue, 12 Jun 2001 17:48:55 -0600
From: "D. Stimits" <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
Subject: lilo.conf append syntax

I'm trying to figure out the correct means to append two things to the
kernel boot parameters. For a while I have been using:
append="noapic"

(due to i840 chipset design flaws of APIC)

Now I'm converting some items (XFS filesystem) over to use as module, in
order to make a bootable floppy (it is too large without making it a
module), and I need to bring up the default ramdisk size, so I am using
this:
  append="ramdisk_size=25000 noapic"

Is the space between "ramdisk_size=25000" and "noapic" the correct
syntax (this works without error running lilo, but fails when it comes
time to use the module)? I have seen commas, but these were always used
for multiple arguments to a single parameter, not multiple parameters. I
need to verify that I can enter two kernel boot options in the way I
have, or else find the correct syntax.

D. Stimits, [EMAIL PROTECTED]

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

From: Petric Frank <[EMAIL PROTECTED]>
Subject: VFS and mount
Date: Wed, 13 Jun 2001 01:58:39 +0200

Hello,

i am writing a filesystem driver (vfs).
I am getting it working with hardcoded values.

i can do a
  mount -t <filesystem type> anything <mountpoint>

The problem i have actually is where this <anything> is going to.
Or, in other words, where i can get the value of <anything> in my
driver.

regards
  Petric Frank

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

From: [EMAIL PROTECTED] (Jerry Walden)
Subject: How to create an experimental driver in the Kernel Tree
Date: 12 Jun 2001 17:29:52 -0700

Greetings:

I am writing a device driver, and I believe it falls under the area of
/driver/net.

I would like to create a sub-directory under /driver/net as
/drivers/net/mydriver and place a few c and h files there.

I am building this driver along with a specific kernel distro, so I
have in place the entire kernel source tree.

I can't figure out how or where to add dependencies, what files to add
them to to build my experimental driver.

Kindest Regards

Jerry

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

From: [EMAIL PROTECTED] (Alexander Viro)
Subject: Re: VFS and mount
Date: 12 Jun 2001 20:39:07 -0400

In article <[EMAIL PROTECTED]>, Petric Frank  <[EMAIL PROTECTED]> wrote:
>Hello,
>
>i am writing a filesystem driver (vfs).

as in "not on a block device"?

>I am getting it working with hardcoded values.
>
>i can do a
>  mount -t <filesystem type> anything <mountpoint>
>
>The problem i have actually is where this <anything> is going to.

Currently - nowhere. IOW, you can't use it. It will change in 2.5.early,
but that requires API change.

Advice: for the time being use -o something=<anything>. _That_ will be
passed to ->read_super() (in "data" argument).

Currently you can (after read_super() is done) try to find that <anything>,
but that's pretty much an accident and it's very likely to be gone by the
time when 2.4.6-final will be released.  Again, the right way to do it
is to wait for 2.5 and use -o until then.



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

From: "Norm Dresner" <[EMAIL PROTECTED]>
Subject: Re: lilo.conf append syntax
Date: Wed, 13 Jun 2001 01:45:08 GMT

D. Stimits <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> I'm trying to figure out the correct means to append two things to the
> kernel boot parameters. For a while I have been using:
> append="noapic"
>
> (due to i840 chipset design flaws of APIC)
>
> Now I'm converting some items (XFS filesystem) over to use as module, in
> order to make a bootable floppy (it is too large without making it a
> module), and I need to bring up the default ramdisk size, so I am using
> this:
>   append="ramdisk_size=25000 noapic"
>
> Is the space between "ramdisk_size=25000" and "noapic" the correct
> syntax (this works without error running lilo, but fails when it comes
> time to use the module)? I have seen commas, but these were always used
> for multiple arguments to a single parameter, not multiple parameters. I
> need to verify that I can enter two kernel boot options in the way I
> have, or else find the correct syntax.
>
> D. Stimits, [EMAIL PROTECTED]

Here's what works for me:

         append="mem=122m  shm=0x3FFC00"


In this line, the kernel uses the mem=xxx info and the shm=xxx info is used
by my own driver (actually the script file that loads it).

    Norm




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

From: Petric Frank <[EMAIL PROTECTED]>
Subject: Re: VFS and mount
Date: Wed, 13 Jun 2001 09:30:30 +0200

Hello Alexander,

Alexander Viro wrote:
> 
> In article <[EMAIL PROTECTED]>, Petric Frank  <[EMAIL PROTECTED]> wrote:
> >Hello,
> >
> >i am writing a filesystem driver (vfs).
> 
> as in "not on a block device"?
> 
> >I am getting it working with hardcoded values.
> >
> >i can do a
> >  mount -t <filesystem type> anything <mountpoint>
> >
> >The problem i have actually is where this <anything> is going to.
> 
> Currently - nowhere. IOW, you can't use it. It will change in 2.5.early,
> but that requires API change.
> 
> Advice: for the time being use -o something=<anything>. _That_ will be
> passed to ->read_super() (in "data" argument).
> 
> Currently you can (after read_super() is done) try to find that <anything>,
> but that's pretty much an accident and it's very likely to be gone by the
> time when 2.4.6-final will be released.  Again, the right way to do it
> is to wait for 2.5 and use -o until then.

But how is Samba doing it ?
As i digged out recently you can do a
  mount -t smbfs //MACHINE/SHARE <mount point>

(ok, i should ask this a samba newsgroup)

regards
  Petric

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

From: [EMAIL PROTECTED] (Alexander Viro)
Subject: Re: VFS and mount
Date: 13 Jun 2001 04:26:58 -0400

In article <[EMAIL PROTECTED]>,
Petric Frank  <[EMAIL PROTECTED]> wrote:

>But how is Samba doing it ?
>As i digged out recently you can do a
>  mount -t smbfs //MACHINE/SHARE <mount point>

Do strace on it. You'll see that it's special-cased in mount - it
calls a separate helper (mount.smb) which passes it in the same
way normal mount would pass -o <options>.

Sure, you can modify /bin/mount so that it would recognize your
syntax as a special case (or call a separate program that would
do the same). But that has nothing to kernel...

-- 
"You're one of those condescending Unix computer users!"
"Here's a nickel, kid.  Get yourself a better computer" - Dilbert.

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

From: Petric Frank <[EMAIL PROTECTED]>
Subject: Re: VFS and mount
Date: Wed, 13 Jun 2001 11:34:59 +0200

Hello Alexander,

Alexander Viro wrote:
> 
> In article <[EMAIL PROTECTED]>,
> Petric Frank  <[EMAIL PROTECTED]> wrote:
> 
> >But how is Samba doing it ?
> >As i digged out recently you can do a
> >  mount -t smbfs //MACHINE/SHARE <mount point>
> 
> Do strace on it. You'll see that it's special-cased in mount - it
> calls a separate helper (mount.smb) which passes it in the same
> way normal mount would pass -o <options>.

Thanks.
I'll have a look to the mount source. I've seen a file named mount.smbfs
which does the mount for samba.
Maybe there is a generic rule in mount to call mount.<filesystem> if
available ...

regards
  Petric

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


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