linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: "Vyacheslav Dubeyko" <slava@dubeyko.com>,
	"Jaegeuk Kim" <jaegeuk.kim@gmail.com>,
	김재극 <jaegeuk.kim@samsung.com>,
	viro@zeniv.linux.org.uk, "'Theodore Ts'o'" <tytso@mit.edu>,
	gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org,
	chur.lee@samsung.com, cm224.lee@samsung.com,
	jooyoung.hwang@samsung.com
Subject: Re: [PATCH 11/16] f2fs: add inode operations for special inodes
Date: Tue, 16 Oct 2012 09:34:09 +1100	[thread overview]
Message-ID: <20121015223409.GE2739@dastard> (raw)
In-Reply-To: <201210141519.37752.arnd@arndb.de>

On Sun, Oct 14, 2012 at 03:19:37PM +0000, Arnd Bergmann wrote:
> On Sunday 14 October 2012, Vyacheslav Dubeyko wrote: 
> > On Oct 14, 2012, at 11:09 AM, Jaegeuk Kim wrote:
> > > 2012-10-14 (일), 02:21 +0400, Vyacheslav Dubeyko:
> > Extended attributes are more flexible way, from my point of view. The xattr gives
> > possibility to make hint to filesystem at any time and without any dependencies with
> > application's functional opportunities. Documented way of using such extended attributes
> > gives to user flexible way of manipulation of filesystem behavior (but I remember that
> > you don't believe in an user :-)).
> > 
> > So, I think that fadvise() and extended attributes can be complementary solutions.
> 
> Right. Another option is to have ext4 style attributes, see 
> http://linux.die.net/man/1/chattr

Xattrs are much prefered to more "ext4 style" flags because xattrs
are filesystem independent. Indeed, some filesystems can't store any
new "ext4 style" flags without a change of disk format or
internally mapping them to an xattr. So really, xattrs are the best
way forward for such hints.

> Unlike extended attributes, there is a limited number of those,
> and they can only be boolean flags, but that might be enough for
> this particular use case.

A boolean is not sufficient for access policy hints. An extensible
xattr format is probably the best approach to take here, so that we
can easily introduce new access policy hints as functionality is
required. Indeed, an extensible xattr could start with just a
hot/cold boolean, and grow from there....

> The main reason I can see against extended attributes is that they are not stored
> very efficiently in f2fs, unless a lot of work is put into coming up with a good
> implementation. A single flags bit can trivially be added to the inode in
> comparison (if it's not there already).

That's a deficiency that should be corrected, then, because xattrs
are very common these days.

And given that stuff like access frequency tracking is being
implemented at the VFS level, access policy hints should also be VFS
functionality. A bad filesystem implementation should not dictate
the interface for generically useful functionality....

> > Anyway, hardcoding or saving in filesystem list of file extensions is a nasty way. It
> > can be not safe or hardly understandable by users the way of reconfiguration filesystem 
> > by means of tunefs or debugfs with the purpose of file extensions addition in such 
> > "black-box" as TV or smartphones, from my point of view.
> 
> It is only a performance hint though, so it is not a correctness issue the
> file system gets it wrong. In order to do efficient garbage collection, a log
> structured file system should take all the information it can get about the
> expected life of data it writes. I agree that the list, even in the form of
> mkfs time settings, is not a clean abstraction, but in the place of an Android
> phone manufacturer I would still enable it if it promises a significant
> performance advantage over not using it. I guess it would be nice if this
> could be overridden in some form, e.g. using an ioctl on the file as ext4 does.

An xattr on the root inode that holds a list like this is something
that could be set at mkfs time, but then also updated easily by new
software packages that are installed...

> We should also take the kinds of access we have seen on a file into account.

Yes, but it should be done at the VFS level, not in the filesystem
itself. Integrated into the current hot inode/range tracking that is
being worked on right now, I'd suggest.

IOWs, these access policy issues are not unique to F2FS or it's use
case. Anything to do with access hints, policy, tracking, file
classification, etc that can influence data locality, reclaim,
migration, etc need to be dealt with at the VFS, independently of a
specific filesystem. Filesystems can make use of that information
how they please (whether in the kernel or via userspace tools), but
having filesystem specific interfaces and implementations of the
same functionality is extremely wasteful. Let's do it once, and do
it right the first time. ;)

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

  parent reply	other threads:[~2012-10-15 22:34 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-05 12:03 [PATCH 11/16] f2fs: add inode operations for special inodes 김재극
2012-10-06 18:59 ` Al Viro
2012-10-13 20:52 ` Arnd Bergmann
2012-10-13 21:57   ` Vyacheslav Dubeyko
2012-10-13 22:21   ` Vyacheslav Dubeyko
2012-10-14  7:09     ` Jaegeuk Kim
2012-10-14 12:06       ` Vyacheslav Dubeyko
2012-10-14 15:19         ` Arnd Bergmann
     [not found]           ` <CAN863PuYDSSFmaKtsVvdX4aFpS8hAMvFmhJpsky0x=ySn0QsqQ@mail.gmail.com>
2012-10-15 14:05             ` Arnd Bergmann
2012-10-16  2:29               ` Jaegeuk Kim
2012-10-16 16:14                 ` Arnd Bergmann
2012-10-16 21:43                   ` Jaegeuk Kim
2012-10-17  3:44                     ` Jaegeuk Kim
2012-10-17 12:22                       ` Arnd Bergmann
2012-10-17  8:35                     ` Arnd Bergmann
2012-10-15 22:34           ` Dave Chinner [this message]
2012-10-16  2:00             ` Jaegeuk Kim
2012-10-16 11:38               ` Arnd Bergmann
2012-10-16 20:38                 ` Jaegeuk Kim
2012-10-17 12:25                   ` Arnd Bergmann
2012-10-18  5:37                     ` Jaegeuk Kim
2012-10-16 20:44                 ` Dave Chinner
2012-10-16 22:30                   ` Jaegeuk Kim
2012-10-16 22:54                     ` Dave Chinner
2012-10-17  3:25                       ` Jaegeuk Kim
2012-10-17 12:50                     ` Arnd Bergmann
2012-10-24  2:49                       ` Dave Chinner
2012-10-24 12:02                         ` Arnd Bergmann
2012-10-14  6:51   ` Jaegeuk Kim

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=20121015223409.GE2739@dastard \
    --to=david@fromorbit.com \
    --cc=arnd@arndb.de \
    --cc=chur.lee@samsung.com \
    --cc=cm224.lee@samsung.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jaegeuk.kim@gmail.com \
    --cc=jaegeuk.kim@samsung.com \
    --cc=jooyoung.hwang@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=slava@dubeyko.com \
    --cc=tytso@mit.edu \
    --cc=viro@zeniv.linux.org.uk \
    /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).