mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paul Larson <plars@austin.ibm.com>
To: Linus Torvalds <Torvalds@Transmeta.COM>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] /proc/vmload memory_pressure meter
Date: 30 Aug 2001 10:47:46 +0000	[thread overview]
Message-ID: <999168467.7844.23.camel@plars.austin.ibm.com> (raw)

This patch adds /proc/vmload that reports the current value of
memory_pressure. The idea came from an enhancement proposed on the
linux-mm bugzilla (#3007, but it seems to be down atm).

This patch was made against 2.4.10-pre2.

-Paul Larson

diff -urN linux-2.4.10-pre2/fs/proc/proc_misc.c linux-2.4.10-pre2-vmload/fs/proc/proc_misc.c
--- linux-2.4.10-pre2/fs/proc/proc_misc.c	Thu Aug 30 09:51:47 2001
+++ linux-2.4.10-pre2-vmload/fs/proc/proc_misc.c	Thu Aug 30 09:55:10 2001
@@ -199,6 +199,15 @@
 #undef K
 }
 
+vmload_read_proc(char *page, char **start, off_t off,
+				 int count, int *eof, void *data) {
+	int len = 0;
+ 
+	len += sprintf(page+len, "%d\n", memory_pressure);
+	*eof = 1;
+	return len;
+}
+
 static int version_read_proc(char *page, char **start, off_t off,
 				 int count, int *eof, void *data)
 {
@@ -518,6 +527,7 @@
 		{"loadavg",     loadavg_read_proc},
 		{"uptime",	uptime_read_proc},
 		{"meminfo",	meminfo_read_proc},
+		{"vmload",	vmload_read_proc},
 		{"version",	version_read_proc},
 		{"cpuinfo",	cpuinfo_read_proc},
 #ifdef CONFIG_PROC_HARDWARE


             reply	other threads:[~2001-08-30 15:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-30 10:47 Paul Larson [this message]
2001-08-30 21:14 ` Rik van Riel

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=999168467.7844.23.camel@plars.austin.ibm.com \
    --to=plars@austin.ibm.com \
    --cc=Torvalds@Transmeta.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

all inboxes | Powered by JetHome®