From: Anatol Pomozov <anatol.pomozov@gmail.com>
To: Dmitry Monakhov <dmonakhov@openvz.org>
Cc: linux-ext4@vger.kernel.org, "Theodore Ts'o" <tytso@mit.edu>
Subject: Re: ext4_orphan_del() sleeps in non-journal mode
Date: Sat, 15 Sep 2012 15:28:19 -0700 [thread overview]
Message-ID: <CAOMFOmWh3CVdREk5uyPCxwFQBTopiqainfGYxC6HijieM1rEWA@mail.gmail.com> (raw)
In-Reply-To: <87zk4rwqg2.fsf@openvz.org>
D'oh, sorry.
I did not realize that it is our local modification that calls
ext4_orphan_del(NULL) from ext4_end_io_dio. So please ignore the issue
"ext4_orphan_del sleeps in softirq context".
But the other more general issue "ext4_orphan_del sleeps in no-journal
mode" still applies. As Dmitry mentioned in this commit 3d287de3b828
such sleep might degrade performance. In no-journal mode we do not
need to manipulate with i_orphan list and no reason to take the mutex.
I checked all ext4_orphan_del(NULL,...) usages and some of them look
good for me, e.g.
handle = ext4_journal_start(inode, 2);
if (IS_ERR(handle)) {
if (inode->i_nlink)
ext4_orphan_del(NULL, inode);
In this example we take handle and important thing to note here is
that IS_ERR(handle) can be true only in journal mode when starting
journal failed. In non-journal mode ext4_journal_start() *always*
returns a fake handle that is non-error (see ext4_get_nojournal). So
the example above never sleeps in ext4_orphan_del().
But there are other examples where sleep might happen (at current HEAD
3f0c3c8fe):
inode.c:281
inode.c:956
inode.c:1069
inode.c:1111
inode.c:1177
I think we need to fix these 5 places. In all other cases we check
IS_ERR(handle) and thus do not call ext4_orphan_del() in no-journal
mode.
next prev parent reply other threads:[~2012-09-15 22:28 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-14 21:06 ext4_orphan_del() sleeps in non-journal mode Anatol Pomozov
2012-09-15 2:15 ` Anatol Pomozov
2012-09-15 10:06 ` Dmitry Monakhov
2012-09-15 22:28 ` Anatol Pomozov [this message]
2012-09-15 22:51 ` Anatol Pomozov
2012-09-16 1:54 ` Theodore Ts'o
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=CAOMFOmWh3CVdREk5uyPCxwFQBTopiqainfGYxC6HijieM1rEWA@mail.gmail.com \
--to=anatol.pomozov@gmail.com \
--cc=dmonakhov@openvz.org \
--cc=linux-ext4@vger.kernel.org \
--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).