linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dave Chinner <david-FqsqvQoI3Ljby3iVrkZq2A@public.gmane.org>
To: David Howells <dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Cc: linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	samba-technical-w/Ol4Ecudpl8XjKLYN78aQ@public.gmane.org,
	linux-ext4-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	wine-devel-5vRYHf7vrtgdnm+yROfE0A@public.gmane.org,
	kfm-devel-RoXCvvDuEio@public.gmane.org,
	nautilus-list-rDKQcyrBJuzYtjvyW6yDsg@public.gmane.org,
	linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	libc-alpha-9JcytcrH/bA+uJoB2kUjGw@public.gmane.org
Subject: Re: [PATCH 0/6] Extended file stat system call
Date: Fri, 27 Apr 2012 23:13:06 +1000	[thread overview]
Message-ID: <20120427131306.GG9541@dastard> (raw)
In-Reply-To: <4111.1335519545-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>

On Fri, Apr 27, 2012 at 10:39:05AM +0100, David Howells wrote:
> Dave Chinner <david-FqsqvQoI3Ljby3iVrkZq2A@public.gmane.org> wrote:
> 
> > If we are adding per-inode flags, then what do we do with filesystem specific
> > flags? e.g. XFS has quite a number of per-inode flags that don't align with
> > any other filesystem (e.g. filestream allocator, real time file, behaviour
> > inheritence flags, etc), but may be useful to retrieve in such a call. We
> > currently have an ioctl to get that information from each inode. Have you
> > thought about how to handle such flags?
> 
> I haven't looked at XFS with regard to xstat as yet, so I'm not sure exactly
> which flags you're talking about.  The question, though, is what will actually
> make use of these flags?  Will it just be XFS tools or are they something that
> a GUI might make use of?

Have a look at fs/xfs/xfs_dinode.h. There's a bunch of flags defined
at the bottom of the file.

Stuff like the "nodefrag", "nodump", and "prealloc" bits seem fairly
generic - they are for indicating that files are to be avoided for defrag or
backup purposes, the prealloc bit indicates that fallocate has been
used to reserve space on the inode (finding files that space can be
punched out of safely), and so on.

Currently these things are queried and manipulated by ioctls
(XFS_IOC_FSX[GS]ETATTR) along with extent size hints, project
quotas, etc. but I think there's some wider use for many of the
flags, which is why I was asking is there's any thought to this sort
of flag being exposed by the VFS.

Historically the flags exposed by the VFS are those used by extN - I
see little reason why we should favour one filesystem's flags over
any others in an extended stat interface if they are generically
useful....

> Either you can add some of them to the ioc flags (which may be impractical, I
> grant you) or we'd have to add an arbitrary fs-type specific field and specify
> the host fs (the provision of which might not be a bad idea in and of itself)
> to tell userspace how to interpret them.

Well, that's the complexity, isn't it. I have no good answer to
that...

> > Along the same lines, filesytsems can have different allocation constraints
> > to IO the filesystem block size - ext4 with it's bigalloc hack, XFS with it's
> > per-inode extent size hints and the realtime device, etc. Then there's
> > optimal IO characteristics (e.g. geometery hints like stripe unit/stripe
> > width for the allocation policy of that given file) that applications could
> > use if they were present rather than having to expose them through ioctls
> > that nobody even knows about...
> 
> Yeah...  Not representable by one number.  You'd have to unset a flag to say
> you were providing this information.
> 
> However, providing a whole bunch of hints about I/O characteristics is probably
> beyond this syscall - especially if it isn't constant over the length of a
> file.  That's specialist knowledge that most applications don't need to know.
> Having a generic way to retrieve it, though, may be a good idea.

We're continually talking about applications giving us usage hints
on what IO they are going to do so the storage can optimise the IO.
IO is still a GIGO problem, though, and the idea of geometry hints is to enable
us to tell the application to do well formed IO. i.e. less garbage.

XFS has ioctls to expose filesystem geometry, optimal IO sizes, the
alignment limits for direct IO, etc, and they are very useful to
applications that care about high performance IO. A lot of this can
be distilled down to a simple set of geometries, and generally
speaking they don't change mid way through a file....

> OTOH, there's plenty of uncommitted space, so if we can condense the hints down
> to something small, we could perhaps add it later - but from your paragraph
> above, it doesn't sound like it'll be small.

Allocation block size, minimum sane IO size (to avoid page cache RMW
cycles or DIO zeroing), minimum prefered IO size (e.g. stripe unit),
optimal IO size for bandwidth (e.g. stripe width). I don't think
there's much more than that which will be really usable by
applications.

> > Perhaps also exposing the project ID for quota purposes, like we do UID and
> > GID. That way we wouldn't need a filesystem specific ioctl to read it....
> 
> Is this an XFS only thing?  If so, can it be generalised?

Right now it is, but there's ben patches in the past to introduce
project quotas to ext4. That didn't go far because it was done in a
way that was semantically different to XFS (for no reason that I
could understand) and nobody wanted two different sets of semantics
for the "same" feature.  The most common use of project quotas is to
implement sub-tree quotas, which is probably of more interest to
btrfs folks as it is an exact match for per-subvolume quotas.

So, yes, I do see it as something generically useful - it's a
feature that a lot of people use XFS specifically for....

Cheers,

Dave.
-- 
Dave Chinner
david-FqsqvQoI3Ljby3iVrkZq2A@public.gmane.org

  parent reply	other threads:[~2012-04-27 13:13 UTC|newest]

Thread overview: 90+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-19 14:05 [PATCH 0/6] Extended file stat system call David Howells
2012-04-19 14:06 ` [PATCH 3/6] xstat: AFS: Return extended attributes David Howells
2012-04-19 14:06 ` [PATCH 4/6] xstat: NFS: " David Howells
     [not found]   ` <20120419140653.17272.95035.stgit-S6HVgzuS8uM4Awkfq6JHfwNdhmdF6hFW@public.gmane.org>
2012-04-19 14:35     ` Myklebust, Trond
2012-04-26 13:52   ` David Howells
2012-04-19 14:07 ` [PATCH 5/6] xstat: CIFS: " David Howells
     [not found]   ` <20120419140706.17272.72290.stgit-S6HVgzuS8uM4Awkfq6JHfwNdhmdF6hFW@public.gmane.org>
2012-04-19 15:19     ` Steve French
2012-04-19 16:32 ` [PATCH 0/6] Extended file stat system call Roland McGrath
2012-04-19 21:51   ` Paul Eggert
2012-04-19 23:05     ` Roland McGrath
2012-04-26 14:16     ` David Howells
     [not found]       ` <20173.1335449760-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2012-04-26 18:22         ` Roland McGrath
     [not found]   ` <4F9088D6.9020203-764C0pRuGfqVc3sceRu5cw@public.gmane.org>
2012-04-26 14:04     ` David Howells
     [not found]       ` <19638.1335449047-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2012-04-26 18:24         ` Roland McGrath
     [not found] ` <20120419140558.17272.74360.stgit-S6HVgzuS8uM4Awkfq6JHfwNdhmdF6hFW@public.gmane.org>
2012-04-19 14:06   ` [PATCH 1/6] xstat: Add a pair of system calls to make extended file stats available David Howells
2012-04-19 23:36     ` Andreas Dilger
     [not found]     ` <20120419140612.17272.57774.stgit-S6HVgzuS8uM4Awkfq6JHfwNdhmdF6hFW@public.gmane.org>
2012-04-24 21:29       ` J. Bruce Fields
     [not found]         ` <20120424212911.GA26073-uC3wQj2KruNg9hUCZPvPmw@public.gmane.org>
2012-04-24 22:08           ` Steve French
2012-04-25 14:44           ` Andreas Dilger
2012-04-26 13:45         ` David Howells
     [not found]           ` <18765.1335447954-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2012-04-26 14:28             ` J. Bruce Fields
2012-04-26 17:06               ` Steve French
2012-04-26 13:32     ` David Howells
     [not found]       ` <18195.1335447156-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2012-04-27  0:51         ` Dave Chinner
2012-04-27  3:11           ` Andreas Dilger
2012-04-26 13:40     ` David Howells
     [not found]       ` <18533.1335447617-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2012-04-26 14:23         ` J. Bruce Fields
2012-04-30 16:27       ` Ben Hutchings
2012-04-30 20:15         ` David Howells
2012-04-30 20:30           ` J. Bruce Fields
2012-04-30 23:31             ` Ben Hutchings
2012-04-19 14:06   ` [PATCH 2/6] xstat: Ext4: Return extended attributes David Howells
     [not found]     ` <20120419140625.17272.23303.stgit-S6HVgzuS8uM4Awkfq6JHfwNdhmdF6hFW@public.gmane.org>
2012-04-19 16:03       ` Steve French
2012-04-26 13:47     ` David Howells
2012-04-26 17:00       ` Steve French
2012-04-19 14:07   ` [PATCH 6/6] xstat: eCryptFS: " David Howells
2012-04-19 17:11   ` [PATCH 0/6] Extended file stat system call Steve French
2012-04-27  1:06   ` Dave Chinner
2012-04-27  3:22     ` Andreas Dilger
     [not found]       ` <ED5B8F1B-6C99-4516-85FA-A767E94B635F-m1MBpc4rdrD3fQ9qLvQP4Q@public.gmane.org>
2012-04-28  0:38         ` Dave Chinner
2012-04-28  0:54           ` Steve French
2012-05-08 20:19   ` Extended file stat: Splitting file- and fs-specific info? David Howells
2012-05-08 21:13     ` Myklebust, Trond
     [not found]     ` <16281.1336508382-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2012-05-09  0:24       ` Dave Chinner
2012-05-09  1:09         ` J. Bruce Fields
2012-05-09  4:25           ` Dave Chinner
2012-05-09 11:14             ` J. Bruce Fields
2012-05-09  1:16         ` Andreas Dilger
2012-05-10  9:23         ` David Howells
     [not found]           ` <14477.1336641794-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2012-05-10 16:05             ` Andreas Dilger
2012-05-10 17:10             ` Roland McGrath
2012-05-11  8:54               ` Andreas Dilger
2012-05-09  9:21     ` David Howells
     [not found]       ` <20170.1336555274-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2012-05-09 11:19         ` Christoph Hellwig
     [not found]           ` <20120509111958.GA11345-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2012-05-09 11:55             ` Bernd Schubert
     [not found]               ` <4FAA5B24.1020306-mPn0NPGs4xGatNDF+KUbs4QuADTiUCJX@public.gmane.org>
2012-05-09 12:05                 ` Christoph Hellwig
     [not found]                   ` <20120509120544.GA17535-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2012-05-09 12:25                     ` Bernd Schubert
2012-05-09 13:51                       ` Andreas Dilger
2012-05-09 14:12                         ` Bernd Schubert
2012-05-10  9:14     ` David Howells
2012-04-19 23:29 ` [PATCH 0/6] Extended file stat system call Andreas Dilger
2012-04-26 13:54 ` David Howells
     [not found]   ` <19184.1335448455-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2012-04-26 18:25     ` Roland McGrath
2012-04-27 23:54       ` Paul Eggert
     [not found]   ` <20120426182524.E5ADF2C0EC-j1d2VQoJOwwHfwO+Tb3JRVaTQe2KTcn/@public.gmane.org>
2012-04-26 21:54     ` David Howells
     [not found]       ` <9931.1335477281-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2012-04-26 22:02         ` Roland McGrath
2012-04-26 22:21           ` Nix
2012-04-26 14:25 ` David Howells
2012-04-26 14:54   ` Steve French
     [not found]     ` <CAH2r5mv1Lijdwk5zsQwYJr4Etb6fhrRyNXm-iFCQX+HecboGrQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-04-26 15:25       ` Myklebust, Trond
2012-04-26 16:56         ` Steve French
     [not found]           ` <CAH2r5mt5af-_hxBRKK72iD5Gr99bo91ec78Rov8EGVEx8=21mA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-04-26 17:00             ` Myklebust, Trond
2012-04-26 17:03               ` Steve French
     [not found]                 ` <CAH2r5mvmCfLrxRHje6Wx5X84zxPEHwRMUJGsjvWBujMu7w841w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-04-26 17:06                   ` Myklebust, Trond
     [not found]                     ` <1335460011.9701.30.camel-SyLVLa/KEI9HwK5hSS5vWB2eb7JE58TQ@public.gmane.org>
2012-04-26 17:09                       ` Steve French
     [not found]                         ` <CAH2r5muXk+frkFz9X523Ny=RMwJGeqOPH75G1ToNa5QoMo5SkQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-04-26 17:10                           ` Steve French
2012-04-26 21:57                       ` David Howells
     [not found]                         ` <10104.1335477476-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2012-04-26 22:05                           ` Roland McGrath
     [not found]                             ` <20120426220552.D98D62C0D3-j1d2VQoJOwwHfwO+Tb3JRVaTQe2KTcn/@public.gmane.org>
2012-04-27  0:33                               ` Myklebust, Trond
2012-04-27  0:30                           ` Myklebust, Trond
2012-04-26 15:52   ` David Howells
2012-04-27  0:29     ` Andreas Dilger
     [not found]     ` <3F302713-B675-4BAA-B2B7-235E03C5975F-m1MBpc4rdrD3fQ9qLvQP4Q@public.gmane.org>
2012-04-27  9:19       ` David Howells
2012-04-27  9:39 ` David Howells
     [not found]   ` <4111.1335519545-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2012-04-27 13:13     ` Dave Chinner [this message]
2012-04-27 15:10       ` J. Bruce Fields
     [not found]         ` <20120427151057.GA16580-uC3wQj2KruNg9hUCZPvPmw@public.gmane.org>
2012-04-27 16:32           ` Steve French
2012-04-27 19:31       ` Andreas Dilger
2012-04-28  0:58         ` Dave Chinner
2012-05-10  9:51         ` David Howells

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=20120427131306.GG9541@dastard \
    --to=david-fqsqvqoi3ljby3ivrkzq2a@public.gmane.org \
    --cc=dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=kfm-devel-RoXCvvDuEio@public.gmane.org \
    --cc=libc-alpha-9JcytcrH/bA+uJoB2kUjGw@public.gmane.org \
    --cc=linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-ext4-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=nautilus-list-rDKQcyrBJuzYtjvyW6yDsg@public.gmane.org \
    --cc=samba-technical-w/Ol4Ecudpl8XjKLYN78aQ@public.gmane.org \
    --cc=wine-devel-5vRYHf7vrtgdnm+yROfE0A@public.gmane.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).