All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@suse.de>
To: Ian Pratt <m+Ian.Pratt@cl.cam.ac.uk>
Cc: xen-devel@lists.xensource.com
Subject: Re: [patch] Add support for barriers to blk{back,front} drivers.
Date: Mon, 30 Oct 2006 09:21:23 +0100	[thread overview]
Message-ID: <4545B603.5030909@suse.de> (raw)
In-Reply-To: <8A87A9A84C201449A0C56B728ACF491E92FC@liverpoolst.ad.cl.cam.ac.uk>

Ian Pratt wrote:
> What's the current logic for determining whether the backend advertises
> barrier support, and whether the frontend chooses to use it?

Backend:  "feature-barrier" node in xenstore.  It means the backend
understands the new BLKIF_OP_WRITE_BARRIER operation.  The node can be
either 1 or 0, depending on whenever the underlying block device
actually supports barriers or not.  Initially it is '1' unconditionally,
the only way to figure whenever the underlying block device supports
barriers is to actually submit one and see if it works.  If a barrier
write fails with -EOPNOTSUPP the backend changes the node to '0'.

The error is also propagated to the frontend so it knows barriers don't
work (and can in turn propagate that up to the filesystem driver), the
new BLKIF_RSP_EOPNOTSUPP error code is needed for that.

Frontend:  It simply submits barrier writes ;)  The backend takes care
that the new error code is used for barrier writes only (it should never
ever happen for normal writes anyway), so old frontends which don't know
about barriers (and thus never submit barrier write requests) should
never ever see the new error code.

> I guess the backend could always advertise it providing it did the
> appropriate queue drain whenever it encoutered one if the underlying
> block device didn't support barriers.

The filesystems do some best-effort handling when barrier are not
available anyway (which works ok for the non-write caching case).  IMO
the best way to handle non-working barriers is to simply let the
filesystems know, which is exactly what the patch implements:  It passes
through the capabilities of the underlying block device to the domU
instead of trying to fake something which isn't there.

cheers,
  Gerd

-- 
Gerd Hoffmann <kraxel@suse.de>
http://www.suse.de/~kraxel/julika-dora.jpeg

  reply	other threads:[~2006-10-30  8:21 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-27 13:46 [patch] Add support for barriers to blk{back, front} drivers Ian Pratt
2006-10-30  8:21 ` Gerd Hoffmann [this message]
  -- strict thread matches above, loose matches on Subject: below --
2006-10-30 12:15 Ian Pratt
2006-10-30 12:43 ` [patch] Add support for barriers to blk{back,front} drivers Gerd Hoffmann
2006-11-08 15:38   ` Gerd Hoffmann
2006-11-09  1:04     ` [patch] Add support for barriers to blk{back, front} drivers Ian Pratt
2006-11-09  1:15       ` John Levon
2006-11-09  9:00     ` [patch] Add support for barriers to blk{back,front} drivers Keir Fraser
2006-11-09 12:48       ` Gerd Hoffmann
2006-11-09 13:47         ` Keir Fraser
2006-11-09 14:15           ` Gerd Hoffmann
2006-10-23 11:42 [patch] Add support for barriers to blk{back, front} drivers Ian Pratt
2006-10-23 12:27 ` [patch] Add support for barriers to blk{back,front} drivers Gerd Hoffmann
2006-10-25 16:52   ` Gerd Hoffmann
2006-10-20  8:38 [patch] Add support for barriers to blk{back, front} drivers kraxel
2006-10-20 20:35 ` Ian Pratt

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=4545B603.5030909@suse.de \
    --to=kraxel@suse.de \
    --cc=m+Ian.Pratt@cl.cam.ac.uk \
    --cc=xen-devel@lists.xensource.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 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.