Linux-Development-Sys Digest #443, Volume #8     Fri, 26 Jan 01 01:13:15 EST

Contents:
  Re: discarding backing store ([EMAIL PROTECTED])
  Re: Having trouble compiling tulip.c in RedHat 7 (jtnews)
  Re: SMP with two different clockspeeds (Ian D Romanick)
  Device Driver Development Help ([EMAIL PROTECTED])
  Re: double mmap calls (bill davidsen)
  cfdisk ("Ken Wilson")
  MIPS/Linux Evaluation Boards ("Kris Rahardja")
  Re: discarding backing store (Andi Kleen)
  Re: Having trouble compiling tulip.c in RedHat 7 (Jay Miller)
  Re: double mmap calls ([EMAIL PROTECTED])
  Re: cfdisk (John E Garrott Sr)
  Re: harddisk and partitions ([EMAIL PROTECTED])
  Re: cfdisk ([EMAIL PROTECTED])
  Re: cfdisk (John E Garrott Sr)
  Re: cfdisk ([EMAIL PROTECTED])

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

From: [EMAIL PROTECTED]
Subject: Re: discarding backing store
Date: Thu, 25 Jan 2001 21:14:37 -0000

On 25 Jan 2001 13:12:59 +0100 Andi Kleen <[EMAIL PROTECTED]> wrote:
| [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.. ;]

Peeking into the kernel source (because no man page) I see:

asmlinkage long sys_madvise(unsigned long start, size_t len, int behavior)

so I assume you meant madvise(..., ..., MADV_DONTNEED )


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

Obviously not what I want in this case.  I'm doing a circular buffer
using mapping tricks (shmget/shmat mostly, mmap some) to get 2 "views"
of the same space in adjacent addresses.  But sometimes the buffer
will have little or no data in places.  It could be dirty and would
potentially be written to backing store (swap or tmp file) after the
data is no longer needed.  My thought was once a page size chunk of
the buffer is emptied out, to do this call to prevent any such writing
to backing store.  Whether it clears it to zero or not won't have any
impact, though not clearing it would be faster.

Since this is not a portable call, I guess I can code it like:

#ifndef DONT_MADVISE_MADV_DONTNEED
#ifdef MADV_DONTNEED
    madvise( chunk_ptr, chunk_len, MADV_DONTNEED );
#endif
#endif

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

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

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

Markus Spiritus Familiaris wrote:
> 
> just upgrade gcc
> 
> [EMAIL PROTECTED]

I already upgraded to gcc 2.95.2
is that the right one?
I just created a link kgcc to point
to gcc 2.95.2.

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

From: [EMAIL PROTECTED] (Ian D Romanick)
Subject: Re: SMP with two different clockspeeds
Date: 25 Jan 2001 14:30:45 -0800

J.R. Lockwood <[EMAIL PROTECTED]> writes:

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

Technically speaking, yes.  Old Sequent (now IBM) Symmetry machines could
mix CPU speed and could even mix 486 and Pentium CPUs.  The newer Sequent
(IBM) NUMA systems can mix PentiumPro 180 and whatever the current Pentium
III Xeon CPUs are.  However, this is very special, very expensive hardware.

For PC type setups, the answer is no.  In fact, there are no boards AT ALL
that support the Athlon in an SMP environment.  When the are (finally)
released, the will almost certainly be SocketA ONLY.  You're best bet is to
put the 700 in your system, sell the 650 on eBay, and wait for the SMP
boards to arrive.
-- 
"You must understand...that there are two ways of fighting: by
 law or by force.  The first way is natural to man, and the 
 second to beasts.  But as the first way often proves inadequate
 one must have recourse in the second."  -- Machiavelli, The Prince

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

From: [EMAIL PROTECTED]
Subject: Device Driver Development Help
Date: Thu, 25 Jan 2001 22:30:37 GMT



Hi:

I developed a device driver for a Unix platform. I am interested
in porting this driver to a Red Hat Linux platform.

What guides and reference manuals and source code examples are
available for such a task?

Thanks in advance for any info,

Patrick


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

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

From: [EMAIL PROTECTED] (bill davidsen)
Subject: Re: double mmap calls
Date: 26 Jan 2001 00:24:37 GMT

In article <[EMAIL PROTECTED]>,
 <[EMAIL PROTECTED]> wrote:
| On 23 Jan 2001 13:29:24 -0800 Linus Torvalds <[EMAIL PROTECTED]> wrote:

| I've decided to code up using the following approach:
| 
| 1.  addr=mmap(,size*2,,MAP_ANONYMOUS,,) to find address space big enough
| 2.  munmap() and hope no same process threads take memory here
| 3.  shmget(IPC_PRIVATE,size,0) this should get swap backing store
| 4.  shmat(id,addr,0); shmat(id,addr+size,0)
| 
| I haven't tested it yet, since there are other parts of tha project yet
| to be coded to make it workable.  The project is a pseudo-circular buffer
| library which allows the caller to get a peek address into the buffer to
| see if there is enough data available to do something with it (a line
| of text, for example).  I've previously done this without the memory
| tricks, and the interface has always been awkward due to the need to
| view data as one piece which is otherwise wrapped around.

  Lack of sleep has caught up to me. I've done some number of circular
buffer implementations in shared memory, back to a Z80 and 8088 sharing
memory between two procvessors in the old DEC "Rainbow" system. I don't
see why you need more than one mapping, or why if you use two they must
adjoin. After reading your posts, I still can't decide if you're doing
something subtle or trying to save some programming effort with a
memory mapping which I am not sure will work on other than Linux and
depends on your point two. I assume subtlety ;-)

| <OT>
| 
| BTW, I love ramfs.  It's made it easy to have a larger bunch of files
| in a CD booted, no HD, system.  And pivot_root() was a big plus there,
| letting me have / on the ramfs.  I've got a two stage program which
| runs as init that sets it all up and loads a tarball from the CDROM
| and finally runs the real init.  It's part of a package that includes
| a bootable ISO construction kit script.  The first alpha is here:
| http://phil.ipal.org/freeware/bick/bick-0.4.0-alpha.tar.bz2  (11.2m)
| and rescue CDs built with it are in the same directory.
| 
| </OT>

  Gotta try this, I want one for reinstall backups of a bunch of little
machines.!

-- 
  bill davidsen <[EMAIL PROTECTED]>  CTO, TMR Associates, Inc
"I am lost. I am out looking for myself. If I should come back before I
return, please ask me to wait."  -seen in a doctor's office

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

From: "Ken Wilson" <[EMAIL PROTECTED]>
Subject: cfdisk
Date: Thu, 25 Jan 2001 16:44:23 -0800


Is its source code available?

-Ken



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

From: "Kris Rahardja" <[EMAIL PROTECTED]>
Subject: MIPS/Linux Evaluation Boards
Date: Thu, 25 Jan 2001 16:50:48 -0800

Hi all,

I'm currently looking for an development platform /
evaluation boards to do some prototyping on MIPS/Linux.
After some digging, the candidates are the Algorithmics
(www.algor.co.uk) and V3 (www.vcubed.com). Any take
on which is a better alternative? From other company(ies)?
My constraints are dev tools and the version of Linux that
works on it (i.e. require little or no work from any of the
public distributions).

Thanks beforehand,
Kris




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

From: Andi Kleen <[EMAIL PROTECTED]>
Subject: Re: discarding backing store
Date: 26 Jan 2001 02:07:20 +0100

Wolfram Gloger <[EMAIL PROTECTED]> writes:

> 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()).

madvise is somewhat cheaper than munmap, but I don't know if the difference
is benchmarkable.

My impression was that glibc uses mmap/munmap only for very big allocations
(>128MB)
madvise could be already a win for 4-8K continuous frees to save swap space.

AFAIK the new FreeBSD malloc uses it successfully this way. 

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


Just that free should call madvise when it manages to free at least a full
page (or maybe two+ pages -- MADV_DONTNEED flushes caches which can be 
sometimes costly -- it needs benchmarking) 

I could imagine that e.g. Netscape would benefit from that. Most of its 
bitmaps are probably <MMAP_THRESHOLD, but all of them just shouldn't tie up
swap space when they're already freed.



-Andi


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

From: [EMAIL PROTECTED] (Jay Miller)
Crossposted-To: comp.os.linux.networking
Subject: Re: Having trouble compiling tulip.c in RedHat 7
Date: Fri, 26 Jan 2001 01:30:04 GMT

On Thu, 25 Jan 2001 05:49:31 -0500, jtnews <[EMAIL PROTECTED]>
wrote:

>tulip.o(.text+0x72): undefined reference to `printk_R1b7d4074'

I'm not really the best person to respond to this, but I *think*
(someone please correct me!) that mangling at the end of the function
is usually a versioning issue to make sure functions are
intercompatible.. (or something..)  Um - does that give you any ideas?
<grin>

Before you think about that, though, here's a couple other things to
mull over:

- on a stock RH 7 install, 'kgcc' is the old egcs compiler, or gcc
2.91.66.  'gcc' is the unstable 2.96 snapshot.  Are you sure you have
the compilation process directed to use kgcc and not gcc?  And why do
you have a link to 2.95?

- the glibc that ships with RH 7 is also no good - you might try
either upgrading to 2.2 (stable) or downgrading to 2.1.3 (the official
choice, I think, although I doubt this is causing your problem..)

Sorry I'm not able to offer more help!

--
Jay Miller

ICQ: 32123421 | YM: ladenedge | http://www.cryptofreak.org
PGP: 0xedc9bb8c | 41a6428c 46abd36b 6b259b68 8a28ca4c edc9bb8c

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

From: [EMAIL PROTECTED]
Subject: Re: double mmap calls
Date: Fri, 26 Jan 2001 02:13:37 -0000

On 26 Jan 2001 00:24:37 GMT bill davidsen <[EMAIL PROTECTED]> wrote:

|   Lack of sleep has caught up to me. I've done some number of circular
| buffer implementations in shared memory, back to a Z80 and 8088 sharing
| memory between two procvessors in the old DEC "Rainbow" system. I don't
| see why you need more than one mapping, or why if you use two they must
| adjoin. After reading your posts, I still can't decide if you're doing
| something subtle or trying to save some programming effort with a
| memory mapping which I am not sure will work on other than Linux and
| depends on your point two. I assume subtlety ;-)

I need to be able to access data segments up to as much as all the
data that is present in the buffer as a linear (e.g. contiguous in
the proper order) block.  The purposes for this including being
able to peek ahead at the buffered data for sentinels that indicate
the data is complete enough to take out of the buffer and fully
act on it (e.g. strchr() finds a newline when I'm looking for a
complete line) ... and being able to call sendto() data knowing that
it is being sent as a whole datagram.  There are various other reasons.

I have done circular buffers other ways.  I've done them more than once
where they just wrap around from back to front.  I've also done them
where they keep reshifting so the beginning of the data content is at
the beginning of the space.  I also did one with variable sized chunks
in a circularly linked list.  What I'm trying to do is get the benefits
in not only a single implementation, but also in each instance.

It seems to be working.  Code will be released soon.  I am doing it as
a library so all the "mess" will be encapsulated, leaving one with an
API that allows things like peeking ahead.

And no, I didn't think of it.  Someone on comp.unix.programmer suggested
it to me a couple years ago, and I just now got around to doing it.  I
wish I could recall who that was.



| | <OT>
| | 
| | BTW, I love ramfs.  It's made it easy to have a larger bunch of files
| | in a CD booted, no HD, system.  And pivot_root() was a big plus there,
| | letting me have / on the ramfs.  I've got a two stage program which
| | runs as init that sets it all up and loads a tarball from the CDROM
| | and finally runs the real init.  It's part of a package that includes
| | a bootable ISO construction kit script.  The first alpha is here:
| | http://phil.ipal.org/freeware/bick/bick-0.4.0-alpha.tar.bz2  (11.2m)
| | and rescue CDs built with it are in the same directory.
| | 
| | </OT>
|
|   Gotta try this, I want one for reinstall backups of a bunch of little
| machines.!

Well, go download it :-)

Sorry, no documentation on it, yet.  I'm still working on getting it to
do both Intel and Sparc in the same CD (should work since each platform
boots in a different way, and from there I can symlink different parts
of the ISO filesystem).

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

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

From: John E Garrott Sr <[EMAIL PROTECTED]>
Subject: Re: cfdisk
Date: Thu, 25 Jan 2001 19:17:05 -0800

Ken Wilson wrote:
> 
> Is its source code available?
> 
> -Ken

ftp://ftp.linux.com/mounts/u2/mirrors/metalab/Linux/system/install/

Have fun,

John

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

From: [EMAIL PROTECTED]
Subject: Re: harddisk and partitions
Date: Fri, 26 Jan 2001 03:32:53 -0000

On Thu, 25 Jan 2001 13:08:15 -0800 Ken Wilson <[EMAIL PROTECTED]> wrote:

| "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?

It reads the device directly.  Start with the MBR, then based on what
is in there, you mean need to read other blocks, including interpreting
them in different ways (e.g. BSD partitions should have a disklabel).

If you need to find out what the kernel's take on the partitions is,
then hopefully some ioctl() exists for your needs, or /proc/partitions
as what you need to know.

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

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

From: [EMAIL PROTECTED]
Subject: Re: cfdisk
Date: Fri, 26 Jan 2001 03:41:42 -0000

On Thu, 25 Jan 2001 16:44:23 -0800 Ken Wilson <[EMAIL PROTECTED]> wrote:

| Is its source code available?

ftp://ibiblio.org/pub/Linux/system/install/cfdisk-0.8g.tar.gz

drwxr-xr-x aeb/other         0 1997-04-29 14:54 ./cfdisk-0.8g/
-rw-r--r-- aeb/other     15532 1997-04-27 05:02 ./cfdisk-0.8g/cfdisk.8
-rw-r--r-- aeb/other     64145 1997-04-29 14:53 ./cfdisk-0.8g/cfdisk.c
-rw-r--r-- aeb/other       196 1997-04-27 05:44 ./cfdisk-0.8g/Makefile
-rw-r--r-- aeb/other      2123 1997-04-27 05:05 ./cfdisk-0.8g/llseek.c
-rw-r--r-- aeb/other       375 1997-04-29 14:08 ./cfdisk-0.8g/cfdisk-0.8g.lsm

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

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

From: John E Garrott Sr <[EMAIL PROTECTED]>
Subject: Re: cfdisk
Date: Thu, 25 Jan 2001 20:02:26 -0800

Ken Wilson wrote:
> 
> Is its source code available?
> 
> -Ken

Oops to my earlier reply.

It's part of util-linux,
http://www.kernel.org/pub/linux/utils/util-linux/

The one on Metalabs (Ibiblio) is very old.

John

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

From: [EMAIL PROTECTED]
Subject: Re: cfdisk
Date: Fri, 26 Jan 2001 05:46:17 -0000

On Thu, 25 Jan 2001 20:02:26 -0800 John E Garrott Sr <[EMAIL PROTECTED]> wrote:

| It's part of util-linux,
| http://www.kernel.org/pub/linux/utils/util-linux/

They need to index that stuff.  One of the perpetual problems with
Linux and GNU is know which tarball to download for a given file
that would be it's result (usually some executeable).  There needs
to be a clear and obvious mapping between some path on any system
and the original (not some distributions repackage) source that
it comes from.

| The one on Metalabs (Ibiblio) is very old.

Grepping the file listing comes up with that one.  Grepping it
would be the first thing to try.  Voila, there it is.  So people
won't know to look elsewhere in an unobvious place and thus they
will miss:

ftp://ibiblio.org/pub/Linux/system/misc/util-linux-2.10r.tar.gz

and

ftp://ibiblio.org/pub/Linux/kernel.org/pub/linux/utils/util-linux/util-linux-2.10r.tar.gz

If someone can supply a list of "for this file, it is found in this
package", I'd be happy to put it online as a search tool.  Of course
the list has to be complete with updates rolling in.

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

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


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