linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@redhat.com>
To: Jan Kara <jack@suse.cz>
Cc: ext4 development <linux-ext4@vger.kernel.org>
Subject: Re: [PATCH, RFC V2] ext4: flush delalloc blocks when space is low
Date: Thu, 05 Nov 2009 09:45:43 -0600	[thread overview]
Message-ID: <4AF2F327.7090402@redhat.com> (raw)
In-Reply-To: <20091105140913.GD17008@atrey.karlin.mff.cuni.cz>

Jan Kara wrote:
...

>> +	/* try a sync to flush delalloc space & free resvd metadata */
>> +	if (!ext4_has_free_blocks(EXT4_SB(sb), 1) && dirtyblocks) {
>> +		if (!ext4_journal_current_handle()) {
>> +			down_read(&sb->s_umount);
>> +			sync_inodes_sb(sb);
>> +			up_read(&sb->s_umount);
>   ext4_should_retry_alloc() is called quite deep from the filesystem. In
> particular we can hold i_mutex of some inodes etc. So I'd almost bet
> that taking s_umount sem here violates lock ranking in some code paths
> (an easy check would be to enable lockdep and stress the filesystem a
> bit).
>   Also calling sync_inodes_sb() with i_mutex held just seems as a bad
> thing to do although I don't see where it could deadlock and so it's
> probably just a matter of taste...

Well, to be honest I agree with you ;)  It does still feel like a hack.

>   If we start writeback from ext4_nonda_switch as you do below, I think
> that we should get decent results even without synchronous writeback in
> the allocation path (maybe we'd need to tweak a bit the logic in
> ext4_nonda_switch to provide more time for writeback thread to catchup).

I think starting writeback helps a lot, but it seems that in the end we
still need a synchronous attempt when we hit a real enocpc... after I
finish dealing with this corruption thing I'll come back and look at this.

Maybe we should put the writeback in for now, and worry about the
synchronous sync-up later?

Thanks for the review,

-Eric

> 								Honza

  reply	other threads:[~2009-11-05 15:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-20 20:59 [PATCH, RFC] ext4: flush delalloc blocks when space is low Eric Sandeen
2009-10-21  2:37 ` Eric Sandeen
2009-10-21 19:51 ` [PATCH, RFC V2] " Eric Sandeen
2009-11-05 14:09   ` Jan Kara
2009-11-05 15:45     ` Eric Sandeen [this message]
2009-11-05 16:05       ` Jan Kara

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=4AF2F327.7090402@redhat.com \
    --to=sandeen@redhat.com \
    --cc=jack@suse.cz \
    --cc=linux-ext4@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).