Linux-Development-Sys Digest #577, Volume #8     Mon, 19 Mar 01 08:13:12 EST

Contents:
  Re: Allocation of task_struct structure (Kasper Dupont)
  rp scripts ("Ideal Education")
  smp issues and mutex on linux kernel 2.4.x ("Ideal Education")
  SegFault ("Unknown")
  Re: SegFault (Kasper Dupont)
  Re: SegFault ("Unknown")
  Re: preloading into ramfs ([EMAIL PROTECTED])
  Re: 4GB memory limit ([EMAIL PROTECTED])
  Re: SegFault (Kasper Dupont)
  Process Scheduler/Resource Management ([EMAIL PROTECTED])
  Re: 4GB memory limit (Alexander Viro)
  Re: help,still confused about the boot of the linux system?? ("hushui")
  Shared library - linux glibc6 2.1.3x, dlclose generate segmentation fault (Tomasz 
Karczewski)

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

From: Kasper Dupont <[EMAIL PROTECTED]>
Subject: Re: Allocation of task_struct structure
Date: Mon, 19 Mar 2001 09:31:43 +0000

Julien Cavoizy wrote:
> 
> Kasper Dupont a �crit :
> >
> > Julien Cavoizy wrote:
> > >
> > > hi,
> > >
> > > I'd like to add some new things in the process task_struct structure but
> > > i cannot find where everything in the task struct are allocated.
> > >
> > > In which .c file it is ?
> > >
> >
> > It is not in a .c file it is in a .h file.
> > linux/include/linux/sched.h
> >
> > Notice that changing this struct will require you
> > to recompile your kernel and lots of modules.
> >
> > The first fields are as stated in a comment hardcoded
> > in assembly code, so insert your own stuff at the end.
> > It would be even better to insert it in some structure
> > reference from the task struct, if there are any
> > resonable choice.
> 
> That's what i have done, but i still wondering how to allocate my own
> structure for each process. If i do it in the do_fork function, would it
> be sufficient?

All processes (except from the iddle process) are created
by calling do_fork(), so that would be sufficient. The
iddle process (Pid 0) only have valid values in a few of
the entries of the task_struct, so don't store information
about the iddle process. (Most likely you don't even have
to think about the iddle process, it will never call any
of your functions.)

> 
> >
> > Notice that each process have 8KB (2 pages) allocated
> > for both this structure and kernel stack, if the
> > structure grows too much you might get stack overflows.
> >
> > > a second question : Which size have a memory page ? (on an i586
> > > processor)
> >
> > 4KB.
> 
> ok
> Thanks very much for your help
> 
> > --
> > Kasper Dupont
> 
> Julien
> [EMAIL PROTECTED]

-- 
Kasper Dupont

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

From: [EMAIL PROTECTED] ("Ideal Education")
Subject: rp scripts
Date: Mon, 19 Mar 2001 10:01:02 +0000 (UTC)

This is a multi-part message in MIME format.

=======_NextPart_000_0005_01C0B089.7201E9B0
Content-Type: text/plain;
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

hi,
    I want to know about what rp scripts are and how it is used and =
information about some materails or books on this topic and how to =
implement it, it required very urgently.

Thanks
Savanth

=======_NextPart_000_0005_01C0B089.7201E9B0
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 content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2920.0" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>hi,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; I want to know about =
what rp=20
scripts are and how it is used and information about some materails or =
books on=20
this topic and how to implement it, it required very =
urgently.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Thanks</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Savanth</FONT></DIV></BODY></HTML>

=======_NextPart_000_0005_01C0B089.7201E9B0==

-- 
Posted from [203.197.150.234] by way of oe76.law14.hotmail.com [64.4.20.211] 
via Mailgate.ORG Server - http://www.Mailgate.ORG

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

From: [EMAIL PROTECTED] ("Ideal Education")
Subject: smp issues and mutex on linux kernel 2.4.x
Date: Mon, 19 Mar 2001 10:04:23 +0000 (UTC)

This is a multi-part message in MIME format.

=======_NextPart_000_0005_01C0B089.E71D2930
Content-Type: text/plain;
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

hi
    give me some information on mutex and smp support w.r.t the linux =
kernel 2.4.x.

Thanks=20
Savanth

=======_NextPart_000_0005_01C0B089.E71D2930
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 content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2920.0" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>hi</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; give me some =
information on=20
mutex and smp support w.r.t the linux kernel 2.4.x.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Thanks </FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Savanth</FONT></DIV></BODY></HTML>

=======_NextPart_000_0005_01C0B089.E71D2930==

-- 
Posted from [203.197.150.234] by way of oe72.law14.hotmail.com [64.4.20.207] 
via Mailgate.ORG Server - http://www.Mailgate.ORG

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

From: "Unknown" <[EMAIL PROTECTED]>
Subject: SegFault
Date: Mon, 19 Mar 2001 10:54:41 GMT

After compiling bladeenc (mp3 encoding), i always got 
Segmentation fault.
It's a debian sid dist, with a DURON on a asus motherboard
it's perhaps a floating point error !
Could anyone help?

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

From: Kasper Dupont <[EMAIL PROTECTED]>
Subject: Re: SegFault
Date: Mon, 19 Mar 2001 11:13:37 +0000

Unknown wrote:
> 
> After compiling bladeenc (mp3 encoding), i always got
> Segmentation fault.
> It's a debian sid dist, with a DURON on a asus motherboard
> it's perhaps a floating point error !
> Could anyone help?

Is it the compiler or the produced executable
that fails? Do you get a core dump?

-- 
Kasper Dupont

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

From: "Unknown" <[EMAIL PROTECTED]>
Subject: Re: SegFault
Date: Mon, 19 Mar 2001 11:21:59 GMT

In article <[EMAIL PROTECTED]>, "Kasper Dupont"
<[EMAIL PROTECTED]> wrote:

> Unknown wrote:
>> 
>> After compiling bladeenc (mp3 encoding), i always got Segmentation
>> fault. It's a debian sid dist, with a DURON on a asus motherboard it's
>> perhaps a floating point error ! Could anyone help?
> 
> Is it the compiler or the produced executable that fails? Do you get a
> core dump?
> 
it's the produced binary that fails, i've tried also with notlame source
and it fails also. no i dont'get any core file generated.
does it came from the hardware ?
the system is ok ( xfree 4.0.2, kernel 2.4.2 etc....)

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

From: [EMAIL PROTECTED]
Subject: Re: preloading into ramfs
Date: Mon, 19 Mar 2001 11:25:01 -0000

On Mon, 19 Mar 2001 09:06:19 +0000 Kasper Dupont <[EMAIL PROTECTED]> wrote:

|> One thought is that some things would just be faster if they are in ram,
|> and this is one sure way to get them in ram.  Given that many systems
|> have a lot of ram these days, loading 8 to 32 meg of stuff into ram
|> wouldn't be all that much of a hit.  It would depend on the judgement of
|> the administrator if they want to take advantage of it, and just how much.
|
| I wouldn't expect much gain, I would expect the frequently used files
| to reside in cache.

How does one go about setting up a means to keep them in ram?  They do get
swapped out a lot.


|> Another thought is a simple layer of security aspect to it.  While it sure
|> won't be resistant to sophisticated attacks, many times the holes the
|> crackers do find somewhere aren't big enough for anything but very trivial
|> initial attacks.
|
| I don't see how this would create any new security holes. Of course you
| must use proper permitions, the image from which you fill the ramfs
| must not be readable or writeable by anybody but root.

Or crackers who gain root.  But that's a more classic security issues.


|> And this could surely help prevent some disasterous accidents where critical
|> system startup files get clobbered.  If the ram preload alone can get the
|> system up, networked, and running sshd, then anything else that can be
|> repaired remotely, or possibly even automatically repaired.
|
| That will surely minimize the risk of disasters. If in addition you
| choose to keep your image on a partition that is usually only mounted
| read only, you will be very good protected. Whether /boot or another
| partition is most appropriate probably is a question about taste.

Or not even mounted, or over the network.


|> What are you thoughts on this?
|> 
|> I was looking at how ramfs was implemented, and am left wondering if there
|> are any issues in doing things like memory mapping files from ramfs.  That
|> could have an impact on library usage if there are issues.  For example,
|> does CoW work right for files memory mapped from ramfs?  What would happen
|> if a CoW was needed for a library mapped from ramfs when swap was full?
|> Would it be a graceful process kill, or would the system seize up?
|
| Since ramfs does not stop you from writing when the system is out of
| memory it can create holes for DoS attacks. Don't let anybody but
| root write to ramfs. Can we expect this to get fixed some day? Ramfs
| was mostly meant to be an example of how to write filesystems. OTOH
| I don't think you would be able to crash the system by executing
| programs from ramfs, anyway it wouldn't be hard to test that in a
| nonproduction environment.

I'm thinking more along the lines of issues like mroe memory being needed
when some process modified a mapped page triggering CoW.  My understanding
of it is that when the modification occurs, the modifying process gets the
page that's in ram, and other processes sharing the data but nor sharing
changes, get "detached" from that copy, and effectively "see" their mapping
as being on backing store.  But what happens when memory mapping from ramfs
(or ramdisk)?  Is the memory mapping letting the process have literal access
(read only) to the ram that ramfs (or ramdisk) occupies?  I would hope so,
or else many advantages disappears.  But CoW would have to work different in
this case.  Instead of giving the modifying process the original page and
detaching other processes, it has to make a new copy for the modifying
process, which would become a swappable copy (right?).  Now what if all
the space is used up, including swap, right then?  Kill process?

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

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

From: [EMAIL PROTECTED]
Subject: Re: 4GB memory limit
Date: Mon, 19 Mar 2001 11:37:41 -0000

On Sun, 18 Mar 2001 01:18:47 GMT Paul Fulghum <[EMAIL PROTECTED]> wrote:

| The same should be true for NT, but NT probably provides an API to
| multiplex chunks of memory into a given address range to provide
| access to more than 4GB (but not all at once).

The IA32 actually has up to 65536 segements of up to 4GB each.  One way
to do virtual memory greater than 4GB is to use the segmentation model
in the virtual memory.  Then the userland process can go beyond 4GB by
just switching segments around using the segment registers.  For a C
program, that could mean a new memory model (something C programs had
to use when coded to work in the old 8086 real mode when they needed
more than 64K).  There could be a "very huge" model which used a 48 or
48 of 64 bit pointer construction to access memory.  Then generated
code would be loading segment registers like mad.  Of course those
memory extending APIs could also be used, and would not have to go
beyond userland when multiple 4GB segments are used, i.e. it would not
be a kernel API.

There are many ways to do >4GB in userland.  All are ugly.

One problem that exists is that Microsoft has effectively encouraged
(maybe intentionally?) commercial software developers to use a lot of
bad program design practices that will make migration to true 64-bit
machines very difficult.

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

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

From: Kasper Dupont <[EMAIL PROTECTED]>
Subject: Re: SegFault
Date: Mon, 19 Mar 2001 11:46:07 +0000

Unknown wrote:
> 
> In article <[EMAIL PROTECTED]>, "Kasper Dupont"
> <[EMAIL PROTECTED]> wrote:
> 
> > Unknown wrote:
> >>
> >> After compiling bladeenc (mp3 encoding), i always got Segmentation
> >> fault. It's a debian sid dist, with a DURON on a asus motherboard it's
> >> perhaps a floating point error ! Could anyone help?
> >
> > Is it the compiler or the produced executable that fails? Do you get a
> > core dump?
> >
> it's the produced binary that fails, i've tried also with notlame source
> and it fails also. no i dont'get any core file generated.
> does it came from the hardware ?
> the system is ok ( xfree 4.0.2, kernel 2.4.2 etc....)

Try looking in /var/log/messages and see if there is
anything unusual at boot time or at the time where you
got the Segmentation fault.

-- 
Kasper Dupont

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

From: [EMAIL PROTECTED]
Subject: Process Scheduler/Resource Management
Date: Mon, 19 Mar 2001 11:29:58 GMT

Hi!

I just wonder if it is possible to limit a process to use
X% of the availabe CPU time. With 'setrlimit' I am able
to set the max. CPU time a process is allowed to use, but
I want to say it relative...

Background: I have many long run processes (like a ftp-server)
and I want to make sure that this NEVER consumes more than
X% of the available CPU time.

Is that really impossible under Linux? Is there a better
schedule-system available for Linux? 

  ++Viage

P.S.: BTW: Can I tell a process to use only CPU no. X and
not one ot the other CPUs?


 



-- 
Sent by tmphop  from hotmail subpart of com
This is a spam protected message. Please answer with reference header.
Posted via http://www.usenet-replayer.com/cgi/content/new

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

From: [EMAIL PROTECTED] (Alexander Viro)
Subject: Re: 4GB memory limit
Date: 19 Mar 2001 07:04:34 -0500

In article <[EMAIL PROTECTED]>,
 <[EMAIL PROTECTED]> wrote:
>The IA32 actually has up to 65536 segements of up to 4GB each.  One way
>to do virtual memory greater than 4GB is to use the segmentation model
>in the virtual memory.  Then the userland process can go beyond 4GB by

Sigh... Segments are mapped into the linear space before anything else
happens. So at any moment all present segments will have no more than
4Gb distinct memory cells.

The only way to get more is to
        * mark only part of segments "present".
        * upon "segment not present" exceptions find unmapped part of
          _linear_ (not physical) space and map it on appropriate
          part of physical memory. Then map the segment to that part
          of linear space and mark it present. This process may require
          unmapping other segments (and marking them not present) _and_
          unmapping PFNs they used to be mapped on.
        * as always, unmapping a PFN means TLB flush.

It will hurt like hell. We also have to deal with fragmentation of
linear space - segments are mapped on ranges and these ranges shouldn't
intersect. Moreover, they can have arbitrary sizes. So finding an
empty part of lineat space may require remapping the stuff. I.e.
moving the contents of page tables. And flushing TLB.

>just switching segments around using the segment registers.  For a C
>program, that could mean a new memory model (something C programs had
>to use when coded to work in the old 8086 real mode when they needed
>more than 64K).  There could be a "very huge" model which used a 48 or
>48 of 64 bit pointer construction to access memory.  Then generated
>code would be loading segment registers like mad.  Of course those

Yeah. And on x86 that's a hell of expensive operation. Any assignment to
segment register involves (at least) reading descriptor from memory and
doing quite a few security checks. Check the cycle count of these operations.

Better yet, if segment doesn't cover the whole linear space, any address
translation with that segment will involve two extra comparisons. I.e.
even aside of the segment switching you will get all instructions that
involve address translation slowed down.

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

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

From: "hushui" <[EMAIL PROTECTED]>
Subject: Re: help,still confused about the boot of the linux system??
Date: Mon, 19 Mar 2001 20:33:06 +0800

thank you very much.
"Josef Moellers" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...

The BIOS will not boot the active partition, but the code in the MBR.
Since LILO handles this differently, you can boot a DOS partition, but
this is not done by "marking it active", but by setting it up as a
bootable item (in /etc/lilo.conf) and selecting it at the lilo prompt.

The "original" boot loader in the MBR will select the "active partition"
and load that partition's Partition Boot Record which will then read in
thyt partition's OS (or OS Loader or whatever).
Installed in the MBR, LILO (its "first stage") will load the "second
stage loader" from the /boot/boot.b file which will load some vmlinuz or
the old MBR code from boot.xxxx, where xxxx is the Linux device number
of the device which originally held the MBR.

--
Josef M�llers (Pinguinpfleger bei FSC)
If failure had no penalty success would not be a prize
-- T.  Pratchett



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

From: Tomasz Karczewski <[EMAIL PROTECTED]>
Subject: Shared library - linux glibc6 2.1.3x, dlclose generate segmentation fault
Date: Mon, 19 Mar 2001 14:09:48 +0100

Hello,

I have a problem with Shared library created by gcc under linux with
glibc6 2.1.3-17.
I load libx.so library using dlopen function and unload using dlclose,
when I call dlclose segmentation fault error is generated.

I have own _ini and _fini functions there, but I termopary remove it
from library, then I have default _ini and _fini, stiil that same :-(

I use there shared memory and pthreads, mutex and conditional wariable
from POSIX.

The most interested is thad the error is generated under glibc6 2.1.13-x
under Debian Potato and RedHat 6.2, but under unstable Debian and RedHat
7.1 beta with glibc6 2.2.1 there is not any problem?

Unfortunately I had use RedHat 6.2 with glibc6 2.1.3-x

Best regards
Tom

--
nick: KaTo
[EMAIL PROTECTED]


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


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