Linux-Development-Sys Digest #374, Volume #8     Mon, 25 Dec 00 07:13:07 EST

Contents:
  Re: A faster memcpy and bzero for x86 (Robert Redelmeier)
  Re: Libraries (Roland Smith)
  DNS Serving (Joseph Virzi)
  Re: DNS Serving ("Michael Faurot")
  how to write a program to download a file via HTTP with password protected?(NULL 
inside) ("Edward")
  RAD for device drivers? ([EMAIL PROTECTED])
  Re: DNS Serving ([EMAIL PROTECTED])
  Re: Intel Easy PC camera - cannot be supported in Linux! ([EMAIL PROTECTED])

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

Date: Sun, 24 Dec 2000 09:56:35 -0600
From: Robert Redelmeier <[EMAIL PROTECTED]>
Subject: Re: A faster memcpy and bzero for x86

Linus Torvalds wrote in part:
> 
>  - FreeBSD does pre-zeroing, which makes it look good on certain things.
>    In particular, this makes it look good at allocation-time.
> 
>    But what the numbers also show is that THIS IS BAD IN REAL LIFE!
> 
>    Pre-zeroing makes the kernel profile look good, which is probably
>    what BSD's do it. What it doesn't show is that it generates all the
>    wrong behaviour for the cache: it means that the cache has long since
>    cooled down by the time the page is actually _used_. Look at the sum
>    of all numbers (which is basically doing the same thing), and FreeBSD
>    clearly loses to Linux.
[snip] 
> What the people who did this and wrote all the papers on it forgot about
> is that the initialization also brings the data structure into the
> cache, and that subsequent _uses_ of the data structure thus get sped up
> by initializing it.  So most of the time, the cost of the cache misses
> is just spread out, not actually elided.
> 
> This can be clearly seen in the memset() numbers above: the page miss is
> improved, but because the page was cleared much earlier the cost of
> bringing it into the cache is now transferred to user space instead of
> kernel space.  Which loks good if you want to optimize the kernel, but
> looks bad if you want to get best system _performance_.
> 
> You can obviously find cases where the pre-initialization actually does
> help: if you don't touch the pages after allocating them,
> pre-initialization is a clear win. It's easy to create these kinds of
> benchmarks, I just don't think they are very realistic.


Using my testing framework posted earlier, I've been trying to do
just this:  compare zero-on-use with pre-zero.  Hot vs cold caches
respectively.  It's taken a while because of travel, but I've run some 
tests: [all times CPU clocks for 4 KBpage size sequential accesses]:


     OPERATION             DESTINATION UNCACHED   DESTINATION CACHED
    (per dword)            SRC UNC    SRC C'D     SRC UNC    SRC C'D
                             (1)        (2)         (3)         (4)  
0 reads, 1 writes           11570      11570        2280       2280
1 reads, 1 writes           18020      11590       11830       3310
2      , 1                  20700      11660       12550       4330
3      , 1                  21240      11670       14650       6360
4      , 1                  21340      11690       17940       6380
5      , 1                  21560      11720       18600       7410
6      , 1                  21660      11740       19070       8410

block move [rep movsl]      14210      11340        8490       1155   


What these times show is cached is always better. [L1 vs SDRAM] Doh! 
But remember the zero-on-use [Destination caching] costs 11000 cycles.  
As well as blowing away half the L1 data cache [P5plain & PPro] or 
one-quarter [P2, Cel] just when you are likely to be wanting it.

With these access patterns, hot caches are a lose:  The differences 
(1)-(3) and (2)-(4) are always more than the 11000 it costs to get
(3) or (4).  The CPU is pretty efficient at bringing in cache lines
and will elide useful work [hide in the wait cycles].

Now maybe there is a different access pattern that shows up the
benefits of zero-on-use.  What is it?  I've looked and cannot find.
The case of src & dest both being on the same freshly zeroed page
[column (1)-(4)] I consider to be degenerate.  Code should not
read known zeroes except on a first pass array startup.

Of course, this is predicated on the CPU having some idle time
to do the pre-zeroing.  AFAIK, most machines do.  Even 99% load
means one jiffy per second available.  One jiffy is ~ 5M CPU clks,
enough to zero 400 page although I wouldn't recommend zeroing that
many--too much cache distruction.  But blowing away the caches is not 
as harmful on an idle machine as one working that wants to write RAM.

-- Robert

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

Subject: Re: Libraries
From: Roland Smith <[EMAIL PROTECTED]>
Date: 24 Dec 2000 21:02:05 +0100

Andrew Clark <[EMAIL PROTECTED]> writes:

> Hi,
> 
> Thanks for both those responses they are very useful and effectively
> what I wanted to know!
> 
> Although could someone please tell me if there's a full set of
> ducumentation in HTML format (or other) that contains information about
> everything like this?

The procedure for building shared libraries is laid out in the GCC and ld info
manuals: (I'll admit it is a little terse, but that's where you've got
newsgroups for ;-)

>From the GCC info pages:
`-shared'
     Produce a shared object which can then be linked with other
     objects to form an executable.  Not all systems support this
     option.  You must also specify `-fpic' or `-fPIC' on some systems
     when you specify this option.

`-Wl,OPTION'
     Pass OPTION as an option to the linker.  If OPTION contains
     commas, it is split into multiple options at the commas.

>From the ld pages:
`-hNAME'
`-soname=NAME'
     When creating an ELF shared object, set the internal DT_SONAME
     field to the specified name.  When an executable is linked with a
     shared object which has a DT_SONAME field, then when the
     executable is run the dynamic linker will attempt to load the
     shared object specified by the DT_SONAME field rather than the
     using the file name given to the linker.

> They are so useful to me, but does Linux have any? What happened to the
> Linux Documentation Project? The information for programmers in that
> seemed to be so old that i got the impression it had just been
> translated off the original cave drawings! :-)

Most GNU development tools have documentation in the 'info' system. The
stand-alone 'info' program can read these, but it is not very
user-friendly. It is better to read them in Emacs (Help -> Manuals ->
Browse Manuals with Info), or 'Ctrl-h i'. TkInfo is also quite nice.

Hope this helps. 

Roland
-- 
Roland Smith                        "When life hands you a lemon,
r s m i t h @ x s 4 a l l . n l      make lemonade."
http://www.xs4all.nl/~rsmith/

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

From: Joseph Virzi <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
Crossposted-To: linux.redhat.development
Subject: DNS Serving
Date: Sun, 24 Dec 2000 14:55:56 -0800

I understand that name serving is a complex topic in its entirety. But
the following should be straightforward to do, eh?

I have DSL at home with a static IP address. I wish to have 3 virtual
domains on my server, configured at this IP address.

My service provider, wants to charge me $100 per site to "Name Serve",
and I don't see why I should if I can do it myself.

I figured that I could list my IP address with InterNIC as the
nameserver for my domain name. Then my machine points to myself as a web
server.

I run into these things called zones and other directives that I do not
understand yet. Where can I find reference to them? I thought name
serving was basically translating a domain name into an IP address.

This is not a commercial application, and the domain names are mine, so
no one should get upset that I don't have the right "class" of equipment
to name serve.

Or, am I totally out in left field?


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

From: "Michael Faurot" <[EMAIL PROTECTED]>
Subject: Re: DNS Serving
Date: 25 Dec 2000 03:49:59 GMT

Joseph Virzi <[EMAIL PROTECTED]> wrote:
: I understand that name serving is a complex topic in its entirety. But
: the following should be straightforward to do, eh?

As far as forward lookups go--yes.  However, I  suspect you'll have
problems getting your ISP to delegate reverse lookups to you for your IPs.

: I figured that I could list my IP address with InterNIC as the
: nameserver for my domain name. Then my machine points to myself as a
: web server.

Technically you need to have two DNS servers per domain.  So if all you
have is one IP address and one machine, you're going to need someone to
play secondary for you.

: I run into these things called zones and other directives that I do not
: understand yet. Where can I find reference to them?

The O'Reilly book "DNS & Bind" is the definitive reference for this.
Also you should post your DNS questions to comp.protocols.dns.bind
instead of here.

: I thought name serving was basically translating a domain name into an
: IP address.

It's also translating IP addresses into canonical names.

-- 
==============================================================================
 Michael | mfaurot  | Real wealth can only increase.
 Faurot  | atww.net |           -- R. Buckminster Fuller

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

From: "Edward" <[EMAIL PROTECTED]>
Subject: how to write a program to download a file via HTTP with password 
protected?(NULL inside)
Date: Sun, 24 Dec 2000 22:24:41 +0800

This is a multi-part message in MIME format.

=======_NextPart_000_00AB_01C06DF8.4F4A99E0
Content-Type: text/plain;
        charset="gb2312"
Content-Transfer-Encoding: quoted-printable

Thanks in advance!

=======_NextPart_000_00AB_01C06DF8.4F4A99E0
Content-Type: text/html;
        charset="gb2312"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Dgb2312" http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2920.0" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3D"Times New Roman" size=3D2>Thanks in=20
advance!</FONT></DIV></BODY></HTML>

=======_NextPart_000_00AB_01C06DF8.4F4A99E0==


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

From: [EMAIL PROTECTED]
Subject: RAD for device drivers?
Date: Mon, 25 Dec 2000 06:13:32 GMT

I had an idea for rapidly generating device drivers.  Although
Linux drivers are more and more frequently supplied with new hardware,
it's still not always the case.  So what about writing a program that
reads in a WinNT driver and converts it to a Linux driver?

Marlin


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

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

From: [EMAIL PROTECTED]
Crossposted-To: linux.redhat.development
Subject: Re: DNS Serving
Date: Mon, 25 Dec 2000 09:10:17 -0000

On Sun, 24 Dec 2000 14:55:56 -0800 Joseph Virzi <[EMAIL PROTECTED]> wrote:

| My service provider, wants to charge me $100 per site to "Name Serve",
| and I don't see why I should if I can do it myself.
|
| I figured that I could list my IP address with InterNIC as the
| nameserver for my domain name. Then my machine points to myself as a web
| server.

Another option is to register your domains with one of the alternate
registrars which also provides DNS services with a web control panel
to change the data in your zone.  Some limit the amount of data you
can put in, though.

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

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

From: [EMAIL PROTECTED]
Crossposted-To: comp.os.linux.hardware,comp.os.linux.advocacy
Subject: Re: Intel Easy PC camera - cannot be supported in Linux!
Date: Mon, 25 Dec 2000 09:28:32 -0000

In comp.os.linux.development.system mlw <[EMAIL PROTECTED]> wrote:

|> > It is a tough problem, and one of those gray areas in which a pure GPL
|> > approach is a very tough sell. To differentiate yourself and be
|> > competitive with a hardware product, you must make it good and make it
|> > competitively priced. The answer to this is proprietary software to
|> > control mass-produced trivial hardware.
|> >
|> 
|> Not in a pure GPL approach, as Intel would have only a small expense in
|> the software development as would all the other camera manuafactures.
|
| But how would Intel make a case for its camera over some low priced
| clone? Why would someone pay $10 dollars more for an Intel camera? They
| wouldn't, and that would not be acceptable for someone like Intel.

This depends on whether the software can be developed in the open source
community.  If the software can be made in the open, then Intel would have
no say in all the cheap $10 cameras out there which would use it.  The big
issue is if Intel should release what they developed.  As long as it makes
people buy their hardware instead of the clone (as long as no open source
software for clones has been done yet) then Intel won't see a business case
in releasing the source.


| Intel has a brand name, as dubious as it is, they have to make sure that
| there camera is better than a "Snap!" super el-cheapo. If they can't,
| they won't enter the market. If they release something that makes their
| camera better than the "Snap!" then, "Snap!" would be able to copy their
| image processing techniques and steal the market with price.

This is long as the "better" part is in the software.  And, unfortunately
for cases like this, software is way cheaper than hardware due to the
lower incremental costs.  They want their camera to be better without
(much) increase in costs (of development and manufacture, the extra price
will be taken as profit).


| GPL can not apply to hardware, because hardware is limited by finite
| numbers. Production has a proportional unit cost for the producer. While
| the software associated with a digital camera may be free, making it so
| would affect the ability to produce the camera competitively. The
| software is part of the camera.

It seems to me that one way to fight this is for more people who are
supporters of free software to do some hardware development along the
same lines, and release free designs that manufacture-only companies
might sell, which work with the corresponding free software (which
might have all real smarts in it).


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