mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Breno" <brenosp@brasilsec.com.br>
To: "Marcelo" <marcelo@conectiva.com.br>
Cc: "Kernel List" <linux-kernel@vger.kernel.org>
Subject: mswap.patch - 2.4.20
Date: Wed, 8 Oct 2003 12:33:01 -0300	[thread overview]
Message-ID: <000a01c38db1$76b4e400$f8e4a7c8@bsb.virtua.com.br> (raw)

[-- Attachment #1: Type: text/plain, Size: 123 bytes --]

Hi ,


I dis this small patch , because i need to know information about swap´s
consume.

patch for kernel 2.4.20


thanks

[-- Attachment #2: mswap.patch.txt --]
[-- Type: text/plain, Size: 773 bytes --]

--- memoryo.c	Thu Feb 13 17:35:20 2003
+++ memory.c	Wed Oct  8 08:53:30 2003
@@ -49,6 +49,7 @@
 #include <asm/pgalloc.h>
 #include <asm/uaccess.h>
 #include <asm/tlb.h>
+#include <linux/sched.h>
 
 unsigned long max_mapnr;
 unsigned long num_physpages;
@@ -1504,3 +1505,28 @@
 	}
 	return page;
 }
+
+int show_swap_usage(void)
+{
+    struct task_struct *p = NULL;
+    
+    for_each_task(p)
+    {
+	if(p != NULL)
+	{
+	    if(p->pid != 1)
+	    {
+		if(p->mm != NULL)
+		{
+		    if(p->nswap > 0)
+		    {
+			printk(KERN_CRIT"Process name: %s pid %d\n",p->comm,p->pid);
+			printk(KERN_CRIT"Nswap: %lu Totalvm %lu Cswap %lu\n",p->nswap,p->mm->total_vm,p->cnswap);
+			return 0;
+		    }
+		}
+	    }
+	}
+    }
+    return 0;
+}	

             reply	other threads:[~2003-09-07 15:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-08 15:33 Breno [this message]
2003-09-07 16:08 ` Russell King

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='000a01c38db1$76b4e400$f8e4a7c8@bsb.virtua.com.br' \
    --to=brenosp@brasilsec.com.br \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo@conectiva.com.br \
    /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

Powered by JetHome