All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Zheng Liu <gnehzuil.liu@gmail.com>
Cc: Jan Kara <jack@suse.cz>, Theodore Ts'o <tytso@mit.edu>,
	Dmitry Monakhov <dmonakhov@openvz.org>,
	linux-ext4@vger.kernel.org
Subject: Re: Uninitialized extent races
Date: Mon, 31 Dec 2012 17:44:46 +0100	[thread overview]
Message-ID: <20121231164446.GJ7564@quack.suse.cz> (raw)
In-Reply-To: <20121231163146.GA6795@gmail.com>

On Tue 01-01-13 00:31:46, Zheng Liu wrote:
> On Mon, Dec 31, 2012 at 09:32:21AM +0100, Jan Kara wrote:
> > On Mon 24-12-12 19:17:45, Zheng Liu wrote:
> > > On Fri, Dec 21, 2012 at 01:02:43PM -0500, Theodore Ts'o wrote:
> > > > On Fri, Dec 21, 2012 at 05:19:29PM +0100, Jan Kara wrote:
> > > > >   No, I'm speaking about merging currently uninitialized extents. I.e.
> > > > > suppose someone does the following on a filesystem with dioread_nolock so
> > > > > that writeback happens via unwritten extents:
> > > > >   fd = open("file", O_RDWR);
> > > > >   pwrite(fd, buf, 4096, 0);
> > > > > 					flusher thread starts writing
> > > > > 					we create uninitialized extent for
> > > > > 					  range 0-4096
> > > > >   fallocate(fd, 0, 4096, 4096);
> > > > >     - we merge extents and now have just 1 uninitialized extent for range
> > > > >       0-8192
> > > > > 					ext4_convert_unwritten_extents() now
> > > > > 					  has to split the extent to finish
> > > > > 					  the IO.
> > > > 
> > > > Ah, I see.  Disabling the the merging that might take place as a
> > > > result of the fallocate.  Yes, I agree that's a completely sane thing
> > > > to do.
> > > > 
> > > > The alternate approach would be to add a flag in the extent status
> > > > tree indicating that an unwritten conversion is pending, but that
> > > > would add more complexity.
> > > 
> > > Sorry for delay reply.  Indeed we could add a flag in extent status tree
> > > to indicate an pending unwritten extent, and I believe that it can bring
> > > us some benefits.  But I wonder whether this case often happens.  Do we
> > > have some real workloads?
> >   It doesn't happen often but it *can* happen. Thus you have to implement
> > a code which handles the case. I don't think bit in extent status tree is
> > really necessary. Just disabling merging of uninitialized extents is
> > simple. If we see there are some real workloads which have problems with
> > it, we can resort to a more complex solution using extent tree...
> 
> Thanks for your explanation.  I don't know whether or not you have
> generated a patch for this problem.  I am willing to make it in a proper
> time.  If you have begun to generate it, please let me know. :-)
  Disabling the merging is trivial and I have a patch for that. Just making
all other changes so that Christoph's DIO patches can work is non-trivial.
I already have several smaller fixes and cleanups to make things easier but
writeback path still has locking issues - I have a solution in mind but
whether it will be needed or not depends on what I asked in the other email
- whether extent status tree can really be used or not...

								Honza
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

  reply	other threads:[~2012-12-31 16:44 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-21  1:25 Uninitialized extent races Jan Kara
2012-12-21  3:11 ` Theodore Ts'o
2012-12-21 16:19   ` Jan Kara
2012-12-21 18:02     ` Theodore Ts'o
2012-12-21 22:49       ` Jan Kara
2012-12-21 23:03         ` Theodore Ts'o
2012-12-24 11:17       ` Zheng Liu
2012-12-31  8:32         ` Jan Kara
2012-12-31 16:31           ` Zheng Liu
2012-12-31 16:44             ` Jan Kara [this message]
2013-01-01  4:49               ` Zheng Liu
2012-12-21 12:34 ` Dmitry Monakhov

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=20121231164446.GJ7564@quack.suse.cz \
    --to=jack@suse.cz \
    --cc=dmonakhov@openvz.org \
    --cc=gnehzuil.liu@gmail.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.