public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Chris Mason <mason@suse.com>
To: linux-kernel@vger.kernel.org, reiserfs-list@namesys.com
Subject: [PATCH] reiserfs_write_inode calls during memory pressure
Date: Thu, 28 Jun 2001 11:02:53 -0400	[thread overview]
Message-ID: <44970000.993740573@tiny> (raw)


[ 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);





             reply	other threads:[~2001-06-28 15:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-06-28 15:02 Chris Mason [this message]
  -- strict thread matches above, loose matches on Subject: below --
2001-06-28 14:55 [PATCH] reiserfs_write_inode calls during memory pressure Chris Mason

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=44970000.993740573@tiny \
    --to=mason@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=reiserfs-list@namesys.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