[lkml]   [2005]   [Oct]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: /proc/kcore size incorrect ?
On Tuesday 25 October 2005 8:04 am, Matan Peled wrote:
> J.A. Magallon wrote:
> > I expected /proc/kcore to give the size of your installed memory, with
> > the reserved BIOS areas just not accesible, but it looks like it already
> > has them discounted, so gives 1022 Mb.
> >
> > It looks really silly to have a motd say "wellcome to this box, it has
> > 2 xeons and 1022 Mb of RAM".
> I don't know why, but 'du' seems to be doing a better job.
> chaosite@kaitou ~ $ du /proc/kcore --block-size=1M
> 1024 /proc/kcore
> chaosite@kaitou ~ $ echo $(($(stat -c %s /proc/kcore) / 1024 / 1024))
> 1023
To show just how fragile your tests are, here is what my laptop reports with 1
GB memory:

bwaite@ronzoni:~> uname -a
Linux ronzoni #1 Fri Aug 19 11:58:59 UTC 2005 i686 i686
i386 GNU/Linux
bwaite@ronzoni:~> du /proc/kcore --block-size=1M
897 /proc/kcore

bwaite@ronzoni:~> echo $(($(stat -c %s /proc/kcore) / 1024 / 1024))

bwaite@ronzoni:~> dmesg | grep MEM
127MB HIGHMEM available.
896MB LOWMEM available.

bwaite@ronzoni:~> dmesg | grep Memory:
Memory: 1033684k/1048248k available (1866k kernel code, 13796k reserved, 658k
data, 204k init, 130744k highmem)

In short why not use free and show what your users can use. Otherwise, just
make a static motd and change it whenever you change memory configurations. I
can't believe you are changing that often. If you are going to go overboard
and write a script just start doing the round up on your own.


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-10-25 15:46    [W:0.029 / U:7.040 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site