Usenet comp.os.linux.alpha (1997-2013)
 help / color / mirror / Atom feed
From: Jeff Sturm <jsturm@cc42593-a.taylor1.mi.home.com>
Subject: Re: 64-bit Linux?
Date: 1999/06/27	[thread overview]
Message-ID: <Pine.LNX.4.10.9906271003530.1369-100000@cc42593-a.taylor1.mi.home.com> (raw)
In-Reply-To: po7d3.3645$0B1.4209@news.rdc2.occa.home.com


On Sat, 26 Jun 1999, Brent Davies wrote:
> You know, I find a lot of undocumented and unreliable FUD on the Web these
> days.  I see manufactures, advocacy groups, and other people (all of whom
> stand to make a buck on Linux) talking about "64-bit Linux running on the
> 21264 Alpha processor."
> 
> I know that the Linux port to Alpha is almost 2 years old (or older).

It's older.  Early on there were two independent ports taking place, one
was 32-bit and the other was 64-bit.  The 32-bit port (BLADE?) disappeared
long ago.

I don't remember many details, but I read all about it in LJ... check
backissues if you're curious.

> My question:  Would someone please point me toward a reputable source that
> can clear up this 64-bit Linux question?

What is the question exactly?  That Linux supports 64-bit memory
addressing?  Run the following code on any Alpha/Linux distribution:

    #include <stdio.h>

    int main(void) {
        printf("sizeof(int) = %d\n", sizeof(int));
        printf("sizeof(long) = %d\n", sizeof(long));
        printf("sizeof(void *) = %d\n", sizeof(void *));
        return 0;
    }

It will tell you:

    sizeof(int) = 4
    sizeof(long) = 8
    sizeof(void *) = 8

So the pointer type on Alpha is 64-bits.  That suggests Alpha supports
full 64-bit virtual addressing, and it does.  Physical addressing is more
constrained... Linux currently supports up to 2GB of physical memory on
Alpha, although some machines can have more (the DS20 for example 
supports up to 4GB).  (The 2GB limit will probably disappear though
sometime during the 2.x kernel's lifetime.)

One benefit of large virtual addresses is that you can map extrememly 
large files to memory:

    #include <stdio.h>
    #include <fcntl.h>
    #include <unistd.h>
    #include <sys/mman.h>
    #include <errno.h>
    
    #define SIXTEEN_GB    (1L << 34)
    
    int main(void) {
        int fd; char *p;
    
        /* Create a 16GB + 4 file */
        fd = open("/tmp/junk", O_RDWR|O_CREAT, 0777);
        llseek(fd, SIXTEEN_GB, 0);
        write(fd, "16GB", 4);
    
        /* Map it to an array and read the last 4 bytes */
        p = mmap(NULL, SIXTEEN_GB + 4, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
        write(1, p + SIXTEEN_GB, 4);
    
        close(fd);
    }

(Warning: do NOT try this code with older kernels or if you don't want to
risk filesystem corruption... bugs in ext2 prevented large files from
working in 2.0.)

In short, you can create a 16GB file and address the whole thing as a char
array.  You can't do this on any Intel machine today, or on anything
besides an Alpha or possibly Ultra-SPARC.

> I have clients that want to know if they can run Linux instead of Tru64
> Unix, but still get the 64-bit processor throughput.

Exactly what do you mean by "64-bit processor throughput"?  There are no
guarantees that an Alpha will be better or faster than a 32-bit machine
for your applications... though many apps clearly benefit, like those that
need 64-bit arithmetic or large addressing.

> Any _reputable_ light that can be shed on this topic will be greatly
> appreciated.

My "reputable source" is my 164SX, Linux 2.2.10 and egcs 1.1.2... good
enough?

Jeff





  parent reply	other threads:[~1999-06-27  4:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-06-26  4:00 64-bit Linux? Brent Davies
1999-06-26  4:00 ` Christopher B. Browne
1999-06-26  4:00 ` John Wilson
1999-06-27  4:00 ` Jeff Sturm [this message]
1999-06-27  4:00   ` Greg Lindahl
1999-06-27  4:00     ` Brent Davies
1999-06-28  4:00       ` Christopher B. Browne
1999-07-01  4:00         ` Timothy J. Bogart
1999-07-03  4:00           ` Christopher Browne
1999-06-27  4:00   ` Michal Jaegermann
1999-06-27  4:00 ` Michal Jaegermann
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox