Discussion:
[PATCH] GOP_ALLOC and fallocate for puffs (round 2)
Emmanuel Dreyfus
2014-10-14 17:05:51 UTC
Permalink
Hi

Here is the latest iteration of my patch to ensure we avoid sending data
to the page cache we cannot flush later.
http://ftp.espci.fr/shadow/manu/puffs-alloc.patch

- When writing, we make sure backend storage is allocated in two cases:
1) the file is sparse, hence we never know if backend storage is here.
2) the file grows: we know we need to allocated for the new area.
- sparse file detection is done at when updating metadata cache: if
size is bigger than allocated blocks, it is sparse.
- I add fallocate FUSE operation (userland support is in another patch)
for efficient backend storage allocation.
- If fallocate is unavailable, I fallback to explicit zero-filling.
- puffs_vnop_write() is split into two functions, puffs_vnop_write_cache()
that writes in cache, puffs_vnop_write_fs that writes to the FS

The change lets NetBSD pass GlusterFS quota test. Without it, process
writing over quota hang in DE state (exitting, disk I/O ongoing: it cannot
flush cached data overquota and therefore cannot exit).

Opinions?

One possible improvement: if PUFFS fallocate returne EOPNOTSUP / ENOSYS,
we remove it from the operation array? This is dirty, but since we have
a fallocate systemcalls that has no implementation for FFS, we are very
likely to encounter that case.
--
Emmanuel Dreyfus
***@netbsd.org
J. Hannken-Illjes
2014-10-15 09:48:20 UTC
Permalink
Post by Emmanuel Dreyfus
Hi
Here is the latest iteration of my patch to ensure we avoid sending data
to the page cache we cannot flush later.
http://ftp.espci.fr/shadow/manu/puffs-alloc.patch
1) the file is sparse, hence we never know if backend storage is here.
2) the file grows: we know we need to allocated for the new area.
- sparse file detection is done at when updating metadata cache: if
size is bigger than allocated blocks, it is sparse.
- I add fallocate FUSE operation (userland support is in another patch)
for efficient backend storage allocation.
- If fallocate is unavailable, I fallback to explicit zero-filling.
- puffs_vnop_write() is split into two functions, puffs_vnop_write_cache()
that writes in cache, puffs_vnop_write_fs that writes to the FS
First (and for the last time) GOP_ALLOC() should go to the backend, maybe
with a short circuit on non-sparse, not-after-eof files.

Zero filling looks wrong, as the region may contain valid data.

Whatever you do you should increment the protocol version number.

If you want to make UBC work with PUFFS fsx may help. Last time
I tried it failed badly on a rump_ffs mount. You may find it here:

http://www.netbsd.org/~hannken/fsx.tgz

--
J. Hannken-Illjes - ***@eis.cs.tu-bs.de - TU Braunschweig (Germany)
Emmanuel Dreyfus
2014-10-15 23:49:38 UTC
Permalink
Post by J. Hannken-Illjes
If you want to make UBC work with PUFFS fsx may help. Last time
http://www.netbsd.org/~hannken/fsx.tgz
You just run it as fsx testfile ?
--
Emmanuel Dreyfus
http://hcpnet.free.fr/pubz
***@netbsd.org
Loading...