From: Robin Holt <holt@sgi.com>
To: Gregory Giguashvili <Gregoryg@ParadigmGeo.com>
Cc: linux-mm@kvack.org
Subject: Re: Correctly determine free memory amount before swapping
Date: Mon, 13 Dec 2004 03:34:54 -0600 [thread overview]
Message-ID: <20041213093454.GB29377@lnx-holt.americas.sgi.com> (raw)
In-Reply-To: <06EF4EE36118C94BB3331391E2CDAAD9D49E06@exil1.paradigmgeo.net>
If you are looking for a quick way to determine from userland how much
extra memory will be shaken free by a large number of anonymous page
faults, you are going to be hard pressed to find it.
One rough indicator is to time the page faults. Simply grab time before
and after you first touch a page and if the delay is drastically larger
than when you started for say 5 pages in a row, you know you are into
swap area. You will need to experiment, but that is a starting point.
Alternatively, you could have a second thread that is simply prefaulting
pages. I have found that most times on a system with modest I/O, I
can have five threads doing strided accesses that fault about as fast
as the I/O subsystem can free memory. Sometimes it takes 7.
Good Luck,
Robin
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"aart@kvack.org"> aart@kvack.org </a>
next prev parent reply other threads:[~2004-12-13 9:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-12-08 14:17 Gregory Giguashvili
2004-12-13 9:34 ` Robin Holt [this message]
2004-12-13 6:32 Gregory Giguashvili
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=20041213093454.GB29377@lnx-holt.americas.sgi.com \
--to=holt@sgi.com \
--cc=Gregoryg@ParadigmGeo.com \
--cc=linux-mm@kvack.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