public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave <dwelling@dsrnet.com>
To: linux-kernel@vger.kernel.org
Subject: SMP not using all 4GB Mem
Date: Fri, 20 Apr 2001 16:36:40 -0400	[thread overview]
Message-ID: <3AE09DD8.2FA3CB63@dsrnet.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 96 bytes --]

I have attached a question concerning using 4GB of memory on an SMP.

Thanks for the time,
Dave

[-- Attachment #2: MEMQUESTION.txt --]
[-- Type: text/plain, Size: 2921 bytes --]

SMP Not using all 4GB Ram Question:
---------------------------------------------------------------------
I am using a Compaq Proliant 8500 SMP with 8 550 Mhz processors and 4GB of RAM.
Using Kernel 2.4.3 and Redhat 6.2

I have the (4GB) High Memory Support enabled.

I seem not to be able to use more that 1GB of memory.

The Following is my /proc/meminfo file

----------------------------------------------------------------------
        total:    used:    free:  shared: buffers:  cached:
Mem:  3952427008 339447808 3612979200        0 256139264 25030656
Swap: 1048633344        0 1048633344
MemTotal:      3859792 kB
MemFree:       3528300 kB
MemShared:           0 kB
Buffers:        250136 kB
Cached:          24444 kB
Active:          16628 kB
Inact_dirty:    257952 kB
Inact_clean:         0 kB
Inact_target:      172 kB
HighTotal:     3014624 kB
HighFree:      2978372 kB
LowTotal:       845168 kB
LowFree:        549928 kB
SwapTotal:     1024056 kB
SwapFree:      1024056 kB
--------------------------------------------------------------

I wrote the following program that simply allocates 100M of memory
and then write to it.

#include <stdio.h>


int main (void)
{

  char *p;
  unsigned int i;
  p = malloc (100000000);

  while (1)
    {
      for (i=0;i<100000000;i++)
        *(p+i) = 5;
      sleep (1);
      for (i=0;i<100000000;i++)
        *(p+i) = 6;
      sleep(1);
    }
}

I can run 9 copies of this program to take up 900M of memory.  When 
I attempt to start the 10th process, the whole world goes nuts.  The
X-window that it was started in closes and I continue to get a 
signal 11 interrupt whenever I run a shell command or attempt to compile.

I have another program that will allocate ~2GB of memory and then write data to
it.  It attempts to read the data back and fails around the 850-900M mark. 


#include <stdio.h>
#include <string.h>
#include <sys/mman.h>

int main (void)

{

  int done = 0;
  unsigned int i = 0x7feee800; 
  char *p;
  char *p2;
  unsigned int x;


   p = malloc(i);
      
   sleep (1);
 
   for (x=0;x<i;x++)
    {
    *(p+x) = 5;
    if (*(p+x) !=5)
      {
       printf("first Error %x  %x Address = %x \n", p, x, p+x);
              free(p);
	      return (0);  
      }  
    }


for (x=0;x<i;x++)
    if (*(p+x) !=5)
      {
       printf("5 Error %x  %x Address = %x Value = %x \n", p, x, p+x, *(p+x));
            free(p); 
	    return (0); 
       sleep(1); 
      }

  memset(p, 10, i);
  for (x=0;x<(i-1);x++)
    if (p[x] !=10)
      {
       printf("A Error %i  %x\n", p[x], x);
       /* free(p);
	  return (0);*/
      }
  
  printf("Done\n");
  free(p);
  return (0);

}
--------------------------

Example Run Result:

5 Error 4010f008  32650ff8 Address = 72760000 Value 67

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

The failing address is always a multiple of 0x10000.


Could you give me some info on what I am doing wrong?  

Thanks for your time, 
Dave


                 reply	other threads:[~2001-04-20 20:35 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3AE09DD8.2FA3CB63@dsrnet.com \
    --to=dwelling@dsrnet.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox