From: Miklos Szeredi <miklos@szeredi.hu>
To: Dave Chinner <david@fromorbit.com>
Cc: Amir Goldstein <amir73il@gmail.com>,
linux-xfs <linux-xfs@vger.kernel.org>,
Jeff Mahoney <jeffm@suse.com>, Theodore Tso <tytso@mit.edu>,
Jan Kara <jack@suse.cz>,
Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
Subject: Re: [PATCH] xfs: avoid lockdep false positives in xfs_trans_alloc
Date: Tue, 2 Oct 2018 09:33:30 +0200 [thread overview]
Message-ID: <CAJfpegvcmKiaU-oPfXk0ub6tdBKhDRcUKTkLd5_rAagv05R-EA@mail.gmail.com> (raw)
In-Reply-To: <20181002063952.GN18567@dastard>
On Tue, Oct 2, 2018 at 8:39 AM, Dave Chinner <david@fromorbit.com> wrote:
> Have a look at shrink_dcache_sb() and shrink_dcache_for_umount() and
> what they imply about the dentries that take references to an inode
> on a different superblock. Then look at generic_shutdown_super() -
> pay attention to what happens if there are still allocated inodes
> after all the superblock dentries have been pruned and inodes
> evicted. i.e. this will trigger if some other superblock holds
> references to them:
>
> if (!list_empty(&sb->s_inodes)) {
> printk("VFS: Busy inodes after unmount of %s. "
> "Self-destruct in 5 seconds. Have a nice day...\n",
> sb->s_id);
> }
>
Overlay holds references to the underlying sb's (through a set of
internal mounts), so that's not going to happen.
> If overlay puts unlinked dentries on it's LRU where the superblock
> shrinker may clean them up and release the final reference to
> unlinked inodes, then whatever calls the shrinker will get blocked.
> If kswapd does the shrinking, then the whole system can lock up
> because kswapd can't make progress until the filesystem is unfrozen.
> And if the process that does that unfreezing needs memory....
Seems like freezing any of the layers if overlay itself is not frozen
is not a good idea.
Preventing unlink (or modification generally) on the underlying layers
if part of an overlay is also doable, but it would likely run into
such backward compat issues that no one would be happy. So I don't
think that's now the way to go. We could have done that initially,
but it turns out allowing modification of the underlying layers can be
useful at times.
> I can think of several other similar ways that we can probably be
> screwed by cross-superblock references and memory reclaim
> interactions. I can't think of any way to avoid them except for
> not getting into that mess in the first place.
The freezer interaction can be solved by letting the freezer know
about the dependencies of filesystems. So if an underlying layer
needs to be frozen, then all stacks containing that underlying layer
would need to be frozen first. I guess any of the other bad
interactions would be solvable in a similar manner.
Thanks,
Miklos
>
>> pardon my ignorance, but can't memory shrinker
>> trigger oom killer indirectly causing to release deleted inodes?
>> Not sure in which context those files/inodes get released?
>
> The oom killer doesn't free anything. It marks a process as being
> killed, then when that process context gets scehduled it exits,
> releasing all the open files it holds and so dropping the last
> reference to the dentries in task context, not the OOM kill context.
>
> Cheers,
>
> Dave.
> --
> Dave Chinner
> david@fromorbit.com
next prev parent reply other threads:[~2018-10-02 14:15 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-07 1:51 [PATCH] xfs: avoid lockdep false positives in xfs_trans_alloc Dave Chinner
2018-09-07 14:07 ` Brian Foster
2018-09-10 6:47 ` Christoph Hellwig
2018-09-30 7:56 ` Amir Goldstein
2018-10-01 1:09 ` Dave Chinner
2018-10-01 7:56 ` Amir Goldstein
2018-10-01 22:32 ` Dave Chinner
2018-10-02 4:02 ` Amir Goldstein
2018-10-02 6:39 ` Dave Chinner
2018-10-02 7:33 ` Miklos Szeredi [this message]
2018-10-02 23:14 ` Dave Chinner
2018-10-03 3:45 ` Amir Goldstein
2018-10-03 22:59 ` Dave Chinner
2018-10-03 23:14 ` Miklos Szeredi
2018-10-04 5:38 ` Dave Chinner
2018-10-04 7:33 ` Miklos Szeredi
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=CAJfpegvcmKiaU-oPfXk0ub6tdBKhDRcUKTkLd5_rAagv05R-EA@mail.gmail.com \
--to=miklos@szeredi.hu \
--cc=amir73il@gmail.com \
--cc=david@fromorbit.com \
--cc=jack@suse.cz \
--cc=jeffm@suse.com \
--cc=linux-xfs@vger.kernel.org \
--cc=penguin-kernel@i-love.sakura.ne.jp \
--cc=tytso@mit.edu \
/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;
as well as URLs for NNTP newsgroup(s).