Re: about /proc/meminfo and mmap

From: Zhixu Liu (liuzx@bnl.gov)
Date: Mon Oct 23 2000 - 07:49:32 EST


> > My program need to a 32M buffer, so I add "append="mem=96M"" to lilo.conf,
> > then the PC only know 96M mem, I can use the rest 32M. Following is a
> > simple example:
>
> No!!! You may stomp on regions reserved by the motherboard.
>
> Unless you must deal with stupid DMA hardware, just use malloc().
> There is a mlock() call if you need to avoid swapping.
>
> Next time you ask a question, specify what you really want to do
> without mentioning how you think you'd solve the problem. Maybe you
> should be using SysV shared memory or anonymous mmap.

This method above is taken from
http://www.isd.cme.nist.gov/projects/emc/shmem.html, and it said the
buffer size should not bigger than pagesize, but I map almost 31M in a
machine, that's no problem, and the memory near 32M whenI write a random
number, then read out it, they are different, and the read is always
65535. So I think I can use almost 31M, or absolutely 30M. How do you
think about this? (BTW, the pagesize in my machine is 4M)

Best.

 Zhixu

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Oct 23 2000 - 21:00:20 EST