All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brian Waite <linwoes@gmail.com>
To: chaosite@gmail.com
Cc: "J.A. Magallon" <jamagallon@able.es>,
	jonathan@jonmasters.org, jonmasters@gmail.com,
	"Linux-Kernel," <linux-kernel@vger.kernel.org>
Subject: Re: /proc/kcore size incorrect ?
Date: Tue, 25 Oct 2005 09:37:12 -0400	[thread overview]
Message-ID: <200510250937.13383.linwoes@gmail.com> (raw)
In-Reply-To: <435E1F36.2030108@gmail.com>

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 2.6.11.4-21.9-default #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))
896

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.

Thanks
Brian


  reply	other threads:[~2005-10-25 13:44 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-23 21:58 /proc/kcore size incorrect ? J.A. Magallon
2005-10-23 23:13 ` Jon Masters
2005-10-23 23:57   ` J.A. Magallon
2005-10-24 12:02     ` Jon Masters
2005-10-24 14:19     ` Stefan Smietanowski
2005-10-25 12:04     ` Matan Peled
2005-10-25 13:37       ` Brian Waite [this message]
2005-10-25 16:02     ` /proc/kcore size incorrect ? (OT) Eric Piel
2005-10-25 16:06       ` J.A. Magallon
2005-10-25 18:04         ` Tony Luck

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=200510250937.13383.linwoes@gmail.com \
    --to=linwoes@gmail.com \
    --cc=chaosite@gmail.com \
    --cc=jamagallon@able.es \
    --cc=jonathan@jonmasters.org \
    --cc=jonmasters@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.