From: Andrew Morton <andrewm@uow.edu.au>
To: Chris Mason <mason@suse.com>
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: Fri, 29 Jun 2001 00:08:37 +1000 [thread overview]
Message-ID: <3B3B3A65.844C3880@uow.edu.au> (raw)
In-Reply-To: <3B3AA2B8.93F9A28C@uow.edu.au> <1022480000.993732822@tiny>
Chris Mason wrote:
>
> On Thursday, June 28, 2001 01:21:28 PM +1000 Andrew Morton
> <andrewm@uow.edu.au> wrote:
> ...
> > 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.
yes, the above code is a bit of a waste of space :)
The reason ->write_inode() can be a no-op is that __sync_one()
marks the inode clean, then calls ->write_inode(). We *know*
that we took a copy of the inode in mark_inode_dirty(), so
we don't need to do anything.
Of course this absolutely requires all inode dirtiers to
call mark_inode_dirty() after doing the dirty, which is a risk.
But we face that risk with the PF_MEMALLOC case anyway. No
problems have appeared in testing.
mark_inode_dirty() is the only way in which those bits can get
set. So the risk we face is that someone calls mark_inode_dirty(),
then alters the inode, then there is a call to write_inode().
That would be a bug, IMO.
As for knfsd, well, someone must have called mark_inode_dirty()
at sometime, else they'd never get written.
It's all rather dodgy.
-
next prev parent reply other threads:[~2001-06-28 14:09 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
2001-06-28 14:08 ` Andrew Morton [this message]
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=3B3B3A65.844C3880@uow.edu.au \
--to=andrewm@uow.edu.au \
--cc=andrea@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=marcelo@conectiva.com.br \
--cc=mason@suse.com \
--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