linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Andreas Dilger <adilger@dilger.ca>
Cc: Matthew Wilcox <willy@infradead.org>,
	Carlos Maiolino <cmaiolino@redhat.com>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	Christoph Hellwig <hch@lst.de>,
	darrick.wong@oracle.com
Subject: Re: Extending FIEMAP ioctl to report device id
Date: Tue, 12 Feb 2019 08:34:23 +1100	[thread overview]
Message-ID: <20190211213423.GF20493@dastard> (raw)
In-Reply-To: <E9F008F7-20B8-4E54-BCFC-B0019569AB4A@dilger.ca>

On Mon, Feb 11, 2019 at 01:52:25PM -0700, Andreas Dilger wrote:
> On Feb 11, 2019, at 8:23 AM, Matthew Wilcox <willy@infradead.org> wrote:
> > 
> > On Mon, Feb 11, 2019 at 10:43:06AM +0100, Carlos Maiolino wrote:
> >> - The general idea, is to provide a way for FIEMAP ioctls to return the device
> >>  id where each extent is physically located.
> > 
> > How does userspace get to use this information?  If I call fiemap() and
> > it tells me extent 1 is on device 0x12345678 and extent 2 is on device
> > 0x34567812, what can I do with that information?
> 
> For filesystems that may store a file on different devices, filefrag will
> print out which device the file is located on, so that users can see where
> the file is located.

I suspect that even for XFS, we'd return a special cookie to say "On
data device #X", "on real time device #Y" or "on subvolume #Z"
rather than an actual block device. That will have a lot more
meaning to the XFS filesystem utilities that might use this
information than a raw block device (which may or may not exist!)
because then they don't have to jump through hoops to convert it to
something meaningful....

> > Darrick said it was useful for _inside_ the kernel.  How is it useful
> > for outside the kernel?
> 
> In my experience, this can be very useful for users to understand how their
> file is allocated if there are performance or other issues with a particular
> device.

*nod*

And when you have allocation policies that select different
devices for different files it makes it possible to easily verify
the policy is working correctly.

https://patchwork.kernel.org/patch/10081163/


> Also, in some respects, it is _required_ for multi-device filesystems,
> since it makes it clear that block 123 on one device is not related to the same
> block number on a different device.

*nod*

On xfs, we have to do 'xfs_io -c stat -c "fiemap -v" <file>' to
get the RT dev attribute in addition to the extent list right now.
It would be good to get them in just the fiemap call.

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

      reply	other threads:[~2019-02-11 21:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-11  9:43 Extending FIEMAP ioctl to report device id Carlos Maiolino
2019-02-11 11:29 ` Nikolay Borisov
2019-02-11 14:56   ` Carlos Maiolino
2019-02-11 15:23 ` Matthew Wilcox
2019-02-11 20:52   ` Andreas Dilger
2019-02-11 21:34     ` Dave Chinner [this message]

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=20190211213423.GF20493@dastard \
    --to=david@fromorbit.com \
    --cc=adilger@dilger.ca \
    --cc=cmaiolino@redhat.com \
    --cc=darrick.wong@oracle.com \
    --cc=hch@lst.de \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=willy@infradead.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).