public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] reiserfs_write_inode calls during memory pressure
@ 2001-06-28 14:55 Chris Mason
  0 siblings, 0 replies; 2+ messages in thread
From: Chris Mason @ 2001-06-28 14:55 UTC (permalink / raw)
  To: linux-kernel, reiserfs-list


Hi guys,

This patch makes reiserfs_write_inode skip the com



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

* [PATCH] reiserfs_write_inode calls during memory pressure
@ 2001-06-28 15:02 Chris Mason
  0 siblings, 0 replies; 2+ messages in thread
From: Chris Mason @ 2001-06-28 15:02 UTC (permalink / raw)
  To: linux-kernel, reiserfs-list


[ one more time ]

Hi guys,

This patch makes reiserfs_write_inode skip the commit when it is called 
during memory pressure with sync == 1.  In this case, reiserfs already has 
the inode logged, and triggering an immediate commit might force kswapd
to wait on the log, which can lead to deadlock.

More details can be found in the VM deadlock thread on both of these
lists.

It has passed minimal testing on my machine, I'll start more (yura, please 
do the same).

-chris

diff -Nru a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c
--- a/fs/reiserfs/inode.c	Thu Jun 28 10:56:04 2001
+++ b/fs/reiserfs/inode.c	Thu Jun 28 10:56:04 2001
@@ -1284,7 +1284,12 @@
 	                  inode->i_ino) ;
         return ;
     }
-    if (do_sync) {
+    /* memory pressure can sometimes initiate write_inode calls with sync == 1,
+    ** these cases are just when the system needs ram, not when the 
+    ** inode needs to reach disk for safety, and they can safely be
+    ** ignored because the altered inode has already been logged.
+    */
+    if (do_sync && !(current->flags & PF_MEMALLOC)) {
 	lock_kernel() ;
 	journal_begin(&th, inode->i_sb, jbegin_count) ;
 	reiserfs_update_sd (&th, inode);





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

end of thread, other threads:[~2001-06-28 15:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-06-28 14:55 [PATCH] reiserfs_write_inode calls during memory pressure Chris Mason
  -- strict thread matches above, loose matches on Subject: below --
2001-06-28 15:02 Chris Mason

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