public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] correct cached statistics
@ 2001-10-31 15:16 Rik van Riel
  2001-11-01 13:00 ` Mike Fedyk
  0 siblings, 1 reply; 2+ messages in thread
From: Rik van Riel @ 2001-10-31 15:16 UTC (permalink / raw)
  To: Alan Cox; +Cc: linux-kernel

Hi,

it seems a small change from the blockdev-in-pagecache changes
has crept into 2.4.13-ac, the following patch backs out that
change and should make the cached stats correct again.

Please apply for the next one.

thanks,

Rik
-- 
DMCA, SSSCA, W3C?  Who cares?  http://thefreeworld.net/

http://www.surriel.com/		http://distro.conectiva.com/


--- linux-2.4.13-ac5/fs/proc/proc_misc.c.blkpg	Wed Oct 31 13:09:51 2001
+++ linux-2.4.13-ac5/fs/proc/proc_misc.c	Wed Oct 31 13:12:27 2001
@@ -140,7 +140,9 @@
 {
 	struct sysinfo i;
 	int len;
-	int pg_size;
+	unsigned int cached;
+
+	cached = atomic_read(&page_cache_size) - atomic_read(&shmem_nrpages);

 /*
  * display in kilobytes.
@@ -149,14 +151,12 @@
 #define B(x) ((unsigned long long)(x) << PAGE_SHIFT)
 	si_meminfo(&i);
 	si_swapinfo(&i);
-	pg_size = atomic_read(&page_cache_size) - i.bufferram ;
-
 	len = sprintf(page, "        total:    used:    free:  shared: buffers:  cached:\n"
 		"Mem:  %8Lu %8Lu %8Lu %8Lu %8Lu %8Lu\n"
 		"Swap: %8Lu %8Lu %8Lu\n",
 		B(i.totalram), B(i.totalram-i.freeram), B(i.freeram),
 		B(i.sharedram), B(i.bufferram),
-		B(pg_size), B(i.totalswap),
+		B(cached), B(i.totalswap),
 		B(i.totalswap-i.freeswap), B(i.freeswap));
 	/*
 	 * Tagged format, for easy grepping and expansion.
@@ -184,7 +184,7 @@
 		K(i.freeram),
 		K(i.sharedram),
 		K(i.bufferram),
-		K(pg_size - swapper_space.nrpages),
+		K(cached - swapper_space.nrpages),
 		K(swapper_space.nrpages),
 		K(nr_active_pages),
 		K(nr_inactive_dirty_pages),


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] correct cached statistics
  2001-10-31 15:16 [PATCH] correct cached statistics Rik van Riel
@ 2001-11-01 13:00 ` Mike Fedyk
  0 siblings, 0 replies; 2+ messages in thread
From: Mike Fedyk @ 2001-11-01 13:00 UTC (permalink / raw)
  To: Rik van Riel; +Cc: linux-kernel

On Wed, Oct 31, 2001 at 01:16:15PM -0200, Rik van Riel wrote:
> Hi,
> 
> it seems a small change from the blockdev-in-pagecache changes
> has crept into 2.4.13-ac, the following patch backs out that
> change and should make the cached stats correct again.
> 
> Please apply for the next one.
> 
> thanks,
> 

Will this work on linus kernels too?  I'm seeing this on:
Now  : 01:36:51 running Linux
   2.4.14-pre6+preempt+netdev_random+ext3_0.9.14-2414p5
   
Mike

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-11-01 13:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-10-31 15:16 [PATCH] correct cached statistics Rik van Riel
2001-11-01 13:00 ` Mike Fedyk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox