linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Move __GFP_IO check in shrink_icache_memory to prune_icache()
@ 2001-04-23 21:43 Marcelo Tosatti
  2001-04-24  1:27 ` Marcelo Tosatti
  0 siblings, 1 reply; 3+ messages in thread
From: Marcelo Tosatti @ 2001-04-23 21:43 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: lkml


Linus,

With the prune_icache() modifications which were integrated in pre5 there
is no more need to avoid non __GFP_IO allocations to go down to
prune_icache().

The following patch moves the __GFP_IO check down to prune_icache(),
allowing !__GFP_IO allocations to free clean unused inodes.


diff --exclude-from=/home/marcelo/exclude -Nur linux.orig/fs/dquot.c linux/fs/dquot.c
--- linux.orig/fs/dquot.c	Mon Apr 23 19:15:23 2001
+++ linux/fs/dquot.c	Mon Apr 23 19:18:14 2001
@@ -554,7 +554,7 @@
 	if (shrink) {
 		printk(KERN_DEBUG "get_empty_dquot: pruning dcache and icache\n");
 		prune_dcache(128);
-		prune_icache(128);
+		prune_icache(128, GFP_USER);
 		shrink--;
 		goto repeat;
 	}
diff --exclude-from=/home/marcelo/exclude -Nur linux.orig/fs/inode.c linux/fs/inode.c
--- linux.orig/fs/inode.c	Mon Apr 23 19:15:23 2001
+++ linux/fs/inode.c	Mon Apr 23 19:18:04 2001
@@ -540,7 +540,7 @@
 	 !inode_has_buffers(inode))
 #define INODE(entry)	(list_entry(entry, struct inode, i_list))
 
-void prune_icache(int goal)
+void prune_icache(int goal, int gfp_mask)
 {
 	LIST_HEAD(list);
 	struct list_head *entry, *freeable = &list;
@@ -577,6 +577,16 @@
 
 	dispose_list(freeable);
 
+	/*
+	 * Nasty deadlock avoidance..
+	 *
+	 * We may hold various FS locks, and we don't
+	 * want to recurse into the FS that called us
+	 * in clear_inode() and friends..
+	 */
+	if (!(gfp_mask & __GFP_IO))
+		return;
+
 	/* 
 	 * If we freed enough clean inodes, avoid writing 
 	 * dirty ones. Also giveup if we already tried to
@@ -596,20 +606,10 @@
 {
 	int count = 0;
 
-	/*
-	 * Nasty deadlock avoidance..
-	 *
-	 * We may hold various FS locks, and we don't
-	 * want to recurse into the FS that called us
-	 * in clear_inode() and friends..
-	 */
-	if (!(gfp_mask & __GFP_IO))
-		return;
-
 	if (priority)
 		count = inodes_stat.nr_unused / priority;
 
-	prune_icache(count);
+	prune_icache(count, gfp_mask);
 	kmem_cache_shrink(inode_cachep);
 }
 
diff --exclude-from=/home/marcelo/exclude -Nur linux.orig/include/linux/dcache.h linux/include/linux/dcache.h
--- linux.orig/include/linux/dcache.h	Mon Apr 23 19:15:23 2001
+++ linux/include/linux/dcache.h	Mon Apr 23 19:18:31 2001
@@ -176,7 +176,7 @@
 
 /* icache memory management (defined in linux/fs/inode.c) */
 extern void shrink_icache_memory(int, int);
-extern void prune_icache(int);
+extern void prune_icache(int, int);
 
 /* only used at mount-time */
 extern struct dentry * d_alloc_root(struct inode *);



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

* Re: [PATCH] Move __GFP_IO check in shrink_icache_memory to prune_icache()
  2001-04-23 21:43 [PATCH] Move __GFP_IO check in shrink_icache_memory to prune_icache() Marcelo Tosatti
@ 2001-04-24  1:27 ` Marcelo Tosatti
  2001-04-24 12:09   ` Alan Cox
  0 siblings, 1 reply; 3+ messages in thread
From: Marcelo Tosatti @ 2001-04-24  1:27 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: lkml, Alexander Viro



On Mon, 23 Apr 2001, Marcelo Tosatti wrote:

> 
> Linus,
> 
> With the prune_icache() modifications which were integrated in pre5 there
> is no more need to avoid non __GFP_IO allocations to go down to
> prune_icache().
> 
> The following patch moves the __GFP_IO check down to prune_icache(),
> allowing !__GFP_IO allocations to free clean unused inodes.

Forget about this. 

We may have to write quota information back to disk while freeing the
inode and then we are fucked. 


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

* Re: [PATCH] Move __GFP_IO check in shrink_icache_memory to prune_icache()
  2001-04-24  1:27 ` Marcelo Tosatti
@ 2001-04-24 12:09   ` Alan Cox
  0 siblings, 0 replies; 3+ messages in thread
From: Alan Cox @ 2001-04-24 12:09 UTC (permalink / raw)
  To: Marcelo Tosatti; +Cc: Linus Torvalds, lkml, Alexander Viro

> > The following patch moves the __GFP_IO check down to prune_icache(),
> > allowing !__GFP_IO allocations to free clean unused inodes.
> 
> Forget about this. 
> 
> We may have to write quota information back to disk while freeing the
> inode and then we are fucked. 

Also you are looking at the none -ac quota code which is broken anyway 8)
The same problem seems to hold true with your patch and the current quota
code however.

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

end of thread, other threads:[~2001-04-24 12:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-04-23 21:43 [PATCH] Move __GFP_IO check in shrink_icache_memory to prune_icache() Marcelo Tosatti
2001-04-24  1:27 ` Marcelo Tosatti
2001-04-24 12:09   ` Alan Cox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).