public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Chris Mason <mason@suse.com>
To: Andrew Morton <andrewm@uow.edu.au>
Cc: Rik van Riel <riel@conectiva.com.br>,
	Marcelo Tosatti <marcelo@conectiva.com.br>,
	Xuan Baldauf <xuan--lkml@baldauf.org>,
	linux-kernel@vger.kernel.org, andrea@suse.de,
	"reiserfs-list@namesys.com" <reiserfs-list@namesys.com>
Subject: Re: VM deadlock
Date: Thu, 28 Jun 2001 08:53:42 -0400	[thread overview]
Message-ID: <1022480000.993732822@tiny> (raw)
In-Reply-To: <3B3AA2B8.93F9A28C@uow.edu.au>



On Thursday, June 28, 2001 01:21:28 PM +1000 Andrew Morton
<andrewm@uow.edu.au> wrote:

> Chris Mason wrote:
>> 
>> ...
>> The work around I've been using is the dirty_inode method.  Whenever
>> mark_inode_dirty is called, reiserfs logs the dirty inode.  This means
>> inode changes are _always_ reflected in the buffer cache right away, and
>> the inode itself is never actually dirty.
> 
> reiserfs_mark_inode_dirty() has taken a copy of the in-core inode, so
> it can do this:
> 
>             spin_lock(&inode_lock);
>             if ((inode->i_state & I_LOCK) == 0)
>                     inode->i_state &= ~(I_DIRTY_SYNC|I_DIRTY_DATASYNC);
>             spin_unlock(&inode_lock);
> 
> Unfortunately there is no API function to do this, so inode_lock
> needs to be exported :(

Well, this is kind of my own fault.  I didn't want the dirty_inode call
back to be able to screw with the internals of how inode.c dealt with
things, I wanted it purely to allow actions in addition to what inode.c
wanted to do.

So, mark_inode_dirty calls dirty_inode, and then it sets whatever dirty
bits it wants to.  Clearing them in your own dirty_inode call won't matter,
they should just get set again later.

If we really want to leave the inode clean,  fsync isn't as much of a
concern as O_SYNC writes, since you want generic_osync_inode to properly
flush the updated inode.  But, that can be dealt with by having your
commit_write func test for O_SYNC.

What we can't get around is our friend knfsd, who uses write_inode_now.
The I_DIRTY bit needs to be accurate there (although it doesn't seem
perfect right now anyway).

The real problem I see is that we've overload the sync flag to write_inode.
It means flush now to get the data safe, and flush now to free ram.
Normally this kind of overloading is ok, but once logging comes into play I
believe a distinction is needed.

So, my current plan to fix reiserfs_write_inode is to do nothing when
current->flags & PF_MEMALLOC == 1.  I'm not wild about it, but don't see
many other fixes that don't involve api changes.  

I'd rather not do a private inode list until there is a clean way to apply
memory pressure to it, since reiserfs pins enough memory as it is.

-chris


  reply	other threads:[~2001-06-28 12:55 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-06-27 14:27 VM deadlock Xuan Baldauf
2001-06-27 13:11 ` Marcelo Tosatti
2001-06-27 16:13   ` Xuan Baldauf
2001-06-27 15:09 ` Chris Mason
2001-06-27 16:20   ` Xuan Baldauf
2001-06-27 17:43   ` Marcelo Tosatti
2001-06-27 19:36     ` Chris Mason
2001-06-27 19:43       ` Rik van Riel
2001-06-27 20:24         ` Chris Mason
2001-06-27 20:36           ` Rik van Riel
2001-06-27 20:52             ` Chris Mason
2001-06-28  3:21           ` Andrew Morton
2001-06-28 12:53             ` Chris Mason [this message]
2001-06-28 14:08               ` Andrew Morton
2001-06-28 14:25                 ` Chris Mason
2001-06-27 19:50       ` [reiserfs-list] " Xuan Baldauf
2001-06-27 18:16   ` Rik van Riel
2001-06-27 18:38     ` 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=1022480000.993732822@tiny \
    --to=mason@suse.com \
    --cc=andrea@suse.de \
    --cc=andrewm@uow.edu.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo@conectiva.com.br \
    --cc=reiserfs-list@namesys.com \
    --cc=riel@conectiva.com.br \
    --cc=xuan--lkml@baldauf.org \
    /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