All of lore.kernel.org
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: James Dingwall <james.dingwall@zynstra.com>
Cc: Ben Myers <bpm@sgi.com>, xfs@oss.sgi.com
Subject: Re: Cleancache support in XFS
Date: Wed, 22 May 2013 15:28:34 -0400	[thread overview]
Message-ID: <20130522192834.GD10617@phenom.dumpdata.com> (raw)
In-Reply-To: <518222D3.3080109@zynstra.com>

On Thu, May 02, 2013 at 09:24:51AM +0100, James Dingwall wrote:
> Dave Chinner wrote:
> >On Wed, May 01, 2013 at 11:20:44AM -0500, Ben Myers wrote:
> >>Hi James,

Hey folks,
I am walking through my vacation-emails-mbox.

> >>
> >>On Wed, May 01, 2013 at 01:39:09PM +0100, James Dingwall wrote:
> >>>In reference to: http://oss.sgi.com/archives/xfs/2012-05/msg00046.html
> >>>
> >>>$ grep -r cleancache fs/xfs
> >>>on the 3.9 kernel source suggests that no patch was submitted to
> >>>enable cleancache for the XFS filesystem.  Since it was suggested
> >>>that this could be a one liner I've had a go and my first effort is
> >>>inline below.  While this seems to compile OK I have no experience
> >>>in filesystems so I would appreciate it if anyone can point out that
> >>>it is obviously wrong and likely to eat my data before I try booting
> >>>the kernel.
> >>>
> >>>If it seems a reasonable attempt what would be the best way to check
> >>>that it isn't doing nasty things?
> >>Hrm.. Looks like there is a doc in Documentation/vm/cleancache.txt which
> >>includes a list of attributes the filesystem needs to have to work properly
> >>with cleancache.
> >So, those points are:
> I had started to look at these too but I feel very out of my depth!
> I had similar conclusions to what Dave wrote but I don't think my
> thoughts should carry very much (any) weight.  Anyway I gambled and
> booted my xen domU with this patch and so far so good...  xen top
> shows that tmem is now being used where previously it wasn't.  I'll
> try running the xfstests at the weekend after a couple more days up
> time to see what happens.

And how did it go?
> >
> >| Some points for a filesystem to consider:
> >|
> >| - The FS should be block-device-based (e.g. a ram-based FS such
> >|  as tmpfs should not enable cleancache)
> >
> >OK.
> >
> >|- To ensure coherency/correctness, the FS must ensure that all
> >|  file removal or truncation operations either go through VFS or
> >|  add hooks to do the equivalent cleancache "invalidate" operations
> >
> >There be dragons - do all the XFS ioctls do the right thing?
> vfs_unlink() calls *dir->i_op->unlink, in xfs_iops.c for S_IFDIR there is:
> 
> if (xfs_sb_version_hasasciici(&XFS_M(inode->i_sb)->m_sb))
>         inode->i_op = &xfs_dir_ci_inode_operations;
> else
>         inode->i_op = &xfs_dir_inode_operations;
> 
> where .unlink in xfs_dir_inode_operations is xfs_vn_unlink() in either
> condition.
> 
> I can't work out how to follow the vfs_truncate() in to the filesystem
> code and perhaps there are other paths that would lead to file removal.

Did that ever get worked out or are you waiting for a response on that?

> 
> >
> >|- To ensure coherency/correctness, either inode numbers must
> >|  be unique across the lifetime of the on-disk file OR the
> >|  FS must provide an "encode_fh" function.
> >
> >Ok.
> >
> >|- The FS must call the VFS superblock alloc and deactivate routines
> >|  or add hooks to do the equivalent cleancache calls done there.
> >
> >OK.
> >
> >|- To maximize performance, all pages fetched from the FS should
> >|  go through the do_mpag_readpage routine or the FS should add
> >|  hooks to do the equivalent (cf. btrfs)
> >
> >xfs uses mpage_readpages() so should be fine.

OK.
> I think there is a cleancache documentation bug since no other fs
> calls do_mpage_readpage().

The mpage_readpage goes "through the do_mpage(sic)_readpage" routine.
There is a bug in that it says 'mpa' instead of 'mpage'.

> >
> >|- Currently, the FS blocksize must be the same as PAGESIZE.  This
> >|  is not an architectural restriction, but no backends currently
> >|  support anything different.
> >
> >Which means that we need hooks in the mount path to determine if
> >this is the case or not. I note that neither ext3/ext4 do this check
> >so I can't determine why this restriction is mentioned, and I'm not
> >sure if it has any relevance to btrfs.
> >
> >IOWs, I'd like to know why this restriction exists - what does
> >cleancache care about how the filesystem maps blocks to the page in
> >the page cache - any way the filesystem does this it uses
> >page->private to hide this fact from the page cache....
> + Konrad (cleancache maintainer) for any opinion.

That is a bug. It should not care about the size of it - as long
as 'struct page *' is passed in. If the underlaying architecture
has 64KB pages, it should work (and I think it does as zcache2
can do it).


> >
> >|- A clustered FS should invoke the "shared_init_fs" cleancache
> >|  hook to get best performance for some backends.
> >
> >Not a problem.
> >
> >So there's a couple of things that need to be explained and
> >explored, and a bunch of testing to be done....

Any patches that I can put on my environment to test it?
Thanks.
> >
> James

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  reply	other threads:[~2013-05-22 19:28 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-01 12:39 Cleancache support in XFS James Dingwall
2013-05-01 16:20 ` Ben Myers
2013-05-01 22:30   ` Dave Chinner
2013-05-02  8:24     ` James Dingwall
2013-05-22 19:28       ` Konrad Rzeszutek Wilk [this message]
2013-05-24  7:30         ` James Dingwall
2013-06-07 17:08           ` Konrad Rzeszutek Wilk
2013-07-19  7:18             ` James Dingwall
2013-07-22 15:48               ` Konrad Rzeszutek Wilk
2013-07-23  7:23                 ` James Dingwall
2013-07-23  8:27                   ` Dave Chinner
2013-07-23  8:53                     ` James Dingwall
2013-11-21 13:35                     ` James Dingwall
2013-11-21 16:07                       ` Ben Myers
2013-11-21 22:12                         ` Dave Chinner
2013-11-26 16:35                           ` Konrad Rzeszutek Wilk
2013-11-26 16:35                         ` Konrad Rzeszutek Wilk
2013-05-13  8:59 ` James Dingwall
  -- strict thread matches above, loose matches on Subject: below --
2012-04-30 17:31 Alexey Vlasov
2012-04-30 19:12 ` Christoph Hellwig
2012-05-02  8:02   ` Alexey Vlasov
2012-05-05 23:40     ` Dave Chinner

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=20130522192834.GD10617@phenom.dumpdata.com \
    --to=konrad.wilk@oracle.com \
    --cc=bpm@sgi.com \
    --cc=james.dingwall@zynstra.com \
    --cc=xfs@oss.sgi.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.