public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* cache acoounting in Linus tree
@ 2001-11-10  1:57 J . A . Magallon
  2001-11-10 11:11 ` Hugh Dickins
  0 siblings, 1 reply; 2+ messages in thread
From: J . A . Magallon @ 2001-11-10  1:57 UTC (permalink / raw)
  To: Lista Linux-Kernel; +Cc: Alan Cox, Linus Torvalds

Hi.

Does Linus' tree need the cache accounting patch ? Listed below. Please,
confirm or deny....

--- 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.
@@ -182,7 +182,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_pages),

-- 
J.A. Magallon                           #  Let the source be with you...        
mailto:jamagallon@able.es
Mandrake Linux release 8.2 (Cooker) for i586
Linux werewolf 2.4.15-pre2-beo #1 SMP Sat Nov 10 02:24:33 CET 2001 i686

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

* Re: cache acoounting in Linus tree
  2001-11-10  1:57 cache acoounting in Linus tree J . A . Magallon
@ 2001-11-10 11:11 ` Hugh Dickins
  0 siblings, 0 replies; 2+ messages in thread
From: Hugh Dickins @ 2001-11-10 11:11 UTC (permalink / raw)
  To: J . A . Magallon; +Cc: Lista Linux-Kernel, Alan Cox, Linus Torvalds

On Sat, 10 Nov 2001, J . A . Magallon wrote:
> 
> Does Linus' tree need the cache accounting patch ? Listed below. Please,
> confirm or deny....
> 
> --- 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

Deny.  That's the patch Rik rightly posted for -ac, to remove some
code which was appropriate only to -linus, because of other changes
in -linus omitted from -ac: it fixed the meminfo Cached field in -ac.

The meminfo Cached field in -linus also sometimes went wrong.  Mike
Fedyk pursued that issue, Andrew Morton identified it as a wrong
line of code in the ext3 patch for -linus, and that line is not
(he has just assured us) in ext3 as it appears in 2.4.15-pre2.

So, no further patch required.

Hugh


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

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

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-11-10  1:57 cache acoounting in Linus tree J . A . Magallon
2001-11-10 11:11 ` Hugh Dickins

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