linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Rik van Riel <riel@conectiva.com.br>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: Andrew Morton <akpm@zip.com.au>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	Ed Tomlinson <tomlins@cam.org>
Subject: [PATCH] return values shrink_dcache_memory etc
Date: Fri, 19 Jul 2002 18:46:52 -0300 (BRT)	[thread overview]
Message-ID: <Pine.LNX.4.44L.0207191842080.12241-100000@imladris.surriel.com> (raw)

Hi,

this patch, against current 2.5 BK, builds on the patch that let
kmem_cache_shrink return the number of pages freed. This value
is used as the return value for shrink_dcache_memory and friends.

This is useful not just for more accurate OOM detection, but also as
a preparation for putting these reclaimable slab pages on the LRU list.
This change was originally done by Ed Tomlinson.

please apply,
thank you,

Rik
-- 
Bravely reimplemented by the knights who say "NIH".

 fs/dcache.c |    3 +--
 fs/dquot.c  |    3 +--
 fs/inode.c  |    3 +--
 mm/vmscan.c |    6 +++---
 4 files changed, 6 insertions(+), 9 deletions(-)

# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
#	           ChangeSet	1.660   -> 1.661
#	         fs/dcache.c	1.29    -> 1.30
#	          fs/dquot.c	1.43    -> 1.44
#	         mm/vmscan.c	1.85    -> 1.86
#	          fs/inode.c	1.66    -> 1.67
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 02/07/19	riel@imladris.surriel.com	1.661
# use the return values from shrink_dcache_memory, shrink_icache_memory
# and shrink_dqcache_memory (thanks to Ed Tomlinson)
# --------------------------------------------
#
diff -Nru a/fs/dcache.c b/fs/dcache.c
--- a/fs/dcache.c	Fri Jul 19 18:22:35 2002
+++ b/fs/dcache.c	Fri Jul 19 18:22:35 2002
@@ -603,8 +603,7 @@
 	count = dentry_stat.nr_unused / priority;

 	prune_dcache(count);
-	kmem_cache_shrink(dentry_cache);
-	return 0;
+	return kmem_cache_shrink(dentry_cache);
 }

 #define NAME_ALLOC_LEN(len)	((len+16) & ~15)
diff -Nru a/fs/dquot.c b/fs/dquot.c
--- a/fs/dquot.c	Fri Jul 19 18:22:35 2002
+++ b/fs/dquot.c	Fri Jul 19 18:22:35 2002
@@ -498,8 +498,7 @@
 	count = dqstats.free_dquots / priority;
 	prune_dqcache(count);
 	unlock_kernel();
-	kmem_cache_shrink(dquot_cachep);
-	return 0;
+	return kmem_cache_shrink(dquot_cachep);
 }

 /*
diff -Nru a/fs/inode.c b/fs/inode.c
--- a/fs/inode.c	Fri Jul 19 18:22:35 2002
+++ b/fs/inode.c	Fri Jul 19 18:22:35 2002
@@ -431,8 +431,7 @@
 	count = inodes_stat.nr_unused / priority;

 	prune_icache(count);
-	kmem_cache_shrink(inode_cachep);
-	return 0;
+	return kmem_cache_shrink(inode_cachep);
 }

 /*
diff -Nru a/mm/vmscan.c b/mm/vmscan.c
--- a/mm/vmscan.c	Fri Jul 19 18:22:35 2002
+++ b/mm/vmscan.c	Fri Jul 19 18:22:35 2002
@@ -389,12 +389,12 @@

 	wakeup_bdflush();

-	shrink_dcache_memory(priority, gfp_mask);
+	nr_pages += shrink_dcache_memory(priority, gfp_mask);

 	/* After shrinking the dcache, get rid of unused inodes too .. */
-	shrink_icache_memory(1, gfp_mask);
+	nr_pages += shrink_icache_memory(1, gfp_mask);
 #ifdef CONFIG_QUOTA
-	shrink_dqcache_memory(DEF_PRIORITY, gfp_mask);
+	nr_pages += shrink_dqcache_memory(DEF_PRIORITY, gfp_mask);
 #endif

 	return nr_pages;

--
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/

                 reply	other threads:[~2002-07-19 21:46 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=Pine.LNX.4.44L.0207191842080.12241-100000@imladris.surriel.com \
    --to=riel@conectiva.com.br \
    --cc=akpm@zip.com.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=tomlins@cam.org \
    --cc=torvalds@transmeta.com \
    /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