public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <jens.axboe@oracle.com>
To: Mikulas Patocka <mpatocka@redhat.com>
Cc: device-mapper development <dm-devel@redhat.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	ak@linux.intel.com, "MASON, CHRISTOPHER" <CHRIS.MASON@oracle.com>
Subject: Re: [dm-devel] Barriers still not passing on simple dm devices...
Date: Wed, 8 Apr 2009 16:06:29 +0200	[thread overview]
Message-ID: <20090408140629.GC5178@kernel.dk> (raw)
In-Reply-To: <Pine.LNX.4.64.0904080855340.28196@hs20-bc2-1.build.redhat.com>

On Wed, Apr 08 2009, Mikulas Patocka wrote:
> > > So I'm wondering why Linux developers designed a barrier interface with 
> > > complex specification, complex implementation and the interface is useless 
> > > to provide any request ordering and it's no better than q->issue_flush_fn 
> > > method or whatever was there beffore. Obviously, the whole barrier thing 
> > > was designed by a person who never used it in a filesystem.
> > 
> > That's not quite true, it was done in conjunction with file system
> > people.
> > ...
> > Nobody was interested in barriers when they were done. Nobody.
> 
> That's a contradiction :-)

So we have sunk to this level now, snip and edit citing?

> 
> Some times ago I wrote a piece of code that uses barriers for performance 
> enhancement 
> (http://artax.karlin.mff.cuni.cz/~mikulas/spadfs/download/spadfs-0.9.10.tar.gz).
> 
> The used trick is basically to take a lock that prevents filesystem-wide 
> updates, submit remaining writes (don't wait), submit the barrier that 
> causes transition to new generation (don't wait) and release the lock. The 
> lock is held for minimum time, no IO is waited for inside the lock. This 
> trick can't be done without barriers, without barriers you'd have to wait 
> inside the lock.
> 
> And the requirement for this code is that barriers are supported for the 
> whole lifetime of the filesystem --- which is what the Linux kernel 
> doesn't support! If barrier support is lost, consistency is damaged. 
> 
> With barriers, the code does [submit A, submit barrier B, submit C].
> If you don't have barriers, you must modify this sequence to: [submit A, 
> wait for A endio, submit B, wait for B endio, submit C]
> 
> --- and now you are getting the point why failing barriers can't ever work 
> --- by the time request B completes, you find out that the device lost 
> barrier support and you realize that you should have inserted the waits in 
> the past --- but it's too late, there is no way to insert them 
> retroactively.
> 
> AFAIK this is the only piece of code that uses barriers to improve 
> performance. All the other filesystems use barriers just as a way to flush 
> cache and don't overlap barrier request with any other requests.
> 
> So there are two ways:
> 
> - either support only what all in-kernel filesystems do. Using barrier 
> reqiests to flush hw cache. You can remove support for barriers with data, 
> leave just zero-data barrier, you can remove ordering restrictions. 
> In-kernel filesystems never overlap barrier with another metadata request 
> (see above why such overlap can't work), so you can freely reorder 
> zero-data barriers and simplify the code ... because all the requests that 
> could be submitted in paralel with the barrier are either for different 
> partition or non-metadata requests to the same partition from prefetch, 
> direct io or so.
> 
> - or you can allow barriers to be used for purposes as I did. And then, 
> there must be clean indicator "this device supports barriers 
> *and*will*support*them*in*the*future*". Currently there is no such 
> indicator.

I'm about to leave, so I wont comment on the above. But the below is
basically what we pretend right now, and I think that is perfectly fine.
If you go and reconfigure your device and it suddenly doesn't support
barriers anymore, call the doctor and tell him that your foot hurts when
you slam it in the door. Don't do that, it's pretty simple. We already
agreed to kill the -EOPNOTSUPP and just pretend it always works, with a
notifier that we MAY not be safe. Not much point in harping the same
thing over and over again.

-- 
Jens Axboe


  reply	other threads:[~2009-04-08 14:07 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-23 19:04 Barriers still not passing on simple dm devices Eric Sandeen
2009-03-23 19:10 ` Eric Sandeen
2009-03-24 14:02 ` [dm-devel] " Mikulas Patocka
2009-03-24 14:05   ` Jens Axboe
2009-03-24 14:26     ` Mikulas Patocka
2009-03-24 14:30       ` Jens Axboe
2009-03-24 14:45         ` Mikulas Patocka
2009-03-24 15:05           ` Jens Axboe
2009-03-25 15:15             ` Mikulas Patocka
2009-03-25 15:27               ` Jens Axboe
2009-03-25 22:39                 ` Mikulas Patocka
2009-03-26  8:42                   ` Jens Axboe
2009-03-31  3:39                     ` Mikulas Patocka
2009-03-31 10:49                       ` Jens Axboe
2009-04-02 23:40                         ` Mikulas Patocka
2009-04-03  8:11                           ` Jens Axboe
2009-04-04 15:20                             ` Ric Wheeler
2009-04-05  1:28                               ` Theodore Tso
2009-04-05 11:54                                 ` Ric Wheeler
2009-04-06  1:14                                   ` Lee Revell
2009-04-06  1:24                                     ` Ric Wheeler
2009-04-08 12:44                                     ` Mikulas Patocka
2009-04-08 15:16                                       ` Henrique de Moraes Holschuh
2009-04-09  4:22                                     ` Eric Sandeen
2009-04-08 12:36                                 ` Mikulas Patocka
2009-04-08 12:54                               ` Mikulas Patocka
2009-04-09 10:48                                 ` Ric Wheeler
2009-04-08 13:37                             ` Mikulas Patocka
2009-04-08 14:06                               ` Jens Axboe [this message]
2009-04-08 23:44                               ` Dave Chinner
2009-04-09  1:27                               ` Chris Mason
2009-04-09 10:28                                 ` Alasdair G Kergon
2009-03-26 12:55                   ` Chris Mason
     [not found] <ciXHh-39c-37@gated-at.bofh.it>
     [not found] ` <cjfuL-6vJ-43@gated-at.bofh.it>
     [not found]   ` <cjfEl-6J2-45@gated-at.bofh.it>
     [not found]     ` <cjfNX-6Wh-27@gated-at.bofh.it>
2009-03-26 13:05       ` Bodo Eggert
     [not found]       ` <cjfXx-78D-9@gated-at.bofh.it>
     [not found]         ` <cjg7h-7lM-29@gated-at.bofh.it>
     [not found]           ` <cjgqC-80G-21@gated-at.bofh.it>
     [not found]             ` <cjD3I-22U-7@gated-at.bofh.it>
     [not found]               ` <cjDdE-2g3-31@gated-at.bofh.it>
     [not found]                 ` <cjJVv-4vp-13@gated-at.bofh.it>
     [not found]                   ` <cjXlS-uM-1@gated-at.bofh.it>
2009-03-26 15:26                     ` Bodo Eggert

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=20090408140629.GC5178@kernel.dk \
    --to=jens.axboe@oracle.com \
    --cc=CHRIS.MASON@oracle.com \
    --cc=ak@linux.intel.com \
    --cc=dm-devel@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpatocka@redhat.com \
    /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